Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:25:59

0001 // @(#)root/gl:$Id$
0002 // Author:  Matevz Tadel, Feb 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, 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_TGLManipSet
0013 #define ROOT_TGLManipSet
0014 
0015 #include "TGLOverlay.h"
0016 #include "TGLPShapeRef.h"
0017 
0018 class TGLManip;
0019 
0020 class TGLManipSet : public TGLOverlayElement,
0021                     public TGLPShapeRef
0022 {
0023 public:
0024    enum EManip { kTrans, kScale,
0025 // clang++ <v20 (-Wshadow) complains about shadowing GuiTypes.h global enum ECursor. Let's silence warning:
0026 #if defined(__clang__) && __clang_major__ < 20
0027 #pragma clang diagnostic push
0028 #pragma clang diagnostic ignored "-Wshadow"
0029 #endif
0030       kRotate,
0031 #if defined(__clang__) && __clang_major__ < 20
0032 #pragma clang diagnostic pop
0033 #endif
0034       kEndType };
0035 
0036 private:
0037    TGLManipSet(const TGLManipSet&) = delete;
0038    TGLManipSet& operator=(const TGLManipSet&) = delete;
0039 
0040 protected:
0041    TGLManip  *fManip[3]; ///<! manipulator store
0042    EManip     fType;     ///<! current manipulator
0043 
0044    Bool_t     fDrawBBox; ///<! also draw bounding-box around physical
0045 
0046 public:
0047    TGLManipSet();
0048    ~TGLManipSet() override;
0049 
0050    void SetPShape(TGLPhysicalShape* shape) override;
0051 
0052    Bool_t MouseEnter(TGLOvlSelectRecord& selRec) override;
0053    Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
0054                          Event_t* event) override;
0055    void   MouseLeave() override;
0056 
0057    void Render(TGLRnrCtx& rnrCtx) override;
0058 
0059    TGLManip* GetCurrentManip() const { return fManip[fType]; }
0060 
0061    Int_t  GetManipType()   const { return fType; }
0062    void   SetManipType(Int_t type);
0063    Bool_t GetDrawBBox()    const { return fDrawBBox; }
0064    void   SetDrawBBox(Bool_t bb) { fDrawBBox = bb; }
0065 
0066    ClassDefOverride(TGLManipSet, 0); // A collection of available manipulators.
0067 }; // endclass TGLManipSet
0068 
0069 
0070 #endif