]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
092578a7 | 9 | |
a15e6d7d | 10 | #ifndef AliEveTPCSectorViz_H |
11 | #define AliEveTPCSectorViz_H | |
092578a7 | 12 | |
84aff7a4 | 13 | #include <TEveElement.h> |
092578a7 | 14 | |
51346b82 | 15 | #include <TNamed.h> |
092578a7 | 16 | #include <TAtt3D.h> |
17 | #include <TAttBBox.h> | |
18 | ||
d810d0de | 19 | class AliEveTPCData; class AliEveTPCSectorData; |
092578a7 | 20 | |
d810d0de | 21 | class AliEveTPCSectorVizEditor; |
22 | class AliEveTPCSector2D; class AliEveTPCSector2DEditor; class AliEveTPCSector2DGL; | |
23 | class AliEveTPCSector3D; class AliEveTPCSector3DEditor; class AliEveTPCSector3DGL; | |
092578a7 | 24 | |
a15e6d7d | 25 | //------------------------------------------------------------------------------ |
26 | // AliEveTPCSectorViz | |
27 | // | |
28 | // Base-class for visualization of data for one TPC sector. | |
29 | // | |
30 | ||
d810d0de | 31 | class AliEveTPCSectorViz : public TEveElement, |
fd31e9de | 32 | public TNamed, |
33 | public TAtt3D, | |
34 | public TAttBBox | |
092578a7 | 35 | { |
d810d0de | 36 | friend class AliEveTPCSectorVizEditor; |
37 | friend class AliEveTPCSector2D; | |
38 | friend class AliEveTPCSector2DEditor; | |
39 | friend class AliEveTPCSector2DGL; | |
40 | friend class AliEveTPCSector3D; | |
41 | friend class AliEveTPCSector3DEditor; | |
42 | friend class AliEveTPCSector3DGL; | |
092578a7 | 43 | |
092578a7 | 44 | public: |
d810d0de | 45 | AliEveTPCSectorViz(const Text_t* n="AliEveTPCSectorViz", const Text_t* t=0); |
46 | virtual ~AliEveTPCSectorViz(); | |
092578a7 | 47 | |
5aec5309 | 48 | virtual void CopyVizParams(const TEveElement* el); |
45664536 | 49 | |
a15e6d7d | 50 | virtual UInt_t IncRTS() { return ++fRTS; } |
51 | virtual Bool_t CanEditMainColor() const { return kTRUE; } | |
092578a7 | 52 | |
d810d0de | 53 | void SetDataSource(AliEveTPCData* data); |
092578a7 | 54 | void SetSectorID(Int_t id); |
55 | ||
a15e6d7d | 56 | AliEveTPCData* GetData() const { return fTPCData; } |
092578a7 | 57 | Int_t GetSectorID() const { return fSectorID; } |
d810d0de | 58 | AliEveTPCSectorData* GetSectorData() const; |
092578a7 | 59 | |
a8600b56 | 60 | Int_t GetMinTime() const { return fMinTime; } |
61 | Int_t GetMaxTime() const { return fMaxTime; } | |
092578a7 | 62 | void SetMinTime(Int_t mt) { fMinTime = mt; IncRTS(); } |
63 | void SetMaxTime(Int_t mt) { fMaxTime = mt; IncRTS(); } | |
bd73c30b | 64 | void SetThreshold(Short_t t); |
65 | void SetMaxVal(Int_t mv); | |
092578a7 | 66 | |
67 | void SetRnrInn(Bool_t r) { fRnrInn = r; IncRTS(); } | |
68 | void SetRnrOut1(Bool_t r) { fRnrOut1 = r; IncRTS(); } | |
69 | void SetRnrOut2(Bool_t r) { fRnrOut2 = r; IncRTS(); } | |
70 | ||
71 | void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); } | |
72 | virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); } | |
fbb1b08d | 73 | void SetAutoTrans(Bool_t t); |
74 | ||
a15e6d7d | 75 | void SetUseTrans(Bool_t t); |
092578a7 | 76 | |
4b456ebb | 77 | protected: |
78 | AliEveTPCData *fTPCData; // Source of data. | |
79 | Int_t fSectorID; // Id of the displayed sector. | |
80 | ||
81 | Int_t fMinTime; // Min time-bin to display. | |
82 | Int_t fMaxTime; // Max time-bin to display. | |
83 | Short_t fThreshold; // Threshold for display/ | |
84 | Int_t fMaxVal; // Maximum signal-value, all above is of the same color. | |
85 | ||
86 | Bool_t fRnrInn; // Render inner segment. | |
87 | Bool_t fRnrOut1; // Render middle segment. | |
88 | Bool_t fRnrOut2; // Render outer segment. | |
89 | ||
90 | Color_t fFrameColor; // Color of the frame, the main color. | |
91 | Bool_t fRnrFrame; // Render frame. | |
92 | Bool_t fAutoTrans; // Automatically calculate transformation based on sector id. | |
93 | UInt_t fRTS; //! Rendering TimeStamp | |
94 | ||
95 | mutable UChar_t *fColorArray; // Color array caching signal to color mapping. | |
96 | ||
97 | void SetupColor(Int_t val, UChar_t* pix) const; | |
98 | void ClearColorArray(); | |
99 | void SetupColorArray() const; | |
100 | UChar_t* ColorFromArray(Int_t val) const; | |
101 | void ColorFromArray(Int_t val, UChar_t* pix) const; | |
102 | ||
103 | private: | |
104 | AliEveTPCSectorViz(const AliEveTPCSectorViz&); // Not implemented | |
105 | AliEveTPCSectorViz& operator=(const AliEveTPCSectorViz&); // Not implemented | |
106 | ||
107 | ClassDef(AliEveTPCSectorViz, 0); // Base-class for visualization of data for one TPC sector. | |
a15e6d7d | 108 | }; |
092578a7 | 109 | |
4b456ebb | 110 | |
111 | // --- Inlines --- | |
bd73c30b | 112 | |
d810d0de | 113 | inline UChar_t* AliEveTPCSectorViz::ColorFromArray(Int_t val) const |
bd73c30b | 114 | { |
115 | if(val < fThreshold) val = fThreshold; | |
116 | if(val > fMaxVal) val = fMaxVal; | |
117 | return fColorArray + 4 * (val - fThreshold); | |
118 | } | |
119 | ||
d810d0de | 120 | inline void AliEveTPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const |
bd73c30b | 121 | { |
122 | UChar_t* c = ColorFromArray(val); | |
123 | pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3]; | |
124 | } | |
125 | ||
092578a7 | 126 | #endif |