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 TGLViewerBase;
8 class FWConfiguration;
9 
10 class CmsAnnotation : public TGLOverlayElement {
11 private:
12  enum EDrag { kMove, kResize, kNone };
13 
14 public:
15  CmsAnnotation(TGLViewerBase* parent, Float_t posx, Float_t posy);
16  ~CmsAnnotation() override;
17 
18  // ---------- member, functions -------------------------
19 
20  //configuration management interface
21  virtual void addTo(FWConfiguration&) const;
22  virtual void setFrom(const FWConfiguration&);
23 
24  void Render(TGLRnrCtx& rnrCtx) override;
25 
26  Bool_t MouseEnter(TGLOvlSelectRecord& selRec) override;
27  Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Event_t* event) override;
28  void MouseLeave() override;
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&) = delete; // stop default
41  const CmsAnnotation& operator=(const CmsAnnotation&) = delete; // 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
CmsAnnotation::getAllowDestroy
bool getAllowDestroy() const
Definition: CmsAnnotation.h:36
CmsAnnotation::kNone
Definition: CmsAnnotation.h:12
CmsAnnotation::CmsAnnotation
CmsAnnotation(TGLViewerBase *parent, Float_t posx, Float_t posy)
Definition: CmsAnnotation.cc:16
CmsAnnotation::getSize
Float_t getSize() const
Definition: CmsAnnotation.h:30
CmsAnnotation::fMouseY
Int_t fMouseY
Definition: CmsAnnotation.h:46
CmsAnnotation::fPosX
Float_t fPosX
Definition: CmsAnnotation.h:43
CmsAnnotation::MouseEnter
Bool_t MouseEnter(TGLOvlSelectRecord &selRec) override
Definition: CmsAnnotation.cc:287
CmsAnnotation::fSize
Float_t fSize
Definition: CmsAnnotation.h:51
CmsAnnotation::fDrag
EDrag fDrag
last mouse position
Definition: CmsAnnotation.h:47
CmsAnnotation::EDrag
EDrag
Definition: CmsAnnotation.h:12
CmsAnnotation::~CmsAnnotation
~CmsAnnotation() override
Definition: CmsAnnotation.cc:35
CmsAnnotation::Handle
Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event) override
Definition: CmsAnnotation.cc:215
CmsAnnotation::fMouseX
Int_t fMouseX
Definition: CmsAnnotation.h:46
DDAxes::x
CmsAnnotation::operator=
const CmsAnnotation & operator=(const CmsAnnotation &)=delete
CmsAnnotation::fSizeDrag
Float_t fSizeDrag
relative size to viewport width
Definition: CmsAnnotation.h:52
CmsAnnotation::kMove
Definition: CmsAnnotation.h:12
CmsAnnotation::MouseLeave
void MouseLeave() override
Definition: CmsAnnotation.cc:295
CmsAnnotation::fParent
TGLViewer * fParent
Definition: CmsAnnotation.h:49
CmsAnnotation::setSize
void setSize(Float_t x)
Definition: CmsAnnotation.h:31
CmsAnnotation::fActive
bool fActive
Definition: CmsAnnotation.h:54
CmsAnnotation::setAllowDestroy
void setAllowDestroy(bool x)
Definition: CmsAnnotation.h:37
CmsAnnotation::addTo
virtual void addTo(FWConfiguration &) const
Definition: CmsAnnotation.cc:313
CmsAnnotation::Render
void Render(TGLRnrCtx &rnrCtx) override
Definition: CmsAnnotation.cc:41
CmsAnnotation::kResize
Definition: CmsAnnotation.h:12
CmsAnnotation::fAllowDestroy
bool fAllowDestroy
Definition: CmsAnnotation.h:55
CmsAnnotation
Definition: CmsAnnotation.h:10
CmsAnnotation::setVisible
void setVisible(bool x)
Definition: CmsAnnotation.cc:305
CmsAnnotation::setFrom
virtual void setFrom(const FWConfiguration &)
Definition: CmsAnnotation.cc:327
CmsAnnotation::fPosY
Float_t fPosY
Definition: CmsAnnotation.h:44
FWConfiguration
Definition: FWConfiguration.h:31
CmsAnnotation::getVisible
bool getVisible() const
Definition: CmsAnnotation.cc:302
event
Definition: event.py:1
class-composition.parent
parent
Definition: class-composition.py:98