ACF $AcfVersion:0$
CAnnulus.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#include <i2d/CPosition2d.h>
6#include <i2d/CCircle.h>
7#include <i2d/CRectangle.h>
8
9
10namespace i2d
11{
12
13
19class CAnnulus: public CPosition2d
20{
21public:
23
28
32 CAnnulus(const i2d::CVector2d& center, double innerRadius, double outerRadius);
33
39 bool IsAnnulusValid() const;
40
44 double GetInnerRadius() const;
45
49 void SetInnerRadius(double innerRadius);
50
54 double GetOuterRadius() const;
55
59 void SetOuterRadius(double outerRadius);
60
64 void SetInnerOuterRadius(double radius1, double radius2);
65
70
75
79 bool operator == (const CAnnulus & annulus) const;
80
84 bool operator != (const CAnnulus & annulus) const;
85
90 bool ConvertToPolygon(i2d::CPolygon& result, int segmentsCount = 0) const;
91
92 // reimplemented (i2d::IObject2d)
93 virtual CRectangle GetBoundingBox() const override;
94 virtual bool Transform(
95 const ITransformation2d& transformation,
97 double* errorFactorPtr = NULL) override;
98 virtual bool InvTransform(
99 const ITransformation2d& transformation,
101 double* errorFactorPtr = NULL) override;
102 virtual bool GetTransformed(
103 const ITransformation2d& transformation,
104 IObject2d& result,
106 double* errorFactorPtr = NULL) const override;
107 virtual bool GetInvTransformed(
108 const ITransformation2d& transformation,
109 IObject2d& result,
111 double* errorFactorPtr = NULL) const override;
112
113 // reimplemented (istd::IChangeable)
114 virtual int GetSupportedOperations() const override;
115 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
117
118 // reimplemented (iser::ISerializable)
119 virtual bool Serialize(iser::IArchive& archive) override;
120
121protected:
123};
124
125
126} // namespace i2d
127
128
129
130
Definition of graphical annulus object.
Definition CAnnulus.h:20
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
CAnnulus()
Construct an empty annulus object.
virtual int GetSupportedOperations() const override
Get set of flags for supported operations.
istd::CRange m_radiusRange
Definition CAnnulus.h:122
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
CAnnulus(const i2d::CVector2d &center, double innerRadius, double outerRadius)
Construct an annulus object by the given position, inner and outer radius.
void SetInnerRadius(double innerRadius)
Set the inner radius of the annulus.
virtual bool GetInvTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const override
Calulate inverse transformation of the object into second one.
i2d::CPosition2d BaseClass
Definition CAnnulus.h:22
bool ConvertToPolygon(i2d::CPolygon &result, int segmentsCount=0) const
Performs conversion of the annulus splitting it to segmentsCount segments to the polygon result.
virtual bool InvTransform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Do inverse transformation of this object.
CCircle GetInnerCircle() const
Set the inner circle of the annulus object.
virtual bool Transform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Transform this object using some transformation.
bool IsAnnulusValid() const
Check, if the annulus is valid.
bool operator==(const CAnnulus &annulus) const
Compare with another annulus.
virtual bool GetTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const override
Calulate transformation of the object into second one.
CCircle GetOuterCircle() const
Set the outer circle of the annulus object.
void SetOuterRadius(double outerRadius)
Set the outer radius of the annulus.
bool operator!=(const CAnnulus &annulus) const
Compare with another annulus.
virtual CRectangle GetBoundingBox() const override
Get bounding box of this shape.
double GetInnerRadius() const
Get the inner radius of the annulus.
double GetOuterRadius() const
Get the outer radius of the annulus.
void SetInnerOuterRadius(double radius1, double radius2)
Set the inner and outer radius of the annulus.
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
Definition of graphical circle object.
Definition CCircle.h:22
Definition of the data model for a polygon.
Definition CPolygon.h:20
Definition of graphical point object.
Definition CPosition2d.h:18
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 describing the 2D-objects.
Definition IObject2d.h:26
Common interface for all calibration objects.
@ EM_NONE
There are no preferences, should be automatically selected.
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Unique ownership smart pointer for interface types.
#define NULL
Definition istd.h:74
Contains the 2D objects.
Definition CAffine2d.h:11