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