CPinShape.h
Go to the documentation of this file.
1 #ifndef iview_CPinShape_included
2 #define iview_CPinShape_included
3 
4 
5 #include <i2d/CVector2d.h>
6 #include <i2d/CPosition2d.h>
7 
9 
10 
11 namespace iview
12 {
13 
14 
16 {
17 public:
19 
20  CPinShape();
21 
22  // reimplemented (iview::IInteractiveShape)
23  virtual TouchState IsTouched(istd::CIndex2d position) const;
24 
25  // reimplemented (imod::IObserver)
26  virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
27 
28  // reimplemented (iview::IVisualizable)
29  virtual void Draw(QPainter& drawContext) const;
30 
31  // reimplemented (iview::IMouseActionObserver)
32  virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
33  virtual bool OnMouseMove(istd::CIndex2d position);
34 
35 protected:
36  // reimplemented (iview::CShapeBase)
37  virtual i2d::CRect CalcBoundingBox() const;
38 
39  // reimplemented (iview::CInteractiveShapeBase)
40  virtual void BeginLogDrag(const i2d::CVector2d& reference);
41  virtual void SetLogDragPosition(const i2d::CVector2d& position);
42 
44 };
45 
46 
47 } // namespace iview
48 
49 
50 #endif // !iview_CPinShape_included
51 
52 
virtual bool OnMouseMove(istd::CIndex2d position)
It is called, when mouse is moved.
virtual void SetLogDragPosition(const i2d::CVector2d &position)
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
Simple rectangle with integer bounds.
Definition: CRect.h:21
Index implementation for addressing elements in 2D-space.
Definition: CIndex2d.h:20
virtual void Draw(QPainter &drawContext) const
Draw this shape using draw context.
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)
This call back function will be called, if an observable object is about to be attached.
CInteractiveShapeBase BaseClass
Definition: CPinShape.h:18
virtual void BeginLogDrag(const i2d::CVector2d &reference)
virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)
It is called, when mouse button is pushed down or up on this object.
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
TouchState
Enumeration for possible shape touch states.
Definition: ITouchable.h:24
i2d::CVector2d m_referencePosition
Definition: CPinShape.h:43
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30

© 2007-2017 Witold Gantzke and Kirill Lepskiy