Logo ROOT  
Reference Guide
TEvePointSet.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 ROOT_TEvePointSet
13 #define ROOT_TEvePointSet
14 
15 #include "TEveElement.h"
16 #include "TEveProjectionBases.h"
17 #include "TEveTreeTools.h"
18 
19 #include "TArrayI.h"
20 #include "TPointSet3D.h"
21 #include "TQObject.h"
22 
23 class TTree;
24 class TF3;
25 class TGListTreeItem;
26 
27 /******************************************************************************/
28 // TEvePointSet
29 /******************************************************************************/
30 
31 class TEvePointSet : public TEveElement,
32  public TPointSet3D,
34  public TEveProjectable,
35  public TQObject
36 {
37  friend class TEvePointSetArray;
38 
39 private:
40  TEvePointSet& operator=(const TEvePointSet&); // Not implemented
41 
42 protected:
43  TString fTitle; // Title/tooltip of the TEvePointSet.
44  TArrayI *fIntIds; // Optional array of integer ideices.
45  Int_t fIntIdsPerPoint; // Number of integer indices assigned to each point.
46 
47  void AssertIntIdsSize();
48 
49 public:
50  TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
51  TEvePointSet(const char* name, Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ);
52  TEvePointSet(const TEvePointSet& e);
53  virtual ~TEvePointSet();
54 
55  virtual TObject* GetObject(const TEveException&) const
56  { const TObject* obj = this; return const_cast<TObject*>(obj); }
57 
58  virtual TEvePointSet* CloneElement() const { return new TEvePointSet(*this); }
59 
60  virtual void ClonePoints(const TEvePointSet& e);
61 
62  void Reset(Int_t n_points=0, Int_t n_int_ids=0);
63  Int_t GrowFor(Int_t n_points);
64 
65  virtual const char* GetTitle() const { return fTitle; }
66  virtual const char* GetElementName() const { return TPointSet3D::GetName(); }
67  virtual const char* GetElementTitle() const { return fTitle; }
68  virtual void SetElementName (const char* n) { fName = n; NameTitleChanged(); }
69  virtual void SetTitle(const char* t) { fTitle = t; NameTitleChanged(); }
70  virtual void SetElementTitle(const char* t) { fTitle = t; NameTitleChanged(); }
71  virtual void SetElementNameTitle(const char* n, const char* t)
72  { fName = n; fTitle = t; NameTitleChanged(); }
73 
75  Int_t* GetPointIntIds(Int_t p) const;
76  Int_t GetPointIntId(Int_t p, Int_t i) const;
77 
78  void SetPointIntIds(Int_t* ids);
79  void SetPointIntIds(Int_t n, Int_t* ids);
80 
81  virtual void SetMarkerColor(Color_t col) { SetMainColor(col); }
82  virtual void SetMarkerStyle(Style_t mstyle=1);
83  virtual void SetMarkerSize(Size_t msize=1);
84 
85  virtual void Paint(Option_t* option="");
86 
87  virtual void InitFill(Int_t subIdNum);
88  virtual void TakeAction(TEvePointSelector*);
89 
90  virtual void PointSelected(Int_t id); // *SIGNAL*
91 
92  virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
93 
94  virtual void CopyVizParams(const TEveElement* el);
95  virtual void WriteVizParams(std::ostream& out, const TString& var);
96 
97  virtual TClass* ProjectedClass(const TEveProjection* p) const;
98 
99  ClassDef(TEvePointSet, 0); // Set of 3D points with same marker attributes; optionally each point can be assigned an external TRef or a number of integer indices.
100 };
101 
102 
103 /******************************************************************************/
104 // TEvePointSetArray
105 /******************************************************************************/
106 
108  public TNamed,
109  public TAttMarker,
111 {
113 
114  TEvePointSetArray(const TEvePointSetArray&); // Not implemented
115  TEvePointSetArray& operator=(const TEvePointSetArray&); // Not implemented
116 
117 protected:
118  TEvePointSet **fBins; // Pointers to subjugated TEvePointSet's.
119  Int_t fDefPointSetCapacity; // Default capacity of subjugated TEvePointSet's.
120  Int_t fNBins; // Number of subjugated TEvePointSet's.
121  Int_t fLastBin; //! Index of the last filled TEvePointSet.
122  Double_t fMin, fCurMin; // Overall and current minimum value of the separating quantity.
123  Double_t fMax, fCurMax; // Overall and current maximum value of the separating quantity.
124  Double_t fBinWidth; // Separating quantity bin-width.
125  TString fQuantName; // Name of the separating quantity.
126 
127 public:
128  TEvePointSetArray(const char* name="TEvePointSetArray", const char* title="");
129  virtual ~TEvePointSetArray();
130 
131  virtual void RemoveElementLocal(TEveElement* el);
132  virtual void RemoveElementsLocal();
133 
134  virtual void SetMarkerColor(Color_t tcolor=1);
135  virtual void SetMarkerStyle(Style_t mstyle=1);
136  virtual void SetMarkerSize(Size_t msize=1);
137 
138  virtual void TakeAction(TEvePointSelector*);
139 
140  virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const;
141 
142  void InitBins(const char* quant_name, Int_t nbins, Double_t min, Double_t max);
144  void SetPointId(TObject* id);
145  void CloseBins();
146 
147  void SetOwnIds(Bool_t o);
148 
151 
152  Int_t GetNBins() const { return fNBins; }
153  TEvePointSet* GetBin(Int_t bin) const { return fBins[bin]; }
154 
155  Double_t GetMin() const { return fMin; }
156  Double_t GetCurMin() const { return fCurMin; }
157  Double_t GetMax() const { return fMax; }
158  Double_t GetCurMax() const { return fCurMax; }
159 
160  void SetRange(Double_t min, Double_t max);
161 
162  ClassDef(TEvePointSetArray, 0); // Array of TEvePointSet's filled via a common point-source; range of displayed TEvePointSet's can be controlled, based on a separating quantity provided on fill-time by a user.
163 };
164 
165 
166 /******************************************************************************/
167 // TEvePointSetProjected
168 /******************************************************************************/
169 
171  public TEveProjected
172 {
173 private:
174  TEvePointSetProjected(const TEvePointSetProjected&); // Not implemented
175  TEvePointSetProjected& operator=(const TEvePointSetProjected&); // Not implemented
176 
177 protected:
178  virtual void SetDepthLocal(Float_t d);
179 
180 public:
183 
185  virtual void UpdateProjection();
186  virtual TEveElement* GetProjectedAsElement() { return this; }
187 
188  virtual void PointSelected(Int_t id);
189 
190 
191  ClassDef(TEvePointSetProjected, 0); // Projected copy of a TEvePointSet.
192 };
193 
194 #endif
TEvePointSetArray::InitBins
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
Definition: TEvePointSet.cxx:599
c
#define c(i)
Definition: RSha256.hxx:119
n
const Int_t n
Definition: legend1.C:16
TEvePointSet::GetIntIdsPerPoint
Int_t GetIntIdsPerPoint() const
Definition: TEvePointSet.h:74
TEvePointSetArray::GetMin
Double_t GetMin() const
Definition: TEvePointSet.h:155
TEvePointSetArray::~TEvePointSetArray
virtual ~TEvePointSetArray()
Destructor: deletes the fBins array.
Definition: TEvePointSet.cxx:455
TEveElement
Definition: TEveElement.h:35
e
#define e(i)
Definition: RSha256.hxx:121
TEvePointSetArray::GetBin
TEvePointSet * GetBin(Int_t bin) const
Definition: TEvePointSet.h:153
Style_t
short Style_t
Definition: RtypesCore.h:80
TEvePointSetArray::SetRange
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
Definition: TEvePointSet.cxx:710
TGPicture
Definition: TGPicture.h:36
TEvePointSetArray::fNBins
Int_t fNBins
Definition: TEvePointSet.h:120
TEvePointSet::SetTitle
virtual void SetTitle(const char *t)
Definition: TEvePointSet.h:69
TEvePointSetProjected::operator=
TEvePointSetProjected & operator=(const TEvePointSetProjected &)
TEvePointSetArray::fCurMax
Double_t fCurMax
Definition: TEvePointSet.h:123
TEvePointSet::SetElementTitle
virtual void SetElementTitle(const char *t)
Virtual function for setting of title of an element.
Definition: TEvePointSet.h:70
TEveProjection
Definition: TEveProjections.h:26
TEvePointSet::GrowFor
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
Definition: TEvePointSet.cxx:170
TEvePointSet::TakeAction
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
Definition: TEvePointSet.cxx:312
TEvePointSet::fIntIds
TArrayI * fIntIds
Definition: TEvePointSet.h:44
TEvePointSetArray::GetCurMin
Double_t GetCurMin() const
Definition: TEvePointSet.h:156
TTree
Definition: TTree.h:79
TEvePointSetArray::fDefPointSetCapacity
Int_t fDefPointSetCapacity
Definition: TEvePointSet.h:119
TEvePointSet::AssertIntIdsSize
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
Definition: TEvePointSet.cxx:184
Float_t
float Float_t
Definition: RtypesCore.h:57
TEvePointSet::GetListTreeIcon
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Return pointset icon.
Definition: TEvePointSet.cxx:138
TEvePointSet::SetPointIntIds
void SetPointIntIds(Int_t *ids)
Set integer ids for the last point that was registered (most probably via TPolyMarker3D::SetNextPoint...
Definition: TEvePointSet.cxx:221
Int_t
int Int_t
Definition: RtypesCore.h:45
TEvePointSet::SetMarkerSize
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to projecteds.
Definition: TEvePointSet.cxx:262
TEvePointSetArray::fMax
Double_t fMax
Definition: TEvePointSet.h:123
TEvePointSet::SetElementName
virtual void SetElementName(const char *n)
Virtual function for setting of name of an element.
Definition: TEvePointSet.h:68
TEvePointSet::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TEvePointSet.h:65
x
Double_t x[n]
Definition: legend1.C:17
TEvePointSet::TEvePointSet
TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ)
Constructor.
Definition: TEvePointSet.cxx:44
TEveElement.h
TEvePointSetProjected
Definition: TEvePointSet.h:170
TEvePointSetArray::fQuantName
TString fQuantName
Definition: TEvePointSet.h:125
TEvePointSetArray::TEvePointSetArray
TEvePointSetArray(const TEvePointSetArray &)
TEvePointSet::InitFill
virtual void InitFill(Int_t subIdNum)
Initialize point-set for new filling.
Definition: TEvePointSet.cxx:293
TString
Definition: TString.h:136
ROOT::Math::detail::open
@ open
Definition: GenVectorIO.h:55
TEvePointSet::SetMarkerStyle
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to projecteds.
Definition: TEvePointSet.cxx:241
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TEvePointSetArray::SetMarkerColor
virtual void SetMarkerColor(Color_t tcolor=1)
Set marker color, propagate to children.
Definition: TEvePointSet.cxx:485
TEvePointSet::fIntIdsPerPoint
Int_t fIntIdsPerPoint
Definition: TEvePointSet.h:45
Color_t
short Color_t
Definition: RtypesCore.h:83
TEveProjectionBases.h
TEvePointSetArray::Size
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
Definition: TEvePointSet.cxx:581
bool
TEvePointSetArray::SetOwnIds
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
Definition: TEvePointSet.cxx:696
TEvePointSet
Definition: TEvePointSet.h:31
TPointSet3D
Definition: TPointSet3D.h:21
TEvePointSetArray::fBinWidth
Double_t fBinWidth
Definition: TEvePointSet.h:124
TEvePointSetArray::RemoveElementsLocal
virtual void RemoveElementsLocal()
Virtual from TEveElement, provide bin management.
Definition: TEvePointSet.cxx:477
TEvePointSet::GetElementName
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
Definition: TEvePointSet.h:66
TEvePointSetArray::Fill
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
Definition: TEvePointSet.cxx:642
TEvePointSet::SetElementNameTitle
virtual void SetElementNameTitle(const char *n, const char *t)
Virtual function for setting of name and title of render element.
Definition: TEvePointSet.h:71
TEvePointSetProjected::UpdateProjection
virtual void UpdateProjection()
Re-apply the projection.
Definition: TEvePointSet.cxx:768
TQObject.h
TEveProjectable
Definition: TEveProjectionBases.h:34
TQObject
Definition: TQObject.h:48
TEvePointSet::GetPointIntId
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
Definition: TEvePointSet.cxx:210
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TEvePointSetProjected::SetProjection
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
Set projection manager and projection model.
Definition: TEvePointSet.cxx:744
TEvePointSetArray::GetMax
Double_t GetMax() const
Definition: TEvePointSet.h:157
TEvePointSet::GetObject
virtual TObject * GetObject(const TEveException &) const
Get a TObject associated with this render-element.
Definition: TEvePointSet.h:55
TEveProjectionManager
Definition: TEveProjectionManager.h:20
TEvePointSetProjected::~TEvePointSetProjected
virtual ~TEvePointSetProjected()
Definition: TEvePointSet.h:182
TEvePointSet::WriteVizParams
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
Definition: TEvePointSet.cxx:387
TEvePointSetArray::GetCurMax
Double_t GetCurMax() const
Definition: TEvePointSet.h:158
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TAttMarker
Definition: TAttMarker.h:19
TEvePointSetProjected::TEvePointSetProjected
TEvePointSetProjected()
Default contructor.
Definition: TEvePointSet.cxx:734
TEvePointSetArray::RemoveElementLocal
virtual void RemoveElementLocal(TEveElement *el)
Virtual from TEveElement, provide bin management.
Definition: TEvePointSet.cxx:464
TPolyMarker3D::fName
TString fName
Definition: TPolyMarker3D.h:39
TArrayI.h
TEvePointSelectorConsumer::ETreeVarType_e
ETreeVarType_e
Definition: TEveTreeTools.h:48
TEvePointSelectorConsumer::kTVT_XYZ
@ kTVT_XYZ
Definition: TEveTreeTools.h:48
TF3
Definition: TF3.h:28
y
Double_t y[n]
Definition: legend1.C:17
TEvePointSetArray::SetMarkerSize
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to children.
Definition: TEvePointSet.cxx:515
TEvePointSetArray::TakeAction
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
Definition: TEvePointSet.cxx:532
TEvePointSetArray::GetNBins
Int_t GetNBins() const
Definition: TEvePointSet.h:152
TEvePointSetArray::CloseBins
void CloseBins()
Call this after all the points have been filled.
Definition: TEvePointSet.cxx:680
TEvePointSetProjected::PointSelected
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Definition: TEvePointSet.cxx:788
TEvePointSelector
Definition: TEveTreeTools.h:66
TEvePointSet::ClonePoints
virtual void ClonePoints(const TEvePointSet &e)
Clone points and all point-related information from point-set 'e'.
Definition: TEvePointSet.cxx:111
TEvePointSet::GetPointIntIds
Int_t * GetPointIntIds(Int_t p) const
Return a pointer to integer ids of point with index p.
Definition: TEvePointSet.cxx:197
TEvePointSet::CopyVizParams
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
Definition: TEvePointSet.cxx:372
TEvePointSetArray::fLastBin
Int_t fLastBin
Definition: TEvePointSet.h:121
TPointSet3D.h
TEvePointSetArray::SetPointId
void SetPointId(TObject *id)
Set external object id of the last added point.
Definition: TEvePointSet.cxx:669
Double_t
double Double_t
Definition: RtypesCore.h:59
TEvePointSelectorConsumer
Definition: TEveTreeTools.h:45
TEveException
Definition: TEveUtil.h:101
TPolyMarker3D::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TPolyMarker3D.h:57
TEveProjected
Definition: TEveProjectionBases.h:83
TClass
Definition: TClass.h:80
TEvePointSet::fTitle
TString fTitle
Definition: TEvePointSet.h:43
TEvePointSet::operator=
TEvePointSet & operator=(const TEvePointSet &)
TEvePointSetArray::GetDefPointSetCapacity
Int_t GetDefPointSetCapacity() const
Definition: TEvePointSet.h:149
TEveElement::SetMainColor
virtual void SetMainColor(Color_t color)
Set main color of the element.
Definition: TEveElement.cxx:1158
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TEvePointSet::ProjectedClass
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEvePointSetProjected class.
Definition: TEvePointSet.cxx:397
TEvePointSetArray::SetDefPointSetCapacity
void SetDefPointSetCapacity(Int_t c)
Definition: TEvePointSet.h:150
name
char name[80]
Definition: TGX11.cxx:110
TEvePointSetProjected::GetProjectedAsElement
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
Definition: TEvePointSet.h:186
TEvePointSetArray::fBins
TEvePointSet ** fBins
Definition: TEvePointSet.h:118
TEvePointSetProjected::SetDepthLocal
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
Definition: TEvePointSet.cxx:754
TEvePointSetArrayEditor
Definition: TEvePointSetArrayEditor.h:26
d
#define d(i)
Definition: RSha256.hxx:120
TEvePointSet::SetMarkerColor
virtual void SetMarkerColor(Color_t col)
Definition: TEvePointSet.h:81
make_cnn_model.model
model
Definition: make_cnn_model.py:6
TEvePointSet::CloneElement
virtual TEvePointSet * CloneElement() const
Clone the element via copy constructor.
Definition: TEvePointSet.h:58
TEvePointSet::PointSelected
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Definition: TEvePointSet.cxx:406
TEveTreeTools.h
TEvePointSet::GetElementTitle
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
Definition: TEvePointSet.h:67
TEvePointSet::Paint
virtual void Paint(Option_t *option="")
Paint point-set.
Definition: TEvePointSet.cxx:283
TEvePointSetArray::operator=
TEvePointSetArray & operator=(const TEvePointSetArray &)
TGListTreeItem
Definition: TGListTree.h:43
TEvePointSet::Reset
void Reset(Int_t n_points=0, Int_t n_int_ids=0)
Drop all data and set-up the data structures to recive new data.
Definition: TEvePointSet.cxx:148
TEvePointSetArray::fMin
Double_t fMin
Index of the last filled TEvePointSet.
Definition: TEvePointSet.h:122
TEvePointSet::~TEvePointSet
virtual ~TEvePointSet()
Destructor.
Definition: TEvePointSet.cxx:103
TArrayI
Definition: TArrayI.h:27
TEvePointSetArray::fCurMin
Double_t fCurMin
Definition: TEvePointSet.h:122
int
TEvePointSetArray
Definition: TEvePointSet.h:107
TEvePointSetArray::SetMarkerStyle
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to children.
Definition: TEvePointSet.cxx:500
Size_t
float Size_t
Definition: RtypesCore.h:87
TEveElement::NameTitleChanged
virtual void NameTitleChanged()
Virtual function called when a name or title of the element has been changed.
Definition: TEveElement.cxx:342