Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:40

0001 // @(#)root/eve:$Id$
0002 // Author: Alja Mrak-Tadel 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEveCaloLegoOverlay
0013 #define ROOT_TEveCaloLegoOverlay
0014 
0015 #include "TGLCameraOverlay.h"
0016 #include "TEveElement.h"
0017 
0018 class TEveCaloLego;
0019 
0020 class TEveCaloLegoOverlay : public TGLCameraOverlay
0021 {
0022 private:
0023    TEveCaloLegoOverlay(const TEveCaloLegoOverlay&);            // Not implemented
0024    TEveCaloLegoOverlay& operator=(const TEveCaloLegoOverlay&); // Not implemented
0025 
0026    Bool_t SetSliderVal(Event_t* event,TGLRnrCtx& rnrCtx );
0027 
0028 
0029 protected:
0030    void   RenderLogaritmicScales(TGLRnrCtx& rnrCtx);
0031    void   RenderPaletteScales(TGLRnrCtx& rnrCtx);
0032    void   RenderPlaneInterface(TGLRnrCtx& rnrCtx);
0033    void   RenderHeader(TGLRnrCtx& rnrCtx);
0034 
0035    TEveCaloLego*  fCalo; // model
0036 
0037    // 2D scales
0038    Bool_t         fShowScales;
0039    Color_t        fScaleColor;
0040    Char_t         fScaleTransparency; //transaprency in %
0041    Double_t       fScaleCoordX;
0042    Double_t       fScaleCoordY;
0043    Double_t       fScaleW;
0044    Double_t       fScaleH;
0045    Double_t       fCellX;
0046    Double_t       fCellY;
0047 
0048    Color_t        fFrameColor;
0049    Char_t         fFrameLineTransp;
0050    Char_t         fFrameBgTransp;
0051 
0052    // move of scales
0053    Int_t             fMouseX, fMouseY; //! last mouse position
0054    Bool_t            fInDrag;
0055 
0056    // text top right corner
0057    TString        fHeaderTxt;
0058    Bool_t         fHeaderSelected;
0059 
0060    // plane ojects
0061    TAxis         *fPlaneAxis;
0062    Color_t        fAxisPlaneColor;
0063    Bool_t         fShowPlane;
0064    // plane state
0065    Float_t        fMenuW;
0066    Float_t        fButtonW;
0067    Bool_t         fShowSlider;
0068    Float_t        fSliderH;    // slider height in % of viewport
0069    Float_t        fSliderPosY; // y position of slider bottom up
0070    Float_t        fSliderVal;
0071    // plane event-handling
0072    Int_t          fActiveID;
0073    Color_t        fActiveCol;
0074 
0075 
0076 public:
0077    TEveCaloLegoOverlay();
0078    ~TEveCaloLegoOverlay() override{}
0079 
0080    //rendering
0081     void   Render(TGLRnrCtx& rnrCtx) override;
0082 
0083    // event handling
0084     Bool_t MouseEnter(TGLOvlSelectRecord& selRec) override;
0085     Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event) override;
0086     void   MouseLeave() override;
0087 
0088 
0089    TEveCaloLego* GetCaloLego() {return fCalo;}
0090    void          SetCaloLego(TEveCaloLego* c) {fCalo = c;}
0091 
0092    void          SetShowPlane (Bool_t x) { fShowPlane = x; }
0093    Bool_t        GetShowPlane() const { return fShowPlane; }
0094 
0095    void          SetHeaderTxt(const char *txt) {fHeaderTxt = txt; }
0096    const char*   GetHeaderTxt() const { return fHeaderTxt; }
0097 
0098    void          SetShowScales(Bool_t x) { fShowScales = x;}
0099    void          SetScaleColorTransparency(Color_t colIdx, Char_t transp);
0100    void          SetScalePosition(Double_t x, Double_t y);
0101 
0102    void          SetFrameAttribs(Color_t frameCol, Char_t lineTransp, Char_t bgTransp);
0103 
0104    ClassDefOverride(TEveCaloLegoOverlay, 0); // GL-overaly control GUI for TEveCaloLego.
0105 };
0106 
0107 #endif