]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveDet/AliEveTPCSectorViz.h
Changes in configuration
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTPCSectorViz.h
CommitLineData
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 19class AliEveTPCData; class AliEveTPCSectorData;
092578a7 20
d810d0de 21class AliEveTPCSectorVizEditor;
22class AliEveTPCSector2D; class AliEveTPCSector2DEditor; class AliEveTPCSector2DGL;
23class 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 31class 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
d810d0de 44 AliEveTPCSectorViz(const AliEveTPCSectorViz&); // Not implemented
45 AliEveTPCSectorViz& operator=(const AliEveTPCSectorViz&); // Not implemented
265ecb21 46
092578a7 47protected:
a97abca8 48 AliEveTPCData *fTPCData; // Source of data.
49 Int_t fSectorID; // Id of the displayed sector.
092578a7 50
a97abca8 51 Int_t fMinTime; // Min time-bin to display.
52 Int_t fMaxTime; // Max time-bin to display.
53 Short_t fThreshold; // Threshold for display/
54 Int_t fMaxVal; // Maximum signal-value, all above is of the same color.
092578a7 55
a97abca8 56 Bool_t fRnrInn; // Render inner segment.
57 Bool_t fRnrOut1; // Render middle segment.
58 Bool_t fRnrOut2; // Render outer segment.
092578a7 59
a97abca8 60 Color_t fFrameColor; // Color of the frame, the main color.
61 Bool_t fRnrFrame; // Render frame.
a97abca8 62 Bool_t fAutoTrans; // Automatically calculate transformation based on sector id.
63 UInt_t fRTS; //! Rendering TimeStamp
092578a7 64
a97abca8 65 mutable UChar_t *fColorArray; // Color array caching signal to color mapping.
092578a7 66
fd31e9de 67 void SetupColor(Int_t val, UChar_t* pix) const;
bd73c30b 68 void ClearColorArray();
69 void SetupColorArray() const;
70 UChar_t* ColorFromArray(Int_t val) const;
71 void ColorFromArray(Int_t val, UChar_t* pix) const;
72
092578a7 73public:
d810d0de 74 AliEveTPCSectorViz(const Text_t* n="AliEveTPCSectorViz", const Text_t* t=0);
75 virtual ~AliEveTPCSectorViz();
092578a7 76
d810d0de 77 virtual void CopyVizParams(const AliEveTPCSectorViz& v);
45664536 78
a15e6d7d 79 virtual UInt_t IncRTS() { return ++fRTS; }
80 virtual Bool_t CanEditMainColor() const { return kTRUE; }
092578a7 81
d810d0de 82 void SetDataSource(AliEveTPCData* data);
092578a7 83 void SetSectorID(Int_t id);
84
a15e6d7d 85 AliEveTPCData* GetData() const { return fTPCData; }
092578a7 86 Int_t GetSectorID() const { return fSectorID; }
d810d0de 87 AliEveTPCSectorData* GetSectorData() const;
092578a7 88
a8600b56 89 Int_t GetMinTime() const { return fMinTime; }
90 Int_t GetMaxTime() const { return fMaxTime; }
092578a7 91 void SetMinTime(Int_t mt) { fMinTime = mt; IncRTS(); }
92 void SetMaxTime(Int_t mt) { fMaxTime = mt; IncRTS(); }
bd73c30b 93 void SetThreshold(Short_t t);
94 void SetMaxVal(Int_t mv);
092578a7 95
96 void SetRnrInn(Bool_t r) { fRnrInn = r; IncRTS(); }
97 void SetRnrOut1(Bool_t r) { fRnrOut1 = r; IncRTS(); }
98 void SetRnrOut2(Bool_t r) { fRnrOut2 = r; IncRTS(); }
99
100 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); }
101 virtual void SetRnrFrame(Bool_t rf) { fRnrFrame = rf; IncRTS(); }
fbb1b08d 102 void SetAutoTrans(Bool_t t);
103
a15e6d7d 104 void SetUseTrans(Bool_t t);
092578a7 105
a97abca8 106 ClassDef(AliEveTPCSectorViz, 1); // Base-class for visualization of data for one TPC sector.
a15e6d7d 107};
092578a7 108
a15e6d7d 109//------------------------------------------------------------------------------
bd73c30b 110
d810d0de 111inline UChar_t* AliEveTPCSectorViz::ColorFromArray(Int_t val) const
bd73c30b 112{
113 if(val < fThreshold) val = fThreshold;
114 if(val > fMaxVal) val = fMaxVal;
115 return fColorArray + 4 * (val - fThreshold);
116}
117
d810d0de 118inline void AliEveTPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
bd73c30b 119{
120 UChar_t* c = ColorFromArray(val);
121 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];
122}
123
092578a7 124#endif