Logo ROOT   6.14/05
Reference Guide
TGL5D.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 2009
3 /*************************************************************************
4  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGL5D
12 #define ROOT_TGL5D
13 
14 #include "TGLHistPainter.h"
15 #include "TGLUtil.h"
16 #include "TNamed.h"
17 #include "TAxis.h"
18 
19 #include <memory>
20 #include <vector>
21 
22 class TGL5DPainter;
23 class TTree;
24 
25 //TGL5D is a class to setup TGL5DPainter from TTree,
26 //hold data pointers, select required ranges,
27 //convert them into unit cube.
28 class TGL5DDataSet : public TNamed {
29  friend class TGL5DPainter;
30 private:
31  enum Edefaults{
32  kDefaultNB = 50//Default number of bins along X,Y,Z axes.
33  };
34 public:
35  TGL5DDataSet(TTree *inputData);
36 
37  //These are functions for TPad and
38  //TPad's standard machinery (picking, painting).
40  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
41  char *GetObjectInfo(Int_t px, Int_t py) const;
42  void Paint(Option_t *option);
43 
44  //This is for editor.
46 
47  //Select points for iso-surface.
48  void SelectPoints(Double_t v4Level, Double_t range);
49  UInt_t SelectedSize()const;
50 
51  //Take a point from selected sub-range (V1 == X, V2 == Y, V3 == Z for 3D).
52  Double_t V1(UInt_t ind)const;
53  Double_t V2(UInt_t ind)const;
54  Double_t V3(UInt_t ind)const;
55 
56  //Very similar to TH3's axes.
57  TAxis *GetXAxis()const;
58  TAxis *GetYAxis()const;
59  TAxis *GetZAxis()const;
60 
61  //Data ranges for V1, V2, V3, V4.
62  const Rgl::Range_t &GetXRange()const;
63  const Rgl::Range_t &GetYRange()const;
64  const Rgl::Range_t &GetZRange()const;
65  const Rgl::Range_t &GetV4Range()const;
66 
67 private:
68  //These three functions for TKDEFGT,
69  //which will convert all point coordinates
70  //into unit cube before density estimation.
74 
75  Long64_t fNP;//Number of entries.
76  const Double_t *fV1;//V1.
77  const Double_t *fV2;//V2.
78  const Double_t *fV3;//V3.
79  const Double_t *fV4;//V4.
80  const Double_t *fV5;//V5.
81 
82  //These are fixed ranges of the data set,
83  //calculated during construction.
84  Rgl::Range_t fV1MinMax;//V1 range.
85  Double_t fV1Range;//max - min.
86  Rgl::Range_t fV2MinMax;//V2 range.
87  Double_t fV2Range;//max - min.
88  Rgl::Range_t fV3MinMax;//V3 range.
89  Double_t fV3Range;//max - min.
90  Rgl::Range_t fV4MinMax;//V4 range.
91  Rgl::Range_t fV5MinMax;//V5 range.
92 
93  //This are ranges and bin numbers
94  //for plot, inside fixed ranges.
95  mutable TAxis fXAxis;
96  mutable TAxis fYAxis;
97  mutable TAxis fZAxis;
98  //V4 can have a string type.
100  //Painter to visualize dataset.
101  std::unique_ptr<TGLHistPainter> fPainter;
102  //Indices of points, selected for some iso-level.
103  std::vector<UInt_t> fIndices;
104 
105  TGL5DDataSet(const TGL5DDataSet &rhs);
107 
108  ClassDef(TGL5DDataSet, 0)//Class to read data from TTree and create TGL5DPainter.
109 };
110 
111 #endif
const Rgl::Range_t & GetYRange() const
V2 range (Y).
Definition: TGL5D.cxx:220
const Double_t * fV5
Definition: TGL5D.h:80
long long Long64_t
Definition: RtypesCore.h:69
std::unique_ptr< TGLHistPainter > fPainter
Definition: TGL5D.h:101
const char Option_t
Definition: RtypesCore.h:62
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1193
TAxis fYAxis
Definition: TGL5D.h:96
Double_t V3ToUnitCube(Double_t v3) const
V3 to unit cube.
Definition: TGL5D.cxx:260
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Action.
Definition: TGL5D.cxx:110
TGL5DDataSet & operator=(const TGL5DDataSet &rhs)
#define ClassDef(name, id)
Definition: Rtypes.h:320
const Rgl::Range_t & GetZRange() const
V3 range (Z).
Definition: TGL5D.cxx:228
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Bool_t fV4IsString
Definition: TGL5D.h:99
Rgl::Range_t fV1MinMax
Definition: TGL5D.h:84
Double_t V1(UInt_t ind) const
V1 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:164
TGL5DPainter * GetRealPainter() const
Get access to painter (for GUI-editor).
Definition: TGL5D.cxx:135
Double_t fV3Range
Definition: TGL5D.h:89
Rgl::Range_t fV5MinMax
Definition: TGL5D.h:91
const Double_t * fV2
Definition: TGL5D.h:77
const Double_t * fV3
Definition: TGL5D.h:78
void SelectPoints(Double_t v4Level, Double_t range)
"Select" sub-range from source data
Definition: TGL5D.cxx:144
const Rgl::Range_t & GetXRange() const
V1 range (X).
Definition: TGL5D.cxx:212
TAxis * GetYAxis() const
Y axis for plot.
Definition: TGL5D.cxx:196
Double_t V2(UInt_t ind) const
V2 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:172
Class to manage histogram axis.
Definition: TAxis.h:30
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check, if the object is under cursor.
Definition: TGL5D.cxx:102
unsigned int UInt_t
Definition: RtypesCore.h:42
const Rgl::Range_t & GetV4Range() const
V4 range.
Definition: TGL5D.cxx:236
Rgl::Range_t fV3MinMax
Definition: TGL5D.h:88
const Double_t * fV1
Definition: TGL5D.h:76
Rgl::Range_t fV2MinMax
Definition: TGL5D.h:86
Rgl::Range_t fV4MinMax
Definition: TGL5D.h:90
Double_t V2ToUnitCube(Double_t v2) const
V2 to unit cube.
Definition: TGL5D.cxx:252
double Double_t
Definition: RtypesCore.h:55
void Paint(Option_t *option)
Paint.
Definition: TGL5D.cxx:127
TGL5DPainter implements "gl5d" option for TTree::Draw.
Definition: TGL5DPainter.h:32
Long64_t fNP
Definition: TGL5D.h:75
Double_t fV2Range
Definition: TGL5D.h:87
TAxis fXAxis
Definition: TGL5D.h:95
TAxis fZAxis
Definition: TGL5D.h:97
char * GetObjectInfo(Int_t px, Int_t py) const
Info for status bar.
Definition: TGL5D.cxx:118
A TTree object has a header with a name and a title.
Definition: TTree.h:70
std::vector< UInt_t > fIndices
Definition: TGL5D.h:103
Double_t V1ToUnitCube(Double_t v1) const
V1 to unit cube.
Definition: TGL5D.cxx:244
TGL5DDataSet(TTree *inputData)
Constructor.
Definition: TGL5D.cxx:37
Double_t fV1Range
Definition: TGL5D.h:85
TAxis * GetXAxis() const
X axis for plot.
Definition: TGL5D.cxx:188
const Double_t * fV4
Definition: TGL5D.h:79
TAxis * GetZAxis() const
Z axis for plot.
Definition: TGL5D.cxx:204
Double_t V3(UInt_t ind) const
V3 from sub-range, converted to unit cube.
Definition: TGL5D.cxx:180
UInt_t SelectedSize() const
Size of selected sub-range.
Definition: TGL5D.cxx:156