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 TNamed, public TAtt3D, public TAttBBox,
22 public Reve::RenderElement
24 friend class TPCSectorVizEditor;
25 friend class TPCSector2D;
26 friend class TPCSector2DEditor;
27 friend class TPCSector2DGL;
28 friend class TPCSector3D;
29 friend class TPCSector3DEditor;
30 friend class TPCSector3DGL;
49 UInt_t fRTS; //! Rendering TimeStamp
51 void SetupColor(Int_t val, UChar_t* pix) const;
53 mutable UChar_t* fColorArray;
54 void ClearColorArray();
55 void SetupColorArray() const;
56 UChar_t* ColorFromArray(Int_t val) const;
57 void ColorFromArray(Int_t val, UChar_t* pix) const;
60 TPCSectorViz(const Text_t* n="TPCSectorViz", const Text_t* t=0);
61 virtual ~TPCSectorViz();
63 virtual void CopyVizParams(const TPCSectorViz& v);
65 virtual UInt_t IncRTS() { return ++fRTS; }
66 virtual Bool_t CanEditMainColor() { return true; }
68 void SetDataSource(TPCData* data);
69 void SetSectorID(Int_t id);
71 TPCData* GetData() const { return fTPCData; }
72 Int_t GetSectorID() const { return fSectorID; }
73 TPCSectorData* GetSectorData() const;
75 void SetMinTime(Int_t mt) { fMinTime = mt; IncRTS(); }
76 void SetMaxTime(Int_t mt) { fMaxTime = mt; IncRTS(); }
77 void SetThreshold(Short_t t);
78 void SetMaxVal(Int_t mv);
80 void SetRnrInn(Bool_t r) { fRnrInn = r; IncRTS(); }
81 void SetRnrOut1(Bool_t r) { fRnrOut1 = r; IncRTS(); }
82 void SetRnrOut2(Bool_t r) { fRnrOut2 = r; IncRTS(); }
84 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); }
85 virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); }
86 void SetTrans(Bool_t t);
88 ClassDef(TPCSectorViz, 1); // Base-class for TPC raw-data visualization
89 }; // endclass TPCSectorViz
92 inline UChar_t* TPCSectorViz::ColorFromArray(Int_t val) const
94 if(val < fThreshold) val = fThreshold;
95 if(val > fMaxVal) val = fMaxVal;
96 return fColorArray + 4 * (val - fThreshold);
99 inline void TPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
101 UChar_t* c = ColorFromArray(val);
102 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];