ACF $AcfVersion:0$
CPolygon.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/QPolygonF>
7
8// ACF includes
9#include <i2d/CPolypoint.h>
10
11
12namespace i2d
13{
14
15
19class CPolygon: public CPolypoint
20{
21public:
23
24 static QByteArray GetTypeName();
25
26 CPolygon(const QPolygonF& qpolygon = QPolygonF());
27
28 operator QPolygonF() const;
29
33 bool Contains(const i2d::CVector2d& point) const;
34
38 virtual double GetOutlineLength() const;
39
43 virtual void FlipByX();
47 virtual void FlipByY();
51 virtual void Rotate(double radians);
55 virtual void ReverseNodes();
56
60 double GetArea(bool oriented = false) const;
61
65 double GetPerimeter() const;
66
67 // reimplemented (istd::IChangeable)
68 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
70
71 // reimplemented (iser::IObject)
72 virtual QByteArray GetFactoryId() const override;
73};
74
75
76} // namespace i2d
77
78
79
80
Definition of the data model for a polygon.
Definition CPolygon.h:20
virtual QByteArray GetFactoryId() const override
virtual void Rotate(double radians)
Rotate object around its center.
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
virtual void ReverseNodes()
Reverses nodes order.
bool Contains(const i2d::CVector2d &point) const
Check if the polygon contains a given point.
virtual double GetOutlineLength() const
Get outline length of this polygon.
double GetPerimeter() const
Get perimeter of the polygon.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
virtual void FlipByY()
Flip object by Y-axis.
CPolypoint BaseClass
Definition CPolygon.h:22
CPolygon(const QPolygonF &qpolygon=QPolygonF())
static QByteArray GetTypeName()
virtual void FlipByX()
Flip object by X-axis.
double GetArea(bool oriented=false) const
Get area of the polygon.
Definition of the data model for a polygon.
Definition CPolypoint.h:21
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Unique ownership smart pointer for interface types.
Contains the 2D objects.
Definition CAffine2d.h:11