Logo ROOT  
Reference Guide
REvePointSet.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT7_REvePointSet
13 #define ROOT7_REvePointSet
14 
15 #include <ROOT/REveElement.hxx>
17 #include <ROOT/REveVector.hxx>
18 
19 #include <TAttMarker.h>
20 #include <TAttBBox.h>
21 
22 #include <cassert>
23 
24 namespace ROOT {
25 namespace Experimental {
26 
27 ////////////////////////////////////////////////////////////////////////////////
28 // REvePointSet
29 // Set of 3D points with same marker attributes;
30 // optionally each point can be assigned an
31 // external TRef or a number of integer indices.
32 ////////////////////////////////////////////////////////////////////////////////
33 
34 class REvePointSet : public REveElement,
35  public REveProjectable,
36  public TAttMarker,
37  public TAttBBox
38 {
39  friend class REvePointSetArray;
40 
41 private:
42  REvePointSet &operator=(const REvePointSet &) = delete;
43 
44 protected:
45  std::vector<REveVector> fPoints;
46  int fCapacity{0};
47  int fSize{0};
48 
49 public:
50  REvePointSet(const std::string& name="", const std::string& title="", Int_t n_points = 0);
51  REvePointSet(const REvePointSet &e);
52  virtual ~REvePointSet();
53 
54  REvePointSet *CloneElement() const override { return new REvePointSet(*this); }
55 
56  virtual void ClonePoints(const REvePointSet &e);
57 
58  void Reset(Int_t n_points = 0);
59  Int_t GrowFor(Int_t n_points);
60 
61  int SetNextPoint(float x, float y, float z);
62  int SetPoint(int n, float x, float y, float z);
63 
64  int GetCapacity() const { return fCapacity; }
65  int GetSize() const { return fSize; }
66 
67  REveVector& RefPoint(int n) { assert (n < fSize); return fPoints[n]; }
68  const REveVector& RefPoint(int n) const { assert (n < fSize); return fPoints[n]; }
69 
70  void SetMarkerColor(Color_t col) override { SetMainColor(col); }
71  void SetMarkerStyle(Style_t mstyle = 1) override;
72  void SetMarkerSize(Size_t msize = 1) override;
73 
74  void CopyVizParams(const REveElement *el) override;
75  void WriteVizParams(std::ostream &out, const TString &var) override;
76 
77  TClass* ProjectedClass(const REveProjection *p) const override;
78 
79  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
80  void BuildRenderData()override;
81 
82  void ComputeBBox() override;
83 
84  void PointSelected(Int_t id); // *SIGNAL*
85 };
86 
87 /******************************************************************************/
88 // REvePointSetArray
89 // Array of REvePointSet's filled via a common point-source; range of displayed REvePointSet's can be
90 // controlled, based on a separating quantity provided on fill-time by a user.
91 /******************************************************************************/
92 
94  public REveProjectable,
95  public TAttMarker
96 {
99 
100 protected:
101  REvePointSet **fBins{nullptr}; // Pointers to subjugated REvePointSet's.
102  Int_t fDefPointSetCapacity; // Default capacity of subjugated REvePointSet's.
103  Int_t fNBins; // Number of subjugated REvePointSet's.
104  Int_t fLastBin; //! Index of the last filled REvePointSet.
105  Double_t fMin, fCurMin; // Overall and current minimum value of the separating quantity.
106  Double_t fMax, fCurMax; // Overall and current maximum value of the separating quantity.
107  Double_t fBinWidth; // Separating quantity bin-width.
108  std::string fQuantName; // Name of the separating quantity.
109 
110 public:
111  REvePointSetArray(const std::string &name = "REvePointSetArray", const std::string &title = "");
112  virtual ~REvePointSetArray();
113 
114  void RemoveElementLocal(REveElement *el) override;
115  void RemoveElementsLocal() override;
116 
117  void SetMarkerColor(Color_t tcolor = 1) override;
118  void SetMarkerStyle(Style_t mstyle = 1) override;
119  void SetMarkerSize(Size_t msize = 1) override;
120 
121  Int_t Size(Bool_t under = kFALSE, Bool_t over = kFALSE) const;
122 
123  void InitBins(const std::string& quant_name, Int_t nbins, Double_t min, Double_t max);
125  void CloseBins();
126 
129 
130  Int_t GetNBins() const { return fNBins; }
131  REvePointSet *GetBin(Int_t bin) const { return fBins[bin]; }
132 
133  Double_t GetMin() const { return fMin; }
134  Double_t GetCurMin() const { return fCurMin; }
135  Double_t GetMax() const { return fMax; }
136  Double_t GetCurMax() const { return fCurMax; }
137 
138  void SetRange(Double_t min, Double_t max);
139 };
140 
141 /******************************************************************************/
142 // REvePointSetProjected
143 // Projected copy of a REvePointSet.
144 /******************************************************************************/
145 
147  public REveProjected
148 {
149 private:
152 
153 protected:
154  void SetDepthLocal(Float_t d) override;
155 
156 public:
159 
161  void UpdateProjection() override;
162  REveElement *GetProjectedAsElement() override { return this; }
163 
164  void PointSelected(Int_t id);
165 };
166 
167 } // namespace Experimental
168 } // namespace ROOT
169 
170 #endif
c
#define c(i)
Definition: RSha256.hxx:101
ROOT::Experimental::REveProjected
Definition: REveProjectionBases.hxx:81
n
const Int_t n
Definition: legend1.C:16
ROOT::Experimental::REvePointSetArray::fMin
Double_t fMin
Index of the last filled REvePointSet.
Definition: REvePointSet.hxx:105
ROOT::Experimental::REvePointSetArray::fCurMax
Double_t fCurMax
Definition: REvePointSet.hxx:106
ROOT::Experimental::REvePointSetArray::fLastBin
Int_t fLastBin
Definition: REvePointSet.hxx:104
ROOT::Experimental::REvePointSetArray::SetRange
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
Definition: REvePointSet.cxx:481
ROOT::Experimental::REvePointSetProjected::operator=
REvePointSetProjected & operator=(const REvePointSetProjected &)=delete
e
#define e(i)
Definition: RSha256.hxx:103
Style_t
short Style_t
Definition: RtypesCore.h:80
ROOT::Experimental::REvePointSetProjected
Definition: REvePointSet.hxx:148
ROOT::Experimental::REvePointSet::REvePointSet
REvePointSet(const std::string &name="", const std::string &title="", Int_t n_points=0)
Constructor.
Definition: REvePointSet.cxx:45
ROOT::Experimental::REvePointSet::Reset
void Reset(Int_t n_points=0)
Drop all data and set-up the data structures to recive new data.
Definition: REvePointSet.cxx:92
ROOT::Experimental::REvePointSetProjected::REvePointSetProjected
REvePointSetProjected(const REvePointSetProjected &)=delete
ROOT::Experimental::REvePointSet::SetNextPoint
int SetNextPoint(float x, float y, float z)
Definition: REvePointSet.cxx:120
REveProjectionBases.hxx
ROOT::Experimental::REvePointSetArray::fCurMin
Double_t fCurMin
Definition: REvePointSet.hxx:105
ROOT::Experimental::REvePointSet::GetSize
int GetSize() const
Definition: REvePointSet.hxx:65
ROOT::Experimental::REvePointSetArray::fQuantName
std::string fQuantName
Definition: REvePointSet.hxx:108
ROOT::Experimental::REvePointSet::fCapacity
int fCapacity
Definition: REvePointSet.hxx:46
ROOT::Experimental::REvePointSetArray::GetCurMin
Double_t GetCurMin() const
Definition: REvePointSet.hxx:134
ROOT::Experimental::REvePointSet::BuildRenderData
void BuildRenderData() override
Crates 3D point array for rendering.
Definition: REvePointSet.cxx:221
TAttMarker.h
ROOT::Experimental::REvePointSetArray::GetNBins
Int_t GetNBins() const
Definition: REvePointSet.hxx:130
Float_t
float Float_t
Definition: RtypesCore.h:57
ROOT::Experimental::REvePointSet::SetPoint
int SetPoint(int n, float x, float y, float z)
Definition: REvePointSet.cxx:125
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Experimental::REvePointSetArray::fBins
REvePointSet ** fBins
Definition: REvePointSet.hxx:101
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Experimental::REvePointSet::GetCapacity
int GetCapacity() const
Definition: REvePointSet.hxx:64
ROOT::Experimental::REvePointSetArray::SetMarkerSize
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to children.
Definition: REvePointSet.cxx:356
ROOT::Experimental::REvePointSet::RefPoint
const REveVector & RefPoint(int n) const
Definition: REvePointSet.hxx:68
ROOT::Experimental::REvePointSetProjected::SetProjection
void SetProjection(REveProjectionManager *proj, REveProjectable *model) override
Set projection manager and projection model.
Definition: REvePointSet.cxx:514
TString
Basic string class.
Definition: TString.h:136
ROOT::Experimental::REvePointSet::SetMarkerStyle
void SetMarkerStyle(Style_t mstyle=1) override
Set marker style, propagate to projecteds.
Definition: REvePointSet.cxx:143
ROOT::Experimental::REveElement
Definition: REveElement.hxx:41
ROOT::Experimental::REvePointSet::CopyVizParams
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
Definition: REvePointSet.cxx:178
ROOT::Experimental::REveVectorT< Float_t >
ROOT::Experimental::REvePointSetArray::InitBins
void InitBins(const std::string &quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
Definition: REvePointSet.cxx:390
Color_t
short Color_t
Definition: RtypesCore.h:83
ROOT::Experimental::REvePointSet::PointSelected
void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Definition: REvePointSet.cxx:250
ROOT::Experimental::REvePointSetArray::fDefPointSetCapacity
Int_t fDefPointSetCapacity
Definition: REvePointSet.hxx:102
ROOT::Experimental::REvePointSetArray::GetMax
Double_t GetMax() const
Definition: REvePointSet.hxx:135
ROOT::Experimental::REvePointSet::SetMarkerColor
void SetMarkerColor(Color_t col) override
Set the marker color.
Definition: REvePointSet.hxx:70
bool
ROOT::Experimental::REvePointSetArray::GetMin
Double_t GetMin() const
Definition: REvePointSet.hxx:133
ROOT::Experimental::REvePointSet::ComputeBBox
void ComputeBBox() override
Compute bounding box.
Definition: REvePointSet.cxx:233
ROOT::Experimental::REveProjection
REveProjection Base for specific classes that implement non-linear projections.
Definition: REveProjections.hxx:30
ROOT::Experimental::REvePointSetArray::SetMarkerColor
void SetMarkerColor(Color_t tcolor=1) override
Set marker color, propagate to children.
Definition: REvePointSet.cxx:328
TAttBBox
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
ROOT::Experimental::REvePointSetArray::SetDefPointSetCapacity
void SetDefPointSetCapacity(Int_t c)
Definition: REvePointSet.hxx:128
ROOT::Experimental::REvePointSet::fSize
int fSize
Definition: REvePointSet.hxx:47
ROOT::Experimental::REvePointSetProjected::~REvePointSetProjected
virtual ~REvePointSetProjected()
Definition: REvePointSet.hxx:158
ROOT::Experimental::REvePointSetArray::CloseBins
void CloseBins()
Call this after all the points have been filled.
Definition: REvePointSet.cxx:463
ROOT::Experimental::REvePointSet::~REvePointSet
virtual ~REvePointSet()
Destructor.
Definition: REvePointSet.cxx:74
ROOT::Experimental::REvePointSet::WriteCoreJson
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Write core json.
Definition: REvePointSet.cxx:208
ROOT::Experimental::REvePointSetArray::Size
Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
Definition: REvePointSet.cxx:372
ROOT::Experimental::REvePointSetProjected::UpdateProjection
void UpdateProjection() override
Re-apply the projection.
Definition: REvePointSet.cxx:540
ROOT::Experimental::REvePointSetArray::REvePointSetArray
REvePointSetArray(const REvePointSetArray &)=delete
ROOT::Experimental::REvePointSetProjected::GetProjectedAsElement
REveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to REveElement.
Definition: REvePointSet.hxx:162
REveElement.hxx
TAttBBox.h
ROOT::Experimental::REvePointSetProjected::PointSelected
void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Definition: REvePointSet.cxx:563
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
ROOT::Experimental::REveProjectable
Definition: REveProjectionBases.hxx:38
TAttMarker
Marker Attributes class.
Definition: TAttMarker.h:19
ROOT::Experimental::REvePointSet::WriteVizParams
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
Definition: REvePointSet.cxx:192
ROOT::Experimental::REvePointSet
Definition: REvePointSet.hxx:38
y
Double_t y[n]
Definition: legend1.C:17
ROOT::Experimental::REvePointSet::ClonePoints
virtual void ClonePoints(const REvePointSet &e)
Clone points and all point-related information from point-set 'e'.
Definition: REvePointSet.cxx:81
ROOT::Experimental::REvePointSetArray::fNBins
Int_t fNBins
Definition: REvePointSet.hxx:103
ROOT::Experimental::REvePointSetArray
Definition: REvePointSet.hxx:96
ROOT::Experimental::REvePointSet::fPoints
std::vector< REveVector > fPoints
Definition: REvePointSet.hxx:45
ROOT::Experimental::REvePointSet::CloneElement
REvePointSet * CloneElement() const override
Clone the element via copy constructor.
Definition: REvePointSet.hxx:54
ROOT::Experimental::REvePointSet::GrowFor
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
Definition: REvePointSet.cxx:107
ROOT::Experimental::REvePointSetArray::fBinWidth
Double_t fBinWidth
Definition: REvePointSet.hxx:107
ROOT::Experimental::REvePointSetProjected::REvePointSetProjected
REvePointSetProjected()
Default contructor.
Definition: REvePointSet.cxx:504
Double_t
double Double_t
Definition: RtypesCore.h:59
ROOT::Experimental::REvePointSetArray::GetCurMax
Double_t GetCurMax() const
Definition: REvePointSet.hxx:136
ROOT::Experimental::REvePointSetArray::fMax
Double_t fMax
Definition: REvePointSet.hxx:106
ROOT::Experimental::REvePointSetArray::GetDefPointSetCapacity
Int_t GetDefPointSetCapacity() const
Definition: REvePointSet.hxx:127
ROOT::Experimental::REvePointSet::SetMarkerSize
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to projecteds.
Definition: REvePointSet.cxx:160
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
ROOT::Experimental::REvePointSet::RefPoint
REveVector & RefPoint(int n)
Definition: REvePointSet.hxx:67
name
char name[80]
Definition: TGX11.cxx:110
ROOT::Experimental::REvePointSetArray::RemoveElementLocal
void RemoveElementLocal(REveElement *el) override
Virtual from REveElement, provide bin management.
Definition: REvePointSet.cxx:307
REveVector.hxx
d
#define d(i)
Definition: RSha256.hxx:102
make_cnn_model.model
model
Definition: make_cnn_model.py:6
ROOT::Experimental::REvePointSet::operator=
REvePointSet & operator=(const REvePointSet &)=delete
ROOT::Experimental::REvePointSetArray::operator=
REvePointSetArray & operator=(const REvePointSetArray &)=delete
ROOT::Experimental::REvePointSetArray::SetMarkerStyle
void SetMarkerStyle(Style_t mstyle=1) override
Set marker style, propagate to children.
Definition: REvePointSet.cxx:342
ROOT::Experimental::REveProjectionManager
REveProjectionManager Manager class for steering of projections and managing projected objects.
Definition: REveProjectionManager.hxx:30
ROOT::Experimental::REvePointSet::ProjectedClass
TClass * ProjectedClass(const REveProjection *p) const override
Virtual from REveProjectable, returns REvePointSetProjected class.
Definition: REvePointSet.cxx:202
ROOT::Experimental::REvePointSetProjected::SetDepthLocal
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
Definition: REvePointSet.cxx:524
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveElement::SetMainColor
virtual void SetMainColor(Color_t color)
Set main color of the element.
Definition: REveElement.cxx:684
ROOT::Experimental::REvePointSetArray::RemoveElementsLocal
void RemoveElementsLocal() override
Virtual from REveElement, provide bin management.
Definition: REvePointSet.cxx:320
ROOT::Experimental::REvePointSetArray::GetBin
REvePointSet * GetBin(Int_t bin) const
Definition: REvePointSet.hxx:131
ROOT::Experimental::REvePointSetArray::Fill
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
Definition: REvePointSet.cxx:434
int
Size_t
float Size_t
Definition: RtypesCore.h:87
ROOT::Experimental::REvePointSetArray::~REvePointSetArray
virtual ~REvePointSetArray()
Destructor: deletes the fBins array.
Definition: REvePointSet.cxx:298