ICF 3.0.5.47
Technical documentation of ICF Libraries
CPolygon.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#pragma once
7
8
9// Qt includes
10#include <QtGui/QPolygonF>
11
12// ICF includes
13#include <i2d/CPolypoint.h>
14
15
16namespace i2d
17{
18
19
23class CPolygon: public CPolypoint
24{
25public:
27
28 static QByteArray GetTypeName();
29
30 CPolygon(const QPolygonF& qpolygon = QPolygonF());
31
32 operator QPolygonF() const;
33
37 bool Contains(const i2d::CVector2d& point) const;
38
42 virtual double GetOutlineLength() const;
43
47 virtual void FlipByX();
51 virtual void FlipByY();
55 virtual void Rotate(double radians);
59 virtual void ReverseNodes();
60
64 double GetArea(bool oriented = false) const;
65
69 double GetPerimeter() const;
70
71 // reimplemented (istd::IChangeable)
72 bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
73 std::unique_ptr<istd::IChangeable> CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const override;
74
75 // reimplemented (iser::IObject)
76 QByteArray GetFactoryId() const override;
77};
78
79
80} // namespace i2d
81
82
Definition of the data model for a polygon.
Definition CPolygon.h:24
QByteArray GetFactoryId() const override
virtual void Rotate(double radians)
Rotate object around its center.
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 void FlipByY()
Flip object by Y-axis.
bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
CPolypoint BaseClass
Definition CPolygon.h:26
CPolygon(const QPolygonF &qpolygon=QPolygonF())
std::unique_ptr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
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:25
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.
Contains the 2D objects.
Definition CAffine2d.h:15

© Witold Gantzke and Kirill Lepskiy