]>
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 | |
a15e6d7d | 10 | #ifndef AliEveITSModuleStepper_H |
11 | #define AliEveITSModuleStepper_H | |
09edeb17 | 12 | |
84aff7a4 | 13 | #include <TEveElement.h> |
14 | #include <TEveGridStepper.h> | |
82b3616d | 15 | |
a15e6d7d | 16 | #include <TGLOverlay.h> |
17 | ||
82b3616d | 18 | #include <vector> |
19 | ||
32e219c2 | 20 | class TGLText; |
21 | class TGLAxis; | |
22 | ||
d810d0de | 23 | class AliEveITSDigitsInfo; |
24 | class AliEveDigitScaleInfo; | |
82b3616d | 25 | |
d810d0de | 26 | class AliEveITSModuleStepper : public TEveElementList, |
c76ea574 | 27 | public TGLOverlayElement |
82b3616d | 28 | { |
09edeb17 | 29 | friend class ITSModuleStepperGL; |
30 | ||
82b3616d | 31 | public: |
4b456ebb | 32 | |
09edeb17 | 33 | typedef std::vector<UInt_t> vpInt_t; |
34 | typedef std::vector<UInt_t>::iterator vpInt_i; | |
d7e36bcf | 35 | |
32e219c2 | 36 | |
4b456ebb | 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 | ||
82b3616d | 70 | |
71 | protected: | |
4b456ebb | 72 | |
698e2c9b | 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. | |
03dfc4a7 | 76 | |
698e2c9b | 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; // | |
d7e36bcf | 83 | |
32e219c2 | 84 | // module configuration |
698e2c9b | 85 | Float_t fExpandCell; // |
86 | Color_t fModuleFrameCol; // | |
82b3616d | 87 | |
32e219c2 | 88 | // palette configuratiom |
698e2c9b | 89 | Float_t fPaletteOffset; // |
90 | Float_t fPaletteLength; // | |
64c42545 | 91 | |
51346b82 | 92 | // symbol configuration |
698e2c9b | 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; // | |
a15e6d7d | 98 | Color_t fWActiveCol; // |
698e2c9b | 99 | Color_t fFontCol; // |
32e219c2 | 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 | |
84aff7a4 | 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();} | |
32e219c2 | 114 | void SetFirst(Int_t first); |
82b3616d | 115 | |
4b456ebb | 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. | |
32e219c2 | 119 | |
4b456ebb | 120 | AliEveITSModuleStepper(const AliEveITSModuleStepper&); // Not implemented |
121 | AliEveITSModuleStepper& operator=(const AliEveITSModuleStepper&); // Not implemented | |
09edeb17 | 122 | |
698e2c9b | 123 | ClassDef(AliEveITSModuleStepper, 0); // Display scaled ITS modules in a paged layout, also providing GL-overaly control GUI. |
d7e36bcf | 124 | }; |
82b3616d | 125 | |
82b3616d | 126 | #endif |