3 #ifndef ALIEVE_TPCSectorViz_H
4 #define ALIEVE_TPCSectorViz_H
6 #include <Reve/RenderElement.h>
7 #include <Reve/ZTrans.h>
16 class TPCData; class TPCSectorData;
18 class TPCSectorVizEditor;
19 class TPCSector2D; class TPCSector2DEditor; class TPCSector2DGL;
20 class TPCSector3D; class TPCSector3DEditor; class TPCSector3DGL;
22 class TPCSectorViz : public Reve::RenderElement,
27 friend class TPCSectorVizEditor;
28 friend class TPCSector2D;
29 friend class TPCSector2DEditor;
30 friend class TPCSector2DGL;
31 friend class TPCSector3D;
32 friend class TPCSector3DEditor;
33 friend class TPCSector3DGL;
35 TPCSectorViz(const TPCSectorViz&); // Not implemented
36 TPCSectorViz& operator=(const TPCSectorViz&); // Not implemented
53 Reve::ZTrans fHMTrans;
55 UInt_t fRTS; //! Rendering TimeStamp
57 void SetupColor(Int_t val, UChar_t* pix) const;
59 mutable UChar_t* fColorArray;
60 void ClearColorArray();
61 void SetupColorArray() const;
62 UChar_t* ColorFromArray(Int_t val) const;
63 void ColorFromArray(Int_t val, UChar_t* pix) const;
66 TPCSectorViz(const Text_t* n="TPCSectorViz", const Text_t* t=0);
67 virtual ~TPCSectorViz();
69 virtual void CopyVizParams(const TPCSectorViz& v);
71 virtual UInt_t IncRTS() { return ++fRTS; }
72 virtual Bool_t CanEditMainColor() { return kTRUE; }
74 void SetDataSource(TPCData* data);
75 void SetSectorID(Int_t id);
77 TPCData* GetData() const { return fTPCData; }
78 Int_t GetSectorID() const { return fSectorID; }
79 TPCSectorData* GetSectorData() const;
81 Int_t GetMinTime() const { return fMinTime; }
82 Int_t GetMaxTime() const { return fMaxTime; }
83 void SetMinTime(Int_t mt) { fMinTime = mt; IncRTS(); }
84 void SetMaxTime(Int_t mt) { fMaxTime = mt; IncRTS(); }
85 void SetThreshold(Short_t t);
86 void SetMaxVal(Int_t mv);
88 void SetRnrInn(Bool_t r) { fRnrInn = r; IncRTS(); }
89 void SetRnrOut1(Bool_t r) { fRnrOut1 = r; IncRTS(); }
90 void SetRnrOut2(Bool_t r) { fRnrOut2 = r; IncRTS(); }
92 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); }
93 virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); }
94 void SetAutoTrans(Bool_t t);
96 Reve::ZTrans& RefHMTrans() { return fHMTrans; }
97 void SetUseTrans(Bool_t t) { fHMTrans.SetUseTrans(t); }
99 ClassDef(TPCSectorViz, 1); // Base-class for TPC raw-data visualization
100 }; // endclass TPCSectorViz
103 inline UChar_t* TPCSectorViz::ColorFromArray(Int_t val) const
105 if(val < fThreshold) val = fThreshold;
106 if(val > fMaxVal) val = fMaxVal;
107 return fColorArray + 4 * (val - fThreshold);
110 inline void TPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
112 UChar_t* c = ColorFromArray(val);
113 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];