Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveCaloLegoOverlay.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Alja Mrak-Tadel 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveCaloLegoOverlay
13 #define ROOT_TEveCaloLegoOverlay
14 
15 #include "TGLCameraOverlay.h"
16 #include "TEveElement.h"
17 
18 class TEveCaloLego;
19 
20 class TEveCaloLegoOverlay : public TGLCameraOverlay
21 {
22 private:
23  TEveCaloLegoOverlay(const TEveCaloLegoOverlay&); // Not implemented
24  TEveCaloLegoOverlay& operator=(const TEveCaloLegoOverlay&); // Not implemented
25 
26  Bool_t SetSliderVal(Event_t* event,TGLRnrCtx& rnrCtx );
27 
28 
29 protected:
30  void RenderLogaritmicScales(TGLRnrCtx& rnrCtx);
31  void RenderPaletteScales(TGLRnrCtx& rnrCtx);
32  void RenderPlaneInterface(TGLRnrCtx& rnrCtx);
33  void RenderHeader(TGLRnrCtx& rnrCtx);
34 
35  TEveCaloLego* fCalo; // model
36 
37  // 2D scales
38  Bool_t fShowScales;
39  Color_t fScaleColor;
40  Char_t fScaleTransparency; //transaprency in %
41  Double_t fScaleCoordX;
42  Double_t fScaleCoordY;
43  Double_t fScaleW;
44  Double_t fScaleH;
45  Double_t fCellX;
46  Double_t fCellY;
47 
48  Color_t fFrameColor;
49  Char_t fFrameLineTransp;
50  Char_t fFrameBgTransp;
51 
52  // move of scales
53  Int_t fMouseX, fMouseY; //! last mouse position
54  Bool_t fInDrag;
55 
56  // text top right corner
57  TString fHeaderTxt;
58  Bool_t fHeaderSelected;
59 
60  // plane ojects
61  TAxis *fPlaneAxis;
62  Color_t fAxisPlaneColor;
63  Bool_t fShowPlane;
64  // plane state
65  Float_t fMenuW;
66  Float_t fButtonW;
67  Bool_t fShowSlider;
68  Float_t fSliderH; // slider height in % of viewport
69  Float_t fSliderPosY; // y position of slider bottom up
70  Float_t fSliderVal;
71  // plane event-handling
72  Int_t fActiveID;
73  Color_t fActiveCol;
74 
75 
76 public:
77  TEveCaloLegoOverlay();
78  virtual ~TEveCaloLegoOverlay(){}
79 
80  //rendering
81  virtual void Render(TGLRnrCtx& rnrCtx);
82 
83  // event handling
84  virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
85  virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event);
86  virtual void MouseLeave();
87 
88 
89  TEveCaloLego* GetCaloLego() {return fCalo;}
90  void SetCaloLego(TEveCaloLego* c) {fCalo = c;}
91 
92  void SetShowPlane (Bool_t x) { fShowPlane = x; }
93  Bool_t GetShowPlane() const { return fShowPlane; }
94 
95  void SetHeaderTxt(const char *txt) {fHeaderTxt = txt; }
96  const char* GetHeaderTxt() const { return fHeaderTxt; }
97 
98  void SetShowScales(Bool_t x) { fShowScales = x;}
99  void SetScaleColorTransparency(Color_t colIdx, Char_t transp);
100  void SetScalePosition(Double_t x, Double_t y);
101 
102  void SetFrameAttribs(Color_t frameCol, Char_t lineTransp, Char_t bgTransp);
103 
104  ClassDef(TEveCaloLegoOverlay, 0); // GL-overaly control GUI for TEveCaloLego.
105 };
106 
107 #endif