]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/TPCSectorViz.h
Fix effc++ warnings.
[u/mrichter/AliRoot.git] / EVE / Alieve / TPCSectorViz.h
1 // $Header$
2
3 #ifndef ALIEVE_TPCSectorViz_H
4 #define ALIEVE_TPCSectorViz_H
5
6 #include <Reve/RenderElement.h>
7
8 #include <TNamed.h> 
9 #include <TAtt3D.h>
10 #include <TAttBBox.h>
11
12
13 namespace Alieve {
14
15 class TPCData; class TPCSectorData;
16
17 class TPCSectorVizEditor;
18 class TPCSector2D;  class TPCSector2DEditor;  class TPCSector2DGL;
19 class TPCSector3D;  class TPCSector3DEditor;  class TPCSector3DGL;
20
21 class TPCSectorViz : public Reve::RenderElement,
22                      public TNamed,
23                      public TAtt3D,
24                      public TAttBBox
25 {
26   friend class TPCSectorVizEditor;
27   friend class TPCSector2D;
28   friend class TPCSector2DEditor;
29   friend class TPCSector2DGL;
30   friend class TPCSector3D;
31   friend class TPCSector3DEditor;
32   friend class TPCSector3DGL;
33
34   TPCSectorViz(const TPCSectorViz&);            // Not implemented
35   TPCSectorViz& operator=(const TPCSectorViz&); // Not implemented
36
37 protected:
38   TPCData*    fTPCData; 
39   Int_t       fSectorID;
40
41   Int_t       fMinTime;     
42   Int_t       fMaxTime;
43   Short_t     fThreshold;
44   Int_t       fMaxVal;
45
46   Bool_t      fRnrInn;
47   Bool_t      fRnrOut1;
48   Bool_t      fRnrOut2;
49
50   Color_t     fFrameColor;
51   Bool_t      fRnrFrame;
52   Bool_t      fTrans;
53   Double_t    fMatrix[16];
54   UInt_t      fRTS;       //! Rendering TimeStamp
55
56   void SetupColor(Int_t val, UChar_t* pix) const;
57
58   mutable UChar_t* fColorArray;
59   void ClearColorArray();
60   void SetupColorArray() const;
61   UChar_t* ColorFromArray(Int_t val) const;
62   void     ColorFromArray(Int_t val, UChar_t* pix) const;
63
64 public:
65   TPCSectorViz(const Text_t* n="TPCSectorViz", const Text_t* t=0);
66   virtual ~TPCSectorViz();
67
68   virtual void CopyVizParams(const TPCSectorViz& v);
69
70   virtual UInt_t IncRTS()           { return ++fRTS; }
71   virtual Bool_t CanEditMainColor() { return true; }
72
73   void SetDataSource(TPCData* data);
74   void SetSectorID(Int_t id);
75
76   TPCData*       GetData()     const { return fTPCData; }
77   Int_t          GetSectorID() const { return fSectorID; }
78   TPCSectorData* GetSectorData() const;
79
80   void SetMinTime(Int_t mt)    { fMinTime   = mt; IncRTS(); }
81   void SetMaxTime(Int_t mt)    { fMaxTime   = mt; IncRTS(); }
82   void SetThreshold(Short_t t);
83   void SetMaxVal(Int_t mv);
84
85   void SetRnrInn(Bool_t r)     { fRnrInn  = r; IncRTS(); }
86   void SetRnrOut1(Bool_t r)    { fRnrOut1 = r; IncRTS(); }
87   void SetRnrOut2(Bool_t r)    { fRnrOut2 = r; IncRTS(); }
88
89   void SetFrameColor(Color_t col)     { fFrameColor = col; IncRTS(); }
90   virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf;  IncRTS(); }
91   void SetTrans(Bool_t t);
92
93   ClassDef(TPCSectorViz, 1); // Base-class for TPC raw-data visualization
94 }; // endclass TPCSectorViz
95
96
97 inline UChar_t* TPCSectorViz::ColorFromArray(Int_t val) const
98 {
99   if(val < fThreshold) val = fThreshold;
100   if(val > fMaxVal)    val = fMaxVal;
101   return fColorArray + 4 * (val - fThreshold);
102 }
103
104 inline void TPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
105 {
106   UChar_t* c = ColorFromArray(val);
107   pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];
108 }
109
110 }
111
112 #endif