2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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 **************************************************************************/
10 #ifndef AliEveITSModuleStepper_H
11 #define AliEveITSModuleStepper_H
13 #include <TEveElement.h>
14 #include <TGLOverlay.h>
15 #include <TEveGridStepper.h>
16 #include <TGLFontManager.h>
21 class TEveRGBAPalette;
22 class AliEveITSDigitsInfo;
23 class AliEveDigitScaleInfo;
28 class AliEveITSModuleStepper : public TEveElementList,
29 public TGLOverlayElement
32 typedef std::vector<UInt_t> vpInt_t;
33 typedef std::vector<UInt_t>::iterator vpInt_i;
35 AliEveITSModuleStepper(AliEveITSDigitsInfo* di);
36 virtual ~AliEveITSModuleStepper();
38 TEveGridStepper* GetStepper() { return fStepper; }
39 void SetStepper(TEveGridStepper* s) { fStepper = s; Apply(); }
42 virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
43 virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
44 virtual void MouseLeave();
47 void DisplayDet(Int_t det, Int_t layer = -1);
48 Int_t GetCurrentPage() const;
57 virtual void Render(TGLRnrCtx& rnrCtx);
60 AliEveITSDigitsInfo *fDigitsInfo; // Source of data and geometry.
61 AliEveDigitScaleInfo *fScaleInfo; // Parameters for digit-scaling.
62 TEveGridStepper *fStepper; // Module placement.
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.
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.
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.
78 Int_t fActiveID; // Id of active menu item.
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);
88 AliEveITSModuleStepper(const AliEveITSModuleStepper&); // Not implemented
89 AliEveITSModuleStepper& operator=(const AliEveITSModuleStepper&); // Not implemented
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);
97 ClassDef(AliEveITSModuleStepper, 0); // Display scaled ITS modules in a paged layout, also providing GL-overaly control GUI.