]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | // $Header$ |
2 | ||
3 | #ifndef REVE_GuiPointSet_H | |
4 | #define REVE_GuiPointSet_H | |
5 | ||
6 | #include <Reve/PODs.h> | |
7 | #include <Reve/RenderElement.h> | |
32e219c2 | 8 | #include <Reve/NLTBases.h> |
db75e62a | 9 | #include <Reve/TTreeTools.h> |
5a5a1232 | 10 | |
11 | #include <TPointSet3D.h> | |
32e219c2 | 12 | #include <TArrayI.h> |
5a5a1232 | 13 | |
14 | class TTree; | |
15 | class TF3; | |
16 | class TGListTreeItem; | |
17 | ||
18 | namespace Reve { | |
19 | ||
7d42b6c2 | 20 | class PointSet : public RenderElement, |
21 | public TPointSet3D, | |
32e219c2 | 22 | public TPointSelectorConsumer, |
23 | public NLTProjectable | |
5a5a1232 | 24 | { |
25 | friend class PointSetArray; | |
5a5a1232 | 26 | |
27 | protected: | |
32e219c2 | 28 | TString fTitle; // Title/tooltip of the PointSet. |
29 | TArrayI *fIntIds; // Optional array of integer ideices. | |
30 | Int_t fIntIdsPerPoint; // Number of integer indices assigned to each point. | |
31 | ||
32 | void AssertIntIdsSize(); | |
5a5a1232 | 33 | |
34 | public: | |
db75e62a | 35 | PointSet(Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ); |
36 | PointSet(const Text_t* name, Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ); | |
32e219c2 | 37 | virtual ~PointSet(); |
38 | ||
39 | virtual void ComputeBBox(); | |
5a5a1232 | 40 | |
32e219c2 | 41 | void Reset(Int_t n_points=0, Int_t n_int_ids=0); |
db75e62a | 42 | Int_t GrowFor(Int_t n_points); |
5a5a1232 | 43 | |
44 | virtual const Text_t* GetTitle() const { return fTitle; } | |
45 | virtual void SetTitle(const Text_t* t) { fTitle = t; } | |
46 | ||
32e219c2 | 47 | Int_t GetIntIdsPerPoint() const { return fIntIdsPerPoint; } |
48 | Int_t* GetPointIntIds(Int_t p) const; | |
49 | Int_t GetPointIntId(Int_t p, Int_t i) const; | |
50 | ||
51 | void SetPointIntIds(Int_t* ids); | |
52 | void SetPointIntIds(Int_t n, Int_t* ids); | |
53 | ||
54 | virtual void SetRnrElNameTitle(const Text_t* name, const Text_t* title); | |
55 | ||
5a5a1232 | 56 | virtual void SetMarkerColor(Color_t col) |
57 | { SetMainColor(col); } | |
58 | ||
59 | virtual void Paint(Option_t* option=""); | |
60 | ||
32e219c2 | 61 | virtual void InitFill(Int_t subIdNum); |
62 | virtual void TakeAction(TPointSelector*); | |
db75e62a | 63 | |
32e219c2 | 64 | virtual const TGPicture* GetListTreeIcon() { return RenderElement::fgListTreeIcons[3]; } |
65 | ||
66 | virtual TClass* ProjectedClass() const; | |
67 | ||
68 | ClassDef(PointSet, 1); // Render element containing an array of 3D points. | |
eb1c2e64 | 69 | }; // endclass PointSet |
5a5a1232 | 70 | |
71 | /**************************************************************************/ | |
72 | ||
5b457dfa | 73 | class PointSetArray : public RenderElement, |
7d42b6c2 | 74 | public TNamed, |
75 | public TAttMarker, | |
76 | public TPointSelectorConsumer | |
5a5a1232 | 77 | { |
361a0daf | 78 | friend class PointSetArrayEditor; |
79 | ||
265ecb21 | 80 | PointSetArray(const PointSetArray&); // Not implemented |
81 | PointSetArray& operator=(const PointSetArray&); // Not implemented | |
82 | ||
5a5a1232 | 83 | protected: |
32e219c2 | 84 | PointSet** fBins; // Pointers to subjugated PointSet's. |
85 | Int_t fDefPointSetCapacity; // Default capacity of subjugated PointSet's. | |
86 | Int_t fNBins; // Number of subjugated PointSet's. | |
87 | Int_t fLastBin; //! Index of the last filled PointSet. | |
5a5a1232 | 88 | Double_t fMin, fCurMin; |
89 | Double_t fMax, fCurMax; | |
90 | Double_t fBinWidth; | |
91 | TString fQuantName; | |
92 | ||
5a5a1232 | 93 | public: |
e4f80cd8 | 94 | PointSetArray(const Text_t* name="PointSetArray", const Text_t* title=""); |
5a5a1232 | 95 | virtual ~PointSetArray(); |
96 | ||
7d42b6c2 | 97 | virtual void RemoveElementLocal(RenderElement* el); |
32e219c2 | 98 | virtual void RemoveElementsLocal(); |
7d42b6c2 | 99 | |
5b457dfa | 100 | virtual void Paint(Option_t* option=""); |
d15308aa | 101 | |
102 | virtual void SetMarkerColor(Color_t tcolor=1); | |
103 | virtual void SetMarkerStyle(Style_t mstyle=1); | |
104 | virtual void SetMarkerSize(Size_t msize=1); | |
5a5a1232 | 105 | |
32e219c2 | 106 | virtual void TakeAction(TPointSelector*); |
db75e62a | 107 | |
108 | ||
7d42b6c2 | 109 | void InitBins(const Text_t* quant_name, Int_t nbins, Double_t min, Double_t max, |
110 | Bool_t addRe=kTRUE); | |
db75e62a | 111 | void Fill(Double_t x, Double_t y, Double_t z, Double_t quant); |
32e219c2 | 112 | void SetPointId(TObject* id); |
d15308aa | 113 | void CloseBins(); |
5a5a1232 | 114 | |
32e219c2 | 115 | void SetOwnIds(Bool_t o); |
116 | ||
e4f80cd8 | 117 | Int_t GetDefPointSetCapacity() const { return fDefPointSetCapacity; } |
118 | void SetDefPointSetCapacity(Int_t c) { fDefPointSetCapacity = c; } | |
119 | ||
120 | Int_t GetNBins() const { return fNBins; } | |
121 | PointSet* GetBin(Int_t bin) const { return fBins[bin]; } | |
122 | ||
5a5a1232 | 123 | Double_t GetMin() const { return fMin; } |
124 | Double_t GetCurMin() const { return fCurMin; } | |
125 | Double_t GetMax() const { return fMax; } | |
126 | Double_t GetCurMax() const { return fCurMax; } | |
127 | ||
128 | void SetRange(Double_t min, Double_t max); | |
129 | ||
5a5a1232 | 130 | ClassDef(PointSetArray, 1); |
131 | }; | |
132 | ||
32e219c2 | 133 | /**************************************************************************/ |
134 | ||
135 | class NLTPointSet : public PointSet, | |
136 | public NLTProjected | |
137 | { | |
138 | private: | |
139 | NLTPointSet(const NLTPointSet&); // Not implemented | |
140 | NLTPointSet& operator=(const NLTPointSet&); // Not implemented | |
141 | ||
142 | protected: | |
143 | ||
144 | public: | |
145 | NLTPointSet(); | |
146 | virtual ~NLTPointSet() {} | |
147 | ||
148 | virtual void SetProjection(NLTProjector* proj, NLTProjectable* model); | |
149 | ||
150 | virtual void UpdateProjection(); | |
151 | ||
152 | ClassDef(NLTPointSet, 1); | |
153 | }; // endclass NLTPointSet | |
154 | ||
5a5a1232 | 155 | } |
156 | ||
157 | #endif |