CMS 3D CMS Logo

CmsAnnotation.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_CmsAnnotation_h
2 #define Fireworks_Core_CmsAnnotation_h
3 
4 #include "TGLOverlay.h"
5 
6 class TGLViewer;
7 class FWConfiguration;
8 
9 class CmsAnnotation : public TGLOverlayElement {
10 private:
11  enum EDrag { kMove, kResize, kNone};
12 
13 public:
14  CmsAnnotation(TGLViewerBase *parent, Float_t posx, Float_t posy);
15  virtual ~CmsAnnotation();
16 
17  // ---------- member, functions -------------------------
18 
19  //configuration management interface
20  virtual void addTo(FWConfiguration&) const;
21  virtual void setFrom(const FWConfiguration&);
22 
23  virtual void Render(TGLRnrCtx& rnrCtx);
24 
25  virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
26  virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
27  Event_t* event);
28  virtual void MouseLeave();
29 
30  Float_t getSize() const { return fSize; }
31  void setSize(Float_t x) { fSize = x; }
32 
33  bool getVisible() const;
34  void setVisible(bool x);
35 
36  bool getAllowDestroy() const { return fAllowDestroy; }
37  void setAllowDestroy(bool x) { fAllowDestroy = x; }
38 
39 private:
40  CmsAnnotation(const CmsAnnotation&); // stop default
41  const CmsAnnotation& operator=(const CmsAnnotation&); // stop default
42 
43  Float_t fPosX; // x position [0, 1]
44  Float_t fPosY; // y position [0, 1]
45 
46  Int_t fMouseX, fMouseY;
48 
49  TGLViewer *fParent;
50 
51  Float_t fSize;
52  Float_t fSizeDrag;
53 
54  bool fActive;
56 };
57 
58 #endif
virtual void MouseLeave()
bool getVisible() const
virtual void setFrom(const FWConfiguration &)
void setSize(Float_t x)
Definition: CmsAnnotation.h:31
void setAllowDestroy(bool x)
Definition: CmsAnnotation.h:37
const CmsAnnotation & operator=(const CmsAnnotation &)
bool getAllowDestroy() const
Definition: CmsAnnotation.h:36
virtual void Render(TGLRnrCtx &rnrCtx)
TGLViewer * fParent
Definition: CmsAnnotation.h:49
Float_t getSize() const
Definition: CmsAnnotation.h:30
virtual void addTo(FWConfiguration &) const
CmsAnnotation(TGLViewerBase *parent, Float_t posx, Float_t posy)
EDrag fDrag
last mouse position
Definition: CmsAnnotation.h:47
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
virtual ~CmsAnnotation()
void setVisible(bool x)
Definition: event.py:1
Float_t fSizeDrag
relative size to viewport width
Definition: CmsAnnotation.h:52