]>
Commit | Line | Data |
---|---|---|
82b3616d | 1 | // $Header$ |
2 | ||
3 | #ifndef ALIEVE_ITSModuleStepper_H | |
4 | #define ALIEVE_ITSModuleStepper_H | |
5 | ||
09edeb17 | 6 | #include <TNamed.h> |
32e219c2 | 7 | #include <TGLOverlay.h> |
09edeb17 | 8 | |
82b3616d | 9 | #include <Reve/RenderElement.h> |
10 | #include <Reve/GridStepper.h> | |
11 | ||
12 | #include <vector> | |
13 | ||
32e219c2 | 14 | class TGLText; |
15 | class TGLAxis; | |
16 | ||
82b3616d | 17 | namespace Alieve { |
18 | ||
19 | class ITSDigitsInfo; | |
03dfc4a7 | 20 | class DigitScaleInfo; |
82b3616d | 21 | |
32e219c2 | 22 | class ITSModuleStepper : public Reve::RenderElementList, |
23 | public TGLOverlayElement | |
82b3616d | 24 | { |
09edeb17 | 25 | friend class ITSModuleStepperGL; |
26 | ||
82b3616d | 27 | public: |
09edeb17 | 28 | typedef std::vector<UInt_t> vpInt_t; |
29 | typedef std::vector<UInt_t>::iterator vpInt_i; | |
d7e36bcf | 30 | |
82b3616d | 31 | private: |
32e219c2 | 32 | vpInt_t fIDs; |
33 | UInt_t fPosition; // position of top corner ITS module in vector fIDs | |
34 | ||
82b3616d | 35 | ITSModuleStepper(const ITSModuleStepper&); // Not implemented |
36 | ITSModuleStepper& operator=(const ITSModuleStepper&); // Not implemented | |
37 | ||
38 | protected: | |
39 | ITSDigitsInfo* fDigitsInfo; | |
03dfc4a7 | 40 | DigitScaleInfo* fScaleInfo; |
32e219c2 | 41 | Int_t fSubDet; |
03dfc4a7 | 42 | |
32e219c2 | 43 | Reve::GridStepper* fStepper; |
44 | TGLAxis* fAxis; | |
45 | TGLText* fText; | |
46 | Float_t fTextSize; | |
47 | Float_t fPagerGap; | |
48 | Bool_t fRnrFrame; | |
d7e36bcf | 49 | |
32e219c2 | 50 | // module configuration |
51 | Float_t fExpandCell; | |
52 | Color_t fModuleFrameCol; | |
82b3616d | 53 | |
32e219c2 | 54 | // palette configuratiom |
55 | Float_t fPaletteOffset; | |
56 | Float_t fPaletteLength; | |
64c42545 | 57 | |
32e219c2 | 58 | // symbol configuration |
59 | Int_t fWActive; | |
64c42545 | 60 | Float_t fWWidth; |
61 | Float_t fWHeight; | |
32e219c2 | 62 | Float_t fWOff; ///offset relative to widget size |
63 | Color_t fWCol; | |
64 | Int_t fWActiveCol; | |
65 | Color_t fFontCol; | |
66 | ||
67 | // wrappers | |
68 | Float_t TextLength(const char* txt); | |
69 | void RenderString(TString tex ,Int_t id = -1); | |
70 | void RenderFrame(Float_t dx, Float_t dy, Int_t id); | |
71 | void RenderSymbol(Float_t dx, Float_t dy, Int_t id); | |
72 | void RenderPalette(Float_t dx, Float_t x, Float_t y); | |
73 | void RenderMenu(); | |
74 | void RenderCellIDs(); | |
75 | ||
76 | // module ID navigation | |
77 | Int_t Nxy(){ return fStepper->Nx*fStepper->Ny; } | |
78 | void AddToList( Int_t modID ){ fIDs.push_back(modID);} | |
79 | void ResetList(){ fIDs.clear();} | |
80 | void SetFirst(Int_t first); | |
82b3616d | 81 | |
82 | public: | |
83 | ITSModuleStepper(ITSDigitsInfo* di); | |
84 | virtual ~ITSModuleStepper(); | |
85 | ||
32e219c2 | 86 | // external functions |
87 | void DisplayDet(Int_t det, Int_t layer = -1); | |
88 | void DisplayTheta(Float_t min, Float_t max); | |
89 | ||
90 | // overlay functions | |
91 | virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec); | |
92 | virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, | |
93 | Event_t* event); | |
94 | virtual void MouseLeave(); | |
95 | virtual void Render(TGLRnrCtx& rnrCtx); | |
96 | ||
97 | // stepper | |
98 | Reve::GridStepper* GetStepper(){return fStepper;} | |
99 | void SetStepper(Reve::GridStepper* s){ fStepper = s; Apply();} | |
100 | ||
101 | Int_t GetCurrentPage(); | |
102 | Int_t GetPages(); | |
103 | void Start(); | |
104 | void Next(); | |
105 | void Previous(); | |
106 | void End(); | |
107 | void Apply(); | |
108 | void Capacity(); | |
109 | ||
110 | ||
111 | // getters/setters | |
112 | Color_t GetWColor(){ return fWCol; }; | |
113 | void SetWColor(Color_t c){ fWCol = c; } | |
114 | TGLText* GetFont(){ return fText; } | |
115 | void SetGLText(TGLText* t) {fText = t;} | |
09edeb17 | 116 | |
82b3616d | 117 | ClassDef(ITSModuleStepper, 0); |
d7e36bcf | 118 | }; |
82b3616d | 119 | |
120 | } // Alieve namespace | |
121 | ||
122 | #endif |