]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/PointSet.h
fc764dace79957338bd603943c83e03f9afcd6d7
[u/mrichter/AliRoot.git] / EVE / Reve / PointSet.h
1 // $Header$
2
3 #ifndef REVE_GuiPointSet_H
4 #define REVE_GuiPointSet_H
5
6 #include <Reve/PODs.h>
7 #include <Reve/RenderElement.h>
8 #include <Reve/TTreeTools.h>
9
10 #include <TPointSet3D.h>
11
12 class TTree;
13 class TF3;
14 class TGListTreeItem;
15
16 namespace Reve {
17
18 class PointSet : public TPointSet3D,
19                  public RenderElement,
20                  public TPointSelectorConsumer
21 {
22   friend class PointSetArray;
23 private:
24   void Init();
25
26 protected:
27   TString fTitle;
28
29 public:
30   PointSet(Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ);
31   PointSet(const Text_t* name, Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ);
32   PointSet(const Text_t* name, TTree* tree, TreeVarType_e tv_type=TVT_XYZ);
33
34   void  Reset(Int_t n_points=0);
35   Int_t GrowFor(Int_t n_points);
36
37   virtual const Text_t* GetTitle() const          { return fTitle; }
38   virtual void          SetTitle(const Text_t* t) { fTitle = t; }
39
40   virtual void SetMarkerColor(Color_t col)
41   { SetMainColor(col); }
42
43   virtual void Paint(Option_t* option="");
44
45   virtual void TakeAction(TSelectorDraw*);
46
47   ClassDef(PointSet, 1);
48 }; // endclass GuiPointSet
49
50 /**************************************************************************/
51
52 class PointSetArray : public TNamed, public TAttMarker,
53                       public RenderElementListBase,
54                       public TPointSelectorConsumer
55 {
56   friend class PointSetArrayEditor;
57
58 protected:
59   PointSet**   fBins;
60   Int_t        fDefPointSetCapacity;
61   Int_t        fNBins;
62   Double_t     fMin, fCurMin;
63   Double_t     fMax, fCurMax;
64   Double_t     fBinWidth;
65   TString      fQuantName;
66
67 public:
68   PointSetArray(const Text_t* name="PointSetArray", const Text_t* title="");
69   virtual ~PointSetArray();
70
71   virtual void Paint(Option_t* option="") { PaintElements(option); }
72
73   virtual void SetMarkerColor(Color_t tcolor=1);
74   virtual void SetMarkerStyle(Style_t mstyle=1);
75   virtual void SetMarkerSize(Size_t msize=1);
76
77   virtual void TakeAction(TSelectorDraw*);
78
79
80   void InitBins(TGListTreeItem* tree_item, const Text_t* quant_name,
81                 Int_t nbins, Double_t min, Double_t max);
82   void DeleteBins();
83   void Fill(Double_t x, Double_t y, Double_t z, Double_t quant);
84
85   void CloseBins();
86
87   Int_t GetDefPointSetCapacity() const  { return fDefPointSetCapacity; }
88   void  SetDefPointSetCapacity(Int_t c) { fDefPointSetCapacity = c; }
89
90   Int_t     GetNBins()        const { return fNBins; }
91   PointSet* GetBin(Int_t bin) const { return fBins[bin]; }
92
93   Double_t GetMin()    const { return fMin; }
94   Double_t GetCurMin() const { return fCurMin; }
95   Double_t GetMax()    const { return fMax; }
96   Double_t GetCurMax() const { return fCurMax; }
97
98   void SetRange(Double_t min, Double_t max);
99
100   ClassDef(PointSetArray, 1);
101 };
102
103 }
104
105 #endif