Logo ROOT   6.18/05
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
23class TTree;
24class TF3;
25class TGListTreeItem;
26
27/******************************************************************************/
28// TEvePointSet
29/******************************************************************************/
30
32 public TPointSet3D,
34 public TEveProjectable,
35 public TQObject
36{
37 friend class TEvePointSetArray;
38
39private:
40 TEvePointSet& operator=(const TEvePointSet&); // Not implemented
41
42protected:
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
49public:
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);
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
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
117protected:
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
127public:
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{
173private:
176
177protected:
178 virtual void SetDepthLocal(Float_t d);
179
180public:
183
184 virtual void SetProjection(TEveProjectionManager* proj, TEveProjectable* model);
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
#define d(i)
Definition: RSha256.hxx:102
#define c(i)
Definition: RSha256.hxx:101
#define e(i)
Definition: RSha256.hxx:103
int Int_t
Definition: RtypesCore.h:41
float Size_t
Definition: RtypesCore.h:83
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
short Color_t
Definition: RtypesCore.h:79
short Style_t
Definition: RtypesCore.h:76
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
Array of integers (32 bits per element).
Definition: TArrayI.h:27
Marker Attributes class.
Definition: TAttMarker.h:19
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
virtual void NameTitleChanged()
Virtual function called when a name or title of the element has been changed.
virtual void SetMainColor(Color_t color)
Set main color of the element.
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:103
TEvePointSelectorConsumer is a virtual base for classes that can be filled from TTree data via the TE...
Definition: TEveTreeTools.h:46
TEvePointSelector is a sub-class of TSelectorDraw for direct extraction of point-like data from a Tre...
Definition: TEveTreeTools.h:67
Editor for TEvePointSetArray class.
An array of point-sets with each point-set playing a role of a bin in a histogram.
Definition: TEvePointSet.h:111
virtual ~TEvePointSetArray()
Destructor: deletes the fBins array.
Double_t GetCurMin() const
Definition: TEvePointSet.h:156
Double_t GetCurMax() const
Definition: TEvePointSet.h:158
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to children.
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
Double_t GetMin() const
Definition: TEvePointSet.h:155
Int_t GetNBins() const
Definition: TEvePointSet.h:152
TEvePointSet ** fBins
Definition: TEvePointSet.h:118
Double_t fMin
Index of the last filled TEvePointSet.
Definition: TEvePointSet.h:122
virtual void SetMarkerColor(Color_t tcolor=1)
Set marker color, propagate to children.
TEvePointSetArray & operator=(const TEvePointSetArray &)
void SetDefPointSetCapacity(Int_t c)
Definition: TEvePointSet.h:150
TEvePointSet * GetBin(Int_t bin) const
Definition: TEvePointSet.h:153
void CloseBins()
Call this after all the points have been filled.
virtual void RemoveElementsLocal()
Virtual from TEveElement, provide bin management.
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
Int_t GetDefPointSetCapacity() const
Definition: TEvePointSet.h:149
TEvePointSetArray(const TEvePointSetArray &)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to children.
void SetPointId(TObject *id)
Set external object id of the last added point.
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
Double_t GetMax() const
Definition: TEvePointSet.h:157
Int_t fDefPointSetCapacity
Definition: TEvePointSet.h:119
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
virtual void RemoveElementLocal(TEveElement *el)
Virtual from TEveElement, provide bin management.
Projected copy of a TEvePointSet.
Definition: TEvePointSet.h:172
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
TEvePointSetProjected & operator=(const TEvePointSetProjected &)
virtual void UpdateProjection()
Re-apply the projection.
virtual ~TEvePointSetProjected()
Definition: TEvePointSet.h:182
TEvePointSetProjected()
Default contructor.
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
Definition: TEvePointSet.h:186
TEvePointSetProjected(const TEvePointSetProjected &)
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
Set projection manager and projection model.
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
Definition: TEvePointSet.h:36
virtual void InitFill(Int_t subIdNum)
Initialize point-set for new filling.
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEvePointSetProjected class.
virtual void SetElementNameTitle(const char *n, const char *t)
Virtual function for setting of name and title of render element.
Definition: TEvePointSet.h:71
virtual TEvePointSet * CloneElement() const
Clone the element via copy constructor.
Definition: TEvePointSet.h:58
TEvePointSet & operator=(const TEvePointSet &)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to projecteds.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Return pointset icon.
virtual void SetElementTitle(const char *t)
Virtual function for setting of title of an element.
Definition: TEvePointSet.h:70
virtual const char * GetTitle() const
Returns title of object.
Definition: TEvePointSet.h:65
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
void SetPointIntIds(Int_t *ids)
Set integer ids for the last point that was registered (most probably via TPolyMarker3D::SetNextPoint...
virtual void ClonePoints(const TEvePointSet &e)
Clone points and all point-related information from point-set 'e'.
Int_t GetIntIdsPerPoint() const
Definition: TEvePointSet.h:74
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
Definition: TEvePointSet.h:66
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
virtual void SetMarkerColor(Color_t col)
Set the marker color.
Definition: TEvePointSet.h:81
TArrayI * fIntIds
Definition: TEvePointSet.h:44
virtual void SetTitle(const char *t)
Definition: TEvePointSet.h:69
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
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.
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
TString fTitle
Definition: TEvePointSet.h:43
virtual ~TEvePointSet()
Destructor.
virtual void Paint(Option_t *option="")
Paint point-set.
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to projecteds.
virtual TObject * GetObject(const TEveException &) const
Get a TObject associated with this render-element.
Definition: TEvePointSet.h:55
TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ)
Constructor.
virtual const char * GetElementTitle() const
Virtual function for retrieving title of the render-element.
Definition: TEvePointSet.h:67
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
virtual void SetElementName(const char *n)
Virtual function for setting of name of an element.
Definition: TEvePointSet.h:68
Int_t fIntIdsPerPoint
Definition: TEvePointSet.h:45
Int_t * GetPointIntIds(Int_t p) const
Return a pointer to integer ids of point with index p.
Abstract base-class for non-linear projectable objects.
Abstract base class for classes that hold results of a non-linear projection transformation.
Manager class for steering of projections and managing projected objects.
Base-class for non-linear projections.
A 3-Dim function with parameters.
Definition: TF3.h:28
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
TPolyMarker3D using TPointSet3DGL for direct OpenGL rendering.
Definition: TPointSet3D.h:22
virtual const char * GetName() const
Returns name of object.
Definition: TPolyMarker3D.h:57
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition: TQObject.h:48
Basic string class.
Definition: TString.h:131
A TTree represents a columnar dataset.
Definition: TTree.h:71
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16