]>
Commit | Line | Data |
---|---|---|
d810d0de | 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 * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
82b3616d | 9 | |
10 | #ifndef ALIEVE_ITSModuleStepper_H | |
11 | #define ALIEVE_ITSModuleStepper_H | |
12 | ||
09edeb17 | 13 | #include <TNamed.h> |
32e219c2 | 14 | #include <TGLOverlay.h> |
09edeb17 | 15 | |
84aff7a4 | 16 | #include <TEveElement.h> |
17 | #include <TEveGridStepper.h> | |
82b3616d | 18 | |
19 | #include <vector> | |
20 | ||
32e219c2 | 21 | class TGLText; |
22 | class TGLAxis; | |
23 | ||
82b3616d | 24 | |
d810d0de | 25 | class AliEveITSDigitsInfo; |
26 | class AliEveDigitScaleInfo; | |
82b3616d | 27 | |
d810d0de | 28 | class AliEveITSModuleStepper : public TEveElementList, |
32e219c2 | 29 | public TGLOverlayElement |
82b3616d | 30 | { |
09edeb17 | 31 | friend class ITSModuleStepperGL; |
32 | ||
82b3616d | 33 | public: |
09edeb17 | 34 | typedef std::vector<UInt_t> vpInt_t; |
35 | typedef std::vector<UInt_t>::iterator vpInt_i; | |
d7e36bcf | 36 | |
82b3616d | 37 | private: |
32e219c2 | 38 | vpInt_t fIDs; |
39 | UInt_t fPosition; // position of top corner ITS module in vector fIDs | |
40 | ||
d810d0de | 41 | AliEveITSModuleStepper(const AliEveITSModuleStepper&); // Not implemented |
42 | AliEveITSModuleStepper& operator=(const AliEveITSModuleStepper&); // Not implemented | |
82b3616d | 43 | |
44 | protected: | |
d810d0de | 45 | AliEveITSDigitsInfo* fDigitsInfo; |
46 | AliEveDigitScaleInfo* fScaleInfo; | |
32e219c2 | 47 | Int_t fSubDet; |
03dfc4a7 | 48 | |
84aff7a4 | 49 | TEveGridStepper* fStepper; |
32e219c2 | 50 | TGLAxis* fAxis; |
51 | TGLText* fText; | |
52 | Float_t fTextSize; | |
53 | Float_t fPagerGap; | |
54 | Bool_t fRnrFrame; | |
d7e36bcf | 55 | |
32e219c2 | 56 | // module configuration |
57 | Float_t fExpandCell; | |
58 | Color_t fModuleFrameCol; | |
82b3616d | 59 | |
32e219c2 | 60 | // palette configuratiom |
61 | Float_t fPaletteOffset; | |
51346b82 | 62 | Float_t fPaletteLength; |
64c42545 | 63 | |
51346b82 | 64 | // symbol configuration |
65 | Int_t fWActive; | |
64c42545 | 66 | Float_t fWWidth; |
67 | Float_t fWHeight; | |
32e219c2 | 68 | Float_t fWOff; ///offset relative to widget size |
51346b82 | 69 | Color_t fWCol; |
32e219c2 | 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 | |
84aff7a4 | 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();} | |
32e219c2 | 86 | void SetFirst(Int_t first); |
82b3616d | 87 | |
88 | public: | |
d810d0de | 89 | AliEveITSModuleStepper(AliEveITSDigitsInfo* di); |
90 | virtual ~AliEveITSModuleStepper(); | |
82b3616d | 91 | |
32e219c2 | 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 | |
84aff7a4 | 104 | TEveGridStepper* GetStepper() { return fStepper; } |
105 | void SetStepper(TEveGridStepper* s) { fStepper = s; Apply(); } | |
32e219c2 | 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 | ||
32e219c2 | 116 | // getters/setters |
84aff7a4 | 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; } | |
09edeb17 | 121 | |
d810d0de | 122 | ClassDef(AliEveITSModuleStepper, 0); |
d7e36bcf | 123 | }; |
82b3616d | 124 | |
82b3616d | 125 | #endif |