ICF 3.1.1.10
Technical documentation of ICF Libraries
CRectangleShape.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iview_CRectangleShape_included
7#define iview_CRectangleShape_included
8
9
11
12
13namespace iview
14{
15
16
21{
22public:
24
26
27 // reimplemented (iview::CInteractiveShapeBase)
28 virtual void InvalidateBoundingBox();
29
30 // reimplemented (iview::ITouchable)
31 virtual TouchState IsTouched(istd::CIndex2d position) const;
32
33 // reimplemented (iview::IVisualizable)
34 virtual void Draw(QPainter& drawContext) const;
35
36 // reimplemented (imod::IObserver)
37 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
38
39 // reimplemented (iview::IMouseActionObserver)
40 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
41 virtual bool OnMouseMove(istd::CIndex2d position);
42
43protected:
44 virtual void CalcPoints(const i2d::CRectangle& rectangle) const;
45
46 // reimplemented (iview::CInteractiveShapeBase)
47 virtual void BeginLogDrag(const i2d::CVector2d& reference);
48 virtual void SetLogDragPosition(const i2d::CVector2d& position);
49
50 // reimplemented (iview::CInteractiveShapeBase)
51 virtual i2d::CRect CalcBoundingBox() const;
52
63
66
70 mutable bool m_arePointsValid;
71};
72
73
74} // namespace iview
75
76
77#endif //iview_CRectangleShape_included
78
79
Simple rectangle with integer bounds.
Definition CRect.h:26
Definition of rectangle area orthogonal to axis of coordination system.
Definition CRectangle.h:31
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:25
Set of change flags (its IDs).
Definition IChangeable.h:38
Base class of shape implementation with user interaction.
Interactive shape object for iview::CSearchArea.
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
virtual void SetLogDragPosition(const i2d::CVector2d &position)
virtual void Draw(QPainter &drawContext) const
Draw this shape using draw context.
virtual void BeginLogDrag(const i2d::CVector2d &reference)
virtual bool OnMouseMove(istd::CIndex2d position)
It is called, when mouse is moved.
virtual void InvalidateBoundingBox()
Invalidate bounding box.
i2d::CVector2d m_ctrlsLeft[4]
i2d::CVector2d m_referencePosition
virtual void CalcPoints(const i2d::CRectangle &rectangle) const
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
CInteractiveShapeBase BaseClass
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.
i2d::CVector2d m_ctrlsRight[4]
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.
i2d::CVector2d m_corners[4]
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:30
In this library is defined 2D view concept and standard visualisation objects.

© Witold Gantzke and Kirill Lepskiy