]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/PointSet.h
Adapt to new QuadSet implementation.
[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 RenderElement,
19                  public TPointSet3D,
20                  public TPointSelectorConsumer
21 {
22   friend class PointSetArray;
23
24 protected:
25   TString fTitle;
26
27 public:
28   PointSet(Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ);
29   PointSet(const Text_t* name, Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ);
30   PointSet(const Text_t* name, TTree* tree, TreeVarType_e tv_type=TVT_XYZ);
31
32   void  Reset(Int_t n_points=0);
33   Int_t GrowFor(Int_t n_points);
34
35   virtual const Text_t* GetTitle() const          { return fTitle; }
36   virtual void          SetTitle(const Text_t* t) { fTitle = t; }
37
38   virtual void SetMarkerColor(Color_t col)
39   { SetMainColor(col); }
40
41   virtual void Paint(Option_t* option="");
42
43   virtual void TakeAction(TSelectorDraw*);
44
45   ClassDef(PointSet, 1);
46 }; // endclass GuiPointSet
47
48 /**************************************************************************/
49
50 class PointSetArray : public RenderElementListBase,
51                       public TNamed,
52                       public TAttMarker,
53                       public TPointSelectorConsumer
54 {
55   friend class PointSetArrayEditor;
56
57   PointSetArray(const PointSetArray&);            // Not implemented
58   PointSetArray& operator=(const PointSetArray&); // Not implemented
59
60 protected:
61   PointSet**   fBins;
62   Int_t        fDefPointSetCapacity;
63   Int_t        fNBins;
64   Double_t     fMin, fCurMin;
65   Double_t     fMax, fCurMax;
66   Double_t     fBinWidth;
67   TString      fQuantName;
68
69 public:
70   PointSetArray(const Text_t* name="PointSetArray", const Text_t* title="");
71   virtual ~PointSetArray();
72
73   virtual void RemoveElementLocal(RenderElement* el);
74   virtual void RemoveElements();
75
76   virtual void Paint(Option_t* option="") { PaintElements(option); }
77
78   virtual void SetMarkerColor(Color_t tcolor=1);
79   virtual void SetMarkerStyle(Style_t mstyle=1);
80   virtual void SetMarkerSize(Size_t msize=1);
81
82   virtual void TakeAction(TSelectorDraw*);
83
84
85   void InitBins(const Text_t* quant_name, Int_t nbins, Double_t min, Double_t max,
86                 Bool_t addRe=kTRUE);
87   void Fill(Double_t x, Double_t y, Double_t z, Double_t quant);
88
89   void CloseBins();
90
91   Int_t GetDefPointSetCapacity() const  { return fDefPointSetCapacity; }
92   void  SetDefPointSetCapacity(Int_t c) { fDefPointSetCapacity = c; }
93
94   Int_t     GetNBins()        const { return fNBins; }
95   PointSet* GetBin(Int_t bin) const { return fBins[bin]; }
96
97   Double_t GetMin()    const { return fMin; }
98   Double_t GetCurMin() const { return fCurMin; }
99   Double_t GetMax()    const { return fMax; }
100   Double_t GetCurMax() const { return fCurMax; }
101
102   void SetRange(Double_t min, Double_t max);
103
104   ClassDef(PointSetArray, 1);
105 };
106
107 }
108
109 #endif