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 Int_t GetMinTime() const { return fMinTime; }
81 Int_t GetMaxTime() const { return fMaxTime; }
82 void SetMinTime(Int_t mt) { fMinTime = mt; IncRTS(); }
83 void SetMaxTime(Int_t mt) { fMaxTime = mt; IncRTS(); }
84 void SetThreshold(Short_t t);
85 void SetMaxVal(Int_t mv);
87 void SetRnrInn(Bool_t r) { fRnrInn = r; IncRTS(); }
88 void SetRnrOut1(Bool_t r) { fRnrOut1 = r; IncRTS(); }
89 void SetRnrOut2(Bool_t r) { fRnrOut2 = r; IncRTS(); }
91 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); }
92 virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); }
93 void SetTrans(Bool_t t);
95 ClassDef(TPCSectorViz, 1); // Base-class for TPC raw-data visualization
96 }; // endclass TPCSectorViz
99 inline UChar_t* TPCSectorViz::ColorFromArray(Int_t val) const
101 if(val < fThreshold) val = fThreshold;
102 if(val > fMaxVal) val = fMaxVal;
103 return fColorArray + 4 * (val - fThreshold);
106 inline void TPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
108 UChar_t* c = ColorFromArray(val);
109 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];