ACF $AcfVersion:0$
CRectangleShape.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
6
7
8namespace iview
9{
10
11
16{
17public:
19
21
22 // reimplemented (iview::CInteractiveShapeBase)
23 virtual void InvalidateBoundingBox() override;
24
25 // reimplemented (iview::ITouchable)
26 virtual TouchState IsTouched(istd::CIndex2d position) const override;
27
28 // reimplemented (iview::IVisualizable)
29 virtual void Draw(QPainter& drawContext) const override;
30
31 // reimplemented (imod::IObserver)
32 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask) override;
33
34 // reimplemented (iview::IMouseActionObserver)
35 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) override;
36 virtual bool OnMouseMove(istd::CIndex2d position) override;
37
38protected:
39 void CalcPoints(const i2d::CRectangle& rectangle) const;
40
41 // reimplemented (iview::CInteractiveShapeBase)
42 virtual void BeginLogDrag(const i2d::CVector2d& reference) override;
43 virtual void SetLogDragPosition(const i2d::CVector2d& position) override;
44
45 // reimplemented (iview::CInteractiveShapeBase)
46 virtual i2d::CRect CalcBoundingBox() const override;
47
58
61
65 mutable bool m_arePointsValid;
66};
67
68
69} // namespace iview
70
71
72
73
Simple rectangle with integer bounds.
Definition CRect.h:22
Definition of rectangle area orthogonal to axis of coordination system.
Definition CRectangle.h:27
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:25
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:21
Set of change flags (its IDs).
Definition IChangeable.h:36
Interactive shape object for iview::CSearchArea.
CInteractiveShapeBase BaseClass
virtual i2d::CRect CalcBoundingBox() const override
Calculate bounding box.
virtual TouchState IsTouched(istd::CIndex2d position) const override
Check, if any shape is touched.
virtual void SetLogDragPosition(const i2d::CVector2d &position) override
virtual void Draw(QPainter &drawContext) const override
Draw this shape using draw context.
void CalcPoints(const i2d::CRectangle &rectangle) const
i2d::CVector2d m_ctrlsLeft[4]
i2d::CVector2d m_referencePosition
virtual void InvalidateBoundingBox() override
Invalidate bounding box.
virtual void BeginLogDrag(const i2d::CVector2d &reference) override
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
Callback invoked when an observable model is about to be attached to this observer.
virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) override
It is called, when mouse button is pushed down or up on this object.
i2d::CVector2d m_ctrlsRight[4]
virtual bool OnMouseMove(istd::CIndex2d position) override
It is called, when mouse is moved.
i2d::CVector2d m_corners[4]
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:25
In this library is defined 2D view concept and standard visualisation objects.