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;
34 TPCSectorViz(const TPCSectorViz&); // Not implemented
35 TPCSectorViz& operator=(const TPCSectorViz&); // Not implemented
54 UInt_t fRTS; //! Rendering TimeStamp
56 void SetupColor(Int_t val, UChar_t* pix) const;
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;
65 TPCSectorViz(const Text_t* n="TPCSectorViz", const Text_t* t=0);
66 virtual ~TPCSectorViz();
68 virtual void CopyVizParams(const TPCSectorViz& v);
70 virtual UInt_t IncRTS() { return ++fRTS; }
71 virtual Bool_t CanEditMainColor() { return true; }
73 void SetDataSource(TPCData* data);
74 void SetSectorID(Int_t id);
76 TPCData* GetData() const { return fTPCData; }
77 Int_t GetSectorID() const { return fSectorID; }
78 TPCSectorData* GetSectorData() const;
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);
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(); }
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);
93 ClassDef(TPCSectorViz, 1); // Base-class for TPC raw-data visualization
94 }; // endclass TPCSectorViz
97 inline UChar_t* TPCSectorViz::ColorFromArray(Int_t val) const
99 if(val < fThreshold) val = fThreshold;
100 if(val > fMaxVal) val = fMaxVal;
101 return fColorArray + 4 * (val - fThreshold);
104 inline void TPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
106 UChar_t* c = ColorFromArray(val);
107 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];