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