00001 // @(#)root/eve:$Id: TEveCaloLegoOverlay.h 33864 2010-06-14 09:47:19Z matevz $ 00002 // Author: Alja Mrak-Tadel 2007 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TEveCaloLegoOverlay 00013 #define ROOT_TEveCaloLegoOverlay 00014 00015 #include "TGLCameraOverlay.h" 00016 #include "TEveElement.h" 00017 00018 class TEveCaloLego; 00019 00020 class TEveCaloLegoOverlay : public TGLCameraOverlay 00021 { 00022 private: 00023 TEveCaloLegoOverlay(const TEveCaloLegoOverlay&); // Not implemented 00024 TEveCaloLegoOverlay& operator=(const TEveCaloLegoOverlay&); // Not implemented 00025 00026 Bool_t SetSliderVal(Event_t* event,TGLRnrCtx& rnrCtx ); 00027 00028 00029 protected: 00030 void RenderLogaritmicScales(TGLRnrCtx& rnrCtx); 00031 void RenderPaletteScales(TGLRnrCtx& rnrCtx); 00032 void RenderPlaneInterface(TGLRnrCtx& rnrCtx); 00033 void RenderHeader(TGLRnrCtx& rnrCtx); 00034 00035 TEveCaloLego* fCalo; // model 00036 00037 // 2D scales 00038 Bool_t fShowScales; 00039 Color_t fScaleColor; 00040 Char_t fScaleTransparency; //transaprency in % 00041 Double_t fScaleCoordX; 00042 Double_t fScaleCoordY; 00043 Double_t fScaleW; 00044 Double_t fScaleH; 00045 Double_t fCellX; 00046 Double_t fCellY; 00047 00048 Color_t fFrameColor; 00049 Char_t fFrameLineTransp; 00050 Char_t fFrameBgTransp; 00051 00052 // move of scales 00053 Int_t fMouseX, fMouseY; //! last mouse position 00054 Bool_t fInDrag; 00055 00056 // text top right corner 00057 TString fHeaderTxt; 00058 Bool_t fHeaderSelected; 00059 00060 // plane ojects 00061 TAxis *fPlaneAxis; 00062 Color_t fAxisPlaneColor; 00063 Bool_t fShowPlane; 00064 // plane state 00065 Float_t fMenuW; 00066 Float_t fButtonW; 00067 Bool_t fShowSlider; 00068 Float_t fSliderH; // slider height in % of viewport 00069 Float_t fSliderPosY; // y position of slider bottom up 00070 Float_t fSliderVal; 00071 // plane event-handling 00072 Int_t fActiveID; 00073 Color_t fActiveCol; 00074 00075 00076 public: 00077 TEveCaloLegoOverlay(); 00078 virtual ~TEveCaloLegoOverlay(){} 00079 00080 //rendering 00081 virtual void Render(TGLRnrCtx& rnrCtx); 00082 00083 // event handling 00084 virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec); 00085 virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event); 00086 virtual void MouseLeave(); 00087 00088 00089 TEveCaloLego* GetCaloLego() {return fCalo;} 00090 void SetCaloLego(TEveCaloLego* c) {fCalo = c;} 00091 00092 void SetShowPlane (Bool_t x) { fShowPlane = x; } 00093 Bool_t GetShowPlane() const { return fShowPlane; } 00094 00095 void SetHeaderTxt(const char *txt) {fHeaderTxt = txt; } 00096 const char* GetHeaderTxt() const { return fHeaderTxt; } 00097 00098 void SetShowScales(Bool_t x) { fShowScales = x;} 00099 void SetScaleColorTransparency(Color_t colIdx, Char_t transp); 00100 void SetScalePosition(Double_t x, Double_t y); 00101 00102 void SetFrameAttribs(Color_t frameCol, Char_t lineTransp, Char_t bgTransp); 00103 00104 ClassDef(TEveCaloLegoOverlay, 0); // GL-overaly control GUI for TEveCaloLego. 00105 }; 00106 00107 #endif