Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ~TEvePointSet() override;
54
55 TObject* GetObject(const TEveException&) const override
56 { const TObject* obj = this; return const_cast<TObject*>(obj); }
57
58 TEvePointSet* CloneElement() const override { 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 const char* GetTitle() const override { return fTitle; }
66 const char* GetElementName() const override { return TPointSet3D::GetName(); }
67 const char* GetElementTitle() const override { return fTitle; }
68 void SetElementName (const char* n) override { fName = n; NameTitleChanged(); }
69 virtual void SetTitle(const char* t) { fTitle = t; NameTitleChanged(); }
70 void SetElementTitle(const char* t) override { fTitle = t; NameTitleChanged(); }
71 void SetElementNameTitle(const char* n, const char* t) override
72 { fName = n; fTitle = t; NameTitleChanged(); }
73
77
78 void SetPointIntIds(Int_t* ids);
79 void SetPointIntIds(Int_t n, Int_t* ids);
80
81 void SetMarkerColor(Color_t col) override { SetMainColor(col); }
82 void SetMarkerStyle(Style_t mstyle=1) override;
83 void SetMarkerSize(Size_t msize=1) override;
84
85 void Paint(Option_t* option="") override;
86
87 void InitFill(Int_t subIdNum) override;
88 void TakeAction(TEvePointSelector*) override;
89
90 void PointSelected(Int_t id) override; // *SIGNAL*
91
92 const TGPicture* GetListTreeIcon(Bool_t open=kFALSE) override;
93
94 void CopyVizParams(const TEveElement* el) override;
95 void WriteVizParams(std::ostream& out, const TString& var) override;
96
97 TClass* ProjectedClass(const TEveProjection* p) const override;
98
99 ClassDefOverride(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 ~TEvePointSetArray() override;
130
131 void RemoveElementLocal(TEveElement* el) override;
132 void RemoveElementsLocal() override;
133
134 void SetMarkerColor(Color_t tcolor=1) override;
135 void SetMarkerStyle(Style_t mstyle=1) override;
136 void SetMarkerSize(Size_t msize=1) override;
137
138 void TakeAction(TEvePointSelector*) override;
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 ClassDefOverride(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 void SetDepthLocal(Float_t d) override;
179
180public:
183
184 void SetProjection(TEveProjectionManager* proj, TEveProjectable* model) override;
185 void UpdateProjection() override;
186 TEveElement* GetProjectedAsElement() override { return this; }
187
188 void PointSelected(Int_t id) override;
189
190
191 ClassDefOverride(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
short Style_t
Definition RtypesCore.h:82
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:85
float Size_t
Definition RtypesCore.h:89
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t SetMarkerStyle
char name[80]
Definition TGX11.cxx:110
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:81
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
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:102
TEvePointSelectorConsumer is a virtual base for classes that can be filled from TTree data via the TE...
TEvePointSelector is a sub-class of TSelectorDraw for direct extraction of point-like data from a Tre...
Editor for TEvePointSetArray class.
An array of point-sets with each point-set playing a role of a bin in a histogram.
Double_t GetCurMin() const
Double_t GetCurMax() const
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
Double_t GetMin() const
Int_t GetNBins() const
TEvePointSet ** fBins
Double_t fMin
Index of the last filled TEvePointSet.
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to children.
void TakeAction(TEvePointSelector *) override
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
TEvePointSetArray & operator=(const TEvePointSetArray &)
void SetDefPointSetCapacity(Int_t c)
TEvePointSet * GetBin(Int_t bin) const
void CloseBins()
Call this after all the points have been filled.
~TEvePointSetArray() override
Destructor: deletes the fBins array.
void RemoveElementsLocal() override
Virtual from TEveElement, provide bin management.
void SetMarkerColor(Color_t tcolor=1) override
Set marker color, propagate to children.
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
Int_t GetDefPointSetCapacity() const
TEvePointSetArray(const TEvePointSetArray &)
void SetPointId(TObject *id)
Set external object id of the last added point.
void RemoveElementLocal(TEveElement *el) override
Virtual from TEveElement, provide bin management.
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
Double_t GetMax() const
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
Projected copy of a TEvePointSet.
void UpdateProjection() override
Re-apply the projection.
TEvePointSetProjected & operator=(const TEvePointSetProjected &)
void PointSelected(Int_t id) override
Virtual method of base class TPointSet3D.
void SetProjection(TEveProjectionManager *proj, TEveProjectable *model) override
Set projection manager and projection model.
TEveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to TEveElement.
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
TEvePointSetProjected()
Default contructor.
~TEvePointSetProjected() override
TEvePointSetProjected(const TEvePointSetProjected &)
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
void Paint(Option_t *option="") override
Paint point-set.
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
void SetElementTitle(const char *t) override
Virtual function for setting of title of an element.
void SetElementNameTitle(const char *n, const char *t) override
Virtual function for setting of name and title of render element.
TEvePointSet & operator=(const TEvePointSet &)
const char * GetElementTitle() const override
Virtual function for retrieving title of the render-element.
const TGPicture * GetListTreeIcon(Bool_t open=kFALSE) override
Return pointset icon.
void SetMarkerColor(Color_t col) override
Set the marker color.
~TEvePointSet() override
Destructor.
void CopyVizParams(const TEveElement *el) override
Copy visualization parameters from element el.
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'.
void SetElementName(const char *n) override
Virtual function for setting of name of an element.
Int_t GetIntIdsPerPoint() const
TClass * ProjectedClass(const TEveProjection *p) const override
Virtual from TEveProjectable, returns TEvePointSetProjected class.
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
TArrayI * fIntIds
virtual void SetTitle(const char *t)
TEvePointSet * CloneElement() const override
Clone the element via copy constructor.
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.
const char * GetTitle() const override
Returns title of object.
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
TString fTitle
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to projecteds.
const char * GetElementName() const override
Virtual function for retrieving name of the element.
void PointSelected(Int_t id) override
Virtual method of base class TPointSet3D.
Int_t fIntIdsPerPoint
Int_t * GetPointIntIds(Int_t p) const
Return a pointer to integer ids of point with index p.
void TakeAction(TEvePointSelector *) override
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
TObject * GetObject(const TEveException &) const override
Get a TObject associated with this render-element.
void InitFill(Int_t subIdNum) override
Initialize point-set for new filling.
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 TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:456
TPolyMarker3D using TPointSet3DGL for direct OpenGL rendering.
Definition TPointSet3D.h:22
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:139
A TTree represents a columnar dataset.
Definition TTree.h:79
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16