]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveTPCSectorViz.h
Temporary fix to avoid xrootd thrashing
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTPCSectorViz.h
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #ifndef ALIEVE_TPCSectorViz_H
11 #define ALIEVE_TPCSectorViz_H
12
13 #include <TEveElement.h>
14 #include <TEveTrans.h>
15
16 #include <TNamed.h>
17 #include <TAtt3D.h>
18 #include <TAttBBox.h>
19
20
21 class AliEveTPCData; class AliEveTPCSectorData;
22
23 class AliEveTPCSectorVizEditor;
24 class AliEveTPCSector2D;  class AliEveTPCSector2DEditor;  class AliEveTPCSector2DGL;
25 class AliEveTPCSector3D;  class AliEveTPCSector3DEditor;  class AliEveTPCSector3DGL;
26
27 class AliEveTPCSectorViz : public TEveElement,
28                      public TNamed,
29                      public TAtt3D,
30                      public TAttBBox
31 {
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;
39
40   AliEveTPCSectorViz(const AliEveTPCSectorViz&);            // Not implemented
41   AliEveTPCSectorViz& operator=(const AliEveTPCSectorViz&); // Not implemented
42
43 protected:
44   AliEveTPCData*    fTPCData;
45   Int_t       fSectorID;
46
47   Int_t       fMinTime;
48   Int_t       fMaxTime;
49   Short_t     fThreshold;
50   Int_t       fMaxVal;
51
52   Bool_t      fRnrInn;
53   Bool_t      fRnrOut1;
54   Bool_t      fRnrOut2;
55
56   Color_t      fFrameColor;
57   Bool_t       fRnrFrame;
58   TEveTrans fHMTrans;
59   Bool_t       fAutoTrans;
60   UInt_t       fRTS;       //! Rendering TimeStamp
61
62   void SetupColor(Int_t val, UChar_t* pix) const;
63
64   mutable UChar_t* fColorArray;
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
70 public:
71   AliEveTPCSectorViz(const Text_t* n="AliEveTPCSectorViz", const Text_t* t=0);
72   virtual ~AliEveTPCSectorViz();
73
74   virtual void CopyVizParams(const AliEveTPCSectorViz& v);
75
76   virtual UInt_t IncRTS()           { return ++fRTS; }
77   virtual Bool_t CanEditMainColor() { return kTRUE; }
78
79   void SetDataSource(AliEveTPCData* data);
80   void SetSectorID(Int_t id);
81
82   AliEveTPCData*       GetData()     const { return fTPCData; }
83   Int_t          GetSectorID() const { return fSectorID; }
84   AliEveTPCSectorData* GetSectorData() const;
85
86   Int_t GetMinTime() const { return fMinTime; }
87   Int_t GetMaxTime() const { return fMaxTime; }
88   void SetMinTime(Int_t mt)    { fMinTime   = mt; IncRTS(); }
89   void SetMaxTime(Int_t mt)    { fMaxTime   = mt; IncRTS(); }
90   void SetThreshold(Short_t t);
91   void SetMaxVal(Int_t mv);
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(); }
99   void SetAutoTrans(Bool_t t);
100
101   TEveTrans& RefHMTrans() { return fHMTrans; }
102   void SetUseTrans(Bool_t t) { fHMTrans.SetUseTrans(t); }
103
104   ClassDef(AliEveTPCSectorViz, 1); // Base-class for TPC raw-data visualization
105 }; // endclass AliEveTPCSectorViz
106
107
108 inline UChar_t* AliEveTPCSectorViz::ColorFromArray(Int_t val) const
109 {
110   if(val < fThreshold) val = fThreshold;
111   if(val > fMaxVal)    val = fMaxVal;
112   return fColorArray + 4 * (val - fThreshold);
113 }
114
115 inline void AliEveTPCSectorViz::ColorFromArray(Int_t val, UChar_t* pix) const
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
121 #endif