]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/AliEveITSModuleStepper.h
Temporary fix to avoid xrootd thrashing
[u/mrichter/AliRoot.git] / EVE / Alieve / AliEveITSModuleStepper.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_ITSModuleStepper_H
11 #define ALIEVE_ITSModuleStepper_H
12
13 #include <TNamed.h>
14 #include <TGLOverlay.h>
15
16 #include <TEveElement.h>
17 #include <TEveGridStepper.h>
18
19 #include <vector>
20
21 class TGLText;
22 class TGLAxis;
23
24
25 class AliEveITSDigitsInfo;
26 class AliEveDigitScaleInfo;
27
28 class AliEveITSModuleStepper : public TEveElementList,
29                          public TGLOverlayElement
30 {
31   friend class ITSModuleStepperGL;
32
33 public:
34   typedef std::vector<UInt_t>           vpInt_t;
35   typedef std::vector<UInt_t>::iterator vpInt_i;
36
37 private:
38   vpInt_t                 fIDs;
39   UInt_t                  fPosition;  // position of top corner ITS module in vector fIDs
40
41   AliEveITSModuleStepper(const AliEveITSModuleStepper&);            // Not implemented
42   AliEveITSModuleStepper& operator=(const AliEveITSModuleStepper&); // Not implemented
43
44 protected:
45   AliEveITSDigitsInfo*          fDigitsInfo;
46   AliEveDigitScaleInfo*         fScaleInfo;
47   Int_t                   fSubDet;
48
49   TEveGridStepper*      fStepper;
50   TGLAxis*                fAxis;
51   TGLText*                fText;
52   Float_t                 fTextSize;
53   Float_t                 fPagerGap;
54   Bool_t                  fRnrFrame;
55
56   // module configuration
57   Float_t                 fExpandCell;
58   Color_t                 fModuleFrameCol;
59
60   // palette configuratiom
61   Float_t                 fPaletteOffset;
62   Float_t                 fPaletteLength;
63
64   // symbol configuration
65   Int_t                   fWActive;
66   Float_t                 fWWidth;
67   Float_t                 fWHeight;
68   Float_t                 fWOff; ///offset relative to widget size
69   Color_t                 fWCol;
70   Int_t                   fWActiveCol;
71   Color_t                 fFontCol;
72
73   // wrappers
74   Float_t TextLength(const char* txt);
75   void    RenderString(TString tex ,Int_t id = -1);
76   void    RenderFrame(Float_t dx, Float_t dy, Int_t id);
77   void    RenderSymbol(Float_t dx, Float_t dy, Int_t id);
78   void    RenderPalette(Float_t dx, Float_t x, Float_t y);
79   void    RenderMenu();
80   void    RenderCellIDs();
81
82   // module ID navigation
83   Int_t  Nxy()            const { return fStepper->GetNx()*fStepper->GetNy(); }
84   void   AddToList(Int_t modID) { fIDs.push_back(modID);}
85   void   ResetList()            { fIDs.clear();}
86   void   SetFirst(Int_t first);
87
88 public:
89   AliEveITSModuleStepper(AliEveITSDigitsInfo* di);
90   virtual ~AliEveITSModuleStepper();
91
92   // external functions
93   void     DisplayDet(Int_t det, Int_t layer = -1);
94   void     DisplayTheta(Float_t min, Float_t max);
95
96   // overlay functions
97   virtual  Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
98   virtual  Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
99                         Event_t* event);
100   virtual void   MouseLeave();
101   virtual void   Render(TGLRnrCtx& rnrCtx);
102
103   // stepper
104   TEveGridStepper*  GetStepper()                   { return fStepper; }
105   void              SetStepper(TEveGridStepper* s) { fStepper = s; Apply(); }
106
107   Int_t    GetCurrentPage();
108   Int_t    GetPages();
109   void     Start();
110   void     Next();
111   void     Previous();
112   void     End();
113   void     Apply();
114   void     Capacity();
115
116   // getters/setters
117   Color_t  GetWColor()           { return fWCol; }
118   void     SetWColor(Color_t c)  { fWCol = c;    }
119   TGLText* GetFont()             { return fText; }
120   void     SetGLText(TGLText* t) { fText = t;    }
121
122   ClassDef(AliEveITSModuleStepper, 0);
123 };
124
125 #endif