CRectangleShape.h
Go to the documentation of this file.
1 #ifndef iview_CRectangleShape_included
2 #define iview_CRectangleShape_included
3 
4 
6 
7 
8 namespace iview
9 {
10 
11 
16 {
17 public:
19 
21 
22  // reimplemented (iview::CInteractiveShapeBase)
23  virtual void InvalidateBoundingBox();
24 
25  // reimplemented (iview::ITouchable)
26  virtual TouchState IsTouched(istd::CIndex2d position) const;
27 
28  // reimplemented (iview::IVisualizable)
29  virtual void Draw(QPainter& drawContext) const;
30 
31  // reimplemented (imod::IObserver)
32  virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
33 
34  // reimplemented (iview::IMouseActionObserver)
35  virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
36  virtual bool OnMouseMove(istd::CIndex2d position);
37 
38 protected:
39  void CalcPoints(const i2d::CRectangle& rectangle) const;
40 
41  // reimplemented (iview::CInteractiveShapeBase)
42  virtual void BeginLogDrag(const i2d::CVector2d& reference);
43  virtual void SetLogDragPosition(const i2d::CVector2d& position);
44 
45  // reimplemented (iview::CInteractiveShapeBase)
46  virtual i2d::CRect CalcBoundingBox() const;
47 
48  enum EditNode
49  {
50  EN_NONE = -1,
57  };
58 
61 
65  mutable bool m_arePointsValid;
66 };
67 
68 
69 } // namespace iview
70 
71 
72 #endif //iview_CRectangleShape_included
73 
74 
virtual void SetLogDragPosition(const i2d::CVector2d &position)
virtual bool OnMouseMove(istd::CIndex2d position)
It is called, when mouse is moved.
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.
CInteractiveShapeBase BaseClass
Simple rectangle with integer bounds.
Definition: CRect.h:21
Index implementation for addressing elements in 2D-space.
Definition: CIndex2d.h:20
void CalcPoints(const i2d::CRectangle &rectangle) const
i2d::CVector2d m_corners[4]
i2d::CVector2d m_ctrlsLeft[4]
virtual void Draw(QPainter &drawContext) const
Draw this shape using draw context.
Definition of rectangle area orthogonal to axis of coordination system.
Definition: CRectangle.h:26
Interactive shape object for iview::CSearchArea.
virtual void InvalidateBoundingBox()
Invalidate bounding box.
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
i2d::CVector2d m_ctrlsRight[4]
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
i2d::CVector2d m_referencePosition
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
TouchState
Enumeration for possible shape touch states.
Definition: ITouchable.h:24
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
virtual void BeginLogDrag(const i2d::CVector2d &reference)
Set of change flags (its IDs).
Definition: IChangeable.h:30
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.

© 2007-2017 Witold Gantzke and Kirill Lepskiy