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