ACF $AcfVersion:0$
CPolylineShape.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
5// Qt includes
6#include <QtGui/QPainter>
7
8// ACF includes
10
11
12namespace iview
13{
14
15
17{
18public:
21
23
24 bool IsOrientationVisible() const;
25 void SetOrientationVisible(bool state = true);
26
27 // reimplemented (iview::IMouseActionObserver)
28 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) override;
29
30 // reimplemented (imod::IObserver)
31 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask) override;
32
33 // reimplemented (iview::ITouchable)
34 virtual TouchState IsTouched(istd::CIndex2d position) const override;
35 virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const override;
36
37 // static methods
43 QPainter& drawContext,
44 const QPen& rightPen,
45 const QBrush& rightBrush,
46 const QPen& leftPen,
47 const QBrush& leftBrush,
48 const i2d::CLine2d& segmentLine,
49 double scale);
50
52 QPainter& drawContext,
53 const i2d::CVector2d& point,
54 const i2d::CVector2d& direction,
55 double maxWidth,
56 const iview::IColorSchema& colorSchema);
57protected:
58 // reimplemented (iview::CPolygonShape)
59 virtual void DrawCurve(QPainter& drawContext) const override;
60 virtual void DrawArea(QPainter& drawContext) const override;
61 virtual void DrawSelectionElements(QPainter& drawContext) const override;
62
63 // reimplemented (iview::CRectControlledShapeBase)
64 virtual bool IsCurveTouched(istd::CIndex2d position) const override;
65
66 // reimplemented (iview::CShapeBase)
67 virtual i2d::CRect CalcBoundingBox() const override;
68
69private:
70 bool m_isOrientationVisible;
71};
72
73
75{
76 return m_isOrientationVisible;
77}
78
79
81{
82 m_isOrientationVisible = state;
83}
84
85
86} // namespace iview
87
88
89
90
Definition of a line in 2D-space.
Definition CLine2d.h:25
Simple rectangle with integer bounds.
Definition CRect.h:22
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
static void DrawOrientationMarker(QPainter &drawContext, const QPen &rightPen, const QBrush &rightBrush, const QPen &leftPen, const QBrush &leftBrush, const i2d::CLine2d &segmentLine, double scale)
Draw an orientation marker consisting of two triangles (black for outside and white for inside)
virtual void DrawArea(QPainter &drawContext) const override
CInteractiveShapeBase ShapeBaseClass
CPolygonShape BaseClass
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.
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 void DrawCurve(QPainter &drawContext) const override
virtual bool IsCurveTouched(istd::CIndex2d position) const override
virtual TouchState IsTouched(istd::CIndex2d position) const override
Check, if any shape is touched.
void SetOrientationVisible(bool state=true)
virtual i2d::CRect CalcBoundingBox() const override
Calculate bounding box.
static void DrawOrientationMarker(QPainter &drawContext, const i2d::CVector2d &point, const i2d::CVector2d &direction, double maxWidth, const iview::IColorSchema &colorSchema)
bool IsOrientationVisible() const
virtual void DrawSelectionElements(QPainter &drawContext) const override
virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const override
Get description to shape at specified position.
Defines set of standard pens, brushes and simple management of unions.
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:25
In this library is defined 2D view concept and standard visualisation objects.