CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Fireworks/Core/interface/CmsAnnotation.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_CmsAnnotation_h
00002 #define Fireworks_Core_CmsAnnotation_h
00003 
00004 #include "TGLOverlay.h"
00005 
00006 class TGLViewer;
00007 class FWConfiguration;
00008 
00009 class CmsAnnotation : public TGLOverlayElement {
00010 private:
00011    enum EDrag { kMove, kResize, kNone};
00012 
00013 public:
00014    CmsAnnotation(TGLViewerBase *parent, Float_t posx, Float_t posy);
00015    virtual ~CmsAnnotation();
00016 
00017    // ---------- member, functions -------------------------
00018    
00019    //configuration management interface
00020    virtual void addTo(FWConfiguration&) const;
00021    virtual void setFrom(const FWConfiguration&);
00022    
00023    virtual void   Render(TGLRnrCtx& rnrCtx);
00024 
00025    virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
00026    virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
00027                          Event_t* event);
00028    virtual void   MouseLeave();
00029 
00030    Float_t getSize() const { return fSize; }
00031    void    setSize(Float_t x) { fSize = x; }
00032    
00033    bool    getVisible() const;
00034    void    setVisible(bool x);
00035    
00036    bool    getAllowDestroy() const { return fAllowDestroy; }
00037    void    setAllowDestroy(bool x) { fAllowDestroy = x; }
00038 
00039 private:
00040    CmsAnnotation(const CmsAnnotation&); // stop default
00041    const CmsAnnotation& operator=(const CmsAnnotation&); // stop default
00042    
00043    Float_t           fPosX;           // x position [0, 1]
00044    Float_t           fPosY;           // y position [0, 1]
00045 
00046    Int_t             fMouseX, fMouseY; 
00047    EDrag             fDrag;
00048 
00049    TGLViewer        *fParent;
00050    
00051    Float_t           fSize;   
00052    Float_t           fSizeDrag;
00053 
00054    bool              fActive;
00055    bool              fAllowDestroy;
00056 };
00057 
00058 #endif