3 #ifndef ALIEVE_TPCSectorViz_H
4 #define ALIEVE_TPCSectorViz_H
6 #include <Reve/RenderElement.h>
15 class TPCData; class TPCSectorData;
17 class TPCSectorVizEditor;
18 class TPCSector2D; class TPCSector2DEditor; class TPCSector2DGL;
19 class TPCSector3D; class TPCSector3DEditor; class TPCSector3DGL;
21 class TPCSectorViz : public Reve::RenderElement,
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;
51 UInt_t fRTS; //! Rendering TimeStamp
53 void SetupColor(Int_t val, UChar_t* pix) const;
55 mutable UChar_t* fColorArray;
56 void ClearColorArray();
57 void SetupColorArray() const;
58 UChar_t* ColorFromArray(Int_t val) const;
59 void ColorFromArray(Int_t val, UChar_t* pix) const;
62 TPCSectorViz(const Text_t* n="TPCSectorViz", const Text_t* t=0);
63 virtual ~TPCSectorViz();
65 virtual void CopyVizParams(const TPCSectorViz& v);
67 virtual UInt_t IncRTS() { return ++fRTS; }
68 virtual Bool_t CanEditMainColor() { return true; }
70 void SetDataSource(TPCData* data);
71 void SetSectorID(Int_t id);
73 TPCData* GetData() const { return fTPCData; }
74 Int_t GetSectorID() const { return fSectorID; }
75 TPCSectorData* GetSectorData() const;
77 void SetMinTime(Int_t mt) { fMinTime = mt; IncRTS(); }
78 void SetMaxTime(Int_t mt) { fMaxTime = mt; IncRTS(); }
79 void SetThreshold(Short_t t);
80 void SetMaxVal(Int_t mv);
82 void SetRnrInn(Bool_t r) { fRnrInn = r; IncRTS(); }
83 void SetRnrOut1(Bool_t r) { fRnrOut1 = r; IncRTS(); }
84 void SetRnrOut2(Bool_t r) { fRnrOut2 = r; IncRTS(); }
86 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); }
87 virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); }
88 void SetTrans(Bool_t t);
90 ClassDef(TPCSectorViz, 1); // Base-class for TPC raw-data visualization
91 }; // endclass TPCSectorViz
94 inline UChar_t* TPCSectorViz::ColorFromArray(Int_t val) const
96 if(val < fThreshold) val = fThreshold;
97 if(val > fMaxVal) val = fMaxVal;
98 return fColorArray + 4 * (val - fThreshold);
101 inline void TPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
103 UChar_t* c = ColorFromArray(val);
104 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];