]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveITSModuleStepper.h
LoadRecPointsFromESD arg to const
[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 <TGLOverlay.h>
15 #include <TEveGridStepper.h>
16 #include <TGLFontManager.h>
17
18 #include <vector>
19
20
21 class TEveRGBAPalette;
22 class AliEveITSDigitsInfo;
23 class AliEveDigitScaleInfo;
24
25 class TGLAxis;
26
27
28 class AliEveITSModuleStepper : public TEveElementList,
29                                public TGLOverlayElement
30 {
31 public:
32   typedef std::vector<UInt_t>           vpInt_t;
33   typedef std::vector<UInt_t>::iterator vpInt_i;
34
35   AliEveITSModuleStepper(AliEveITSDigitsInfo* di);
36   virtual ~AliEveITSModuleStepper();
37
38   TEveGridStepper* GetStepper()                   { return fStepper; }
39   void             SetStepper(TEveGridStepper* s) { fStepper = s; Apply(); }
40
41   // overlay
42   virtual  Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
43   virtual  Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
44   virtual  void   MouseLeave();
45
46  // menu callbacks
47   void     DisplayDet(Int_t det, Int_t layer = -1);
48   Int_t    GetCurrentPage() const;
49   Int_t    GetPages();
50   void     Start();
51   void     Next();
52   void     Previous();
53   void     End();
54   void     Apply();
55   void     Capacity();
56
57   virtual void    Render(TGLRnrCtx& rnrCtx);
58
59 protected:
60   AliEveITSDigitsInfo    *fDigitsInfo; // Source of data and geometry.
61   AliEveDigitScaleInfo   *fScaleInfo;  // Parameters for digit-scaling.
62   TEveGridStepper        *fStepper;    // Module placement.
63
64   vpInt_t                 fModuleIDs;  // Vector of module IDs to be displayed.
65   UInt_t                  fPosition;  // Position of top corner ITS module in vector fIDs.
66   Int_t                   fSubDet;    // Sub-det, 0~SPD, 1~SDD, 2~SSD.
67
68   mutable TGLFont         fModuleFont; // Pixmap font for module ids.
69   mutable TGLFont         fTextFont;   // Texture font for text tool bar.
70   mutable TGLFont         fSymbolFont; // Webdings font for pager and scale actions. 
71   TGLAxis*                fAxis;
72
73   Float_t                 fMenuHeight; // Height of a tool bar.
74   Int_t                   fTextSize;   // Size of texture for menu font.
75   Color_t                 fTextCol;    // Default text color in menu.
76   Color_t                 fActiveCol;  // Color of selected menu item.
77
78   Int_t                   fActiveID;   // Id of active menu item.
79
80   // ITS module ID navigation
81   Int_t  Nxy()            const { return fStepper->GetNx()*fStepper->GetNy(); }
82   void   AddToList(Int_t modID) { fModuleIDs.push_back(modID);}
83   void   ResetList()            { fModuleIDs.clear();}
84   void   SetFirst(Int_t first);
85
86
87 private:
88   AliEveITSModuleStepper(const AliEveITSModuleStepper&);            // Not implemented
89   AliEveITSModuleStepper& operator=(const AliEveITSModuleStepper&); // Not implemented
90
91   // GUI
92   void   RenderModuleIDs();
93   void   RenderText(const char* tex ,Int_t id, const TGLFont &font, Float_t step=-1);
94   void   RenderPalette(TEveRGBAPalette* p);
95   void   RenderMenu(Int_t currP, Int_t MaxP, Int_t scaleX, Int_t scaleZ);
96
97   ClassDef(AliEveITSModuleStepper, 0); // Display scaled ITS modules in a paged layout, also providing GL-overaly control GUI.
98 };
99
100 #endif