ACF $AcfVersion:0$
CArc.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// Acf includes
6#include <i2d/CCircle.h>
7
8
9namespace i2d
10{
11
12
17class CArc: public CCircle
18{
19public:
21
33 CArc(double startAngle, double endAngle, const double radius, const CVector2d& center);
34
39 double GetStartAngle() const;
44 void SetStartAngle(double angle);
45
50 double GetEndAngle() const;
55 void SetEndAngle(double angle);
56
62 bool operator==(const CArc& arc) const;
68 bool operator!=(const CArc& arc) const;
69
74 CVector2d GetPositionFromAlpha(double alpha) const;
75
76 // reimplemented (i2d::IObject2d)
77 virtual CRectangle GetBoundingBox() const override;
78 virtual bool Transform(
79 const ITransformation2d& transformation,
81 double* errorFactorPtr = NULL) override;
82 virtual bool InvTransform(
83 const ITransformation2d& transformation,
85 double* errorFactorPtr = NULL) override;
86 virtual bool GetTransformed(
87 const ITransformation2d& transformation,
88 IObject2d& result,
90 double* errorFactorPtr = NULL) const override;
91 virtual bool GetInvTransformed(
92 const ITransformation2d& transformation,
93 IObject2d& result,
95 double* errorFactorPtr = NULL) const override;
96
97 // reimplemented istd::IChangeable
98 virtual int GetSupportedOperations() const override;
99 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
101
102 // reimplemented (iser::ISerializable)
103 virtual bool Serialize(iser::IArchive& archive) override;
104
105protected:
108};
109
110
111// public inline methods
112
113inline double CArc::GetStartAngle() const
114{
115 return m_startAngle;
116}
117
118
119inline double CArc::GetEndAngle() const
120{
121 return m_endAngle;
122}
123
124
125} // namespace i2d
126
127
128
129
Represents a circular arc defined by a center point, radius, and start/end angles.
Definition CArc.h:18
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
CVector2d GetPositionFromAlpha(double alpha) const
Get position of point using normed 'alpha' value.
double m_startAngle
Definition CArc.h:106
CCircle BaseClass
Definition CArc.h:20
virtual int GetSupportedOperations() const override
Get set of flags for supported operations.
virtual bool Transform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Transform this object using some transformation.
void SetEndAngle(double angle)
Set the ending angle of the arc.
virtual bool InvTransform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Do inverse transformation of this object.
bool operator!=(const CArc &arc) const
Compare this arc with another arc for inequality.
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.
void SetStartAngle(double angle)
Set the starting angle of the arc.
double GetEndAngle() const
Get the ending angle of the arc.
Definition CArc.h:119
double GetStartAngle() const
Get the starting angle of the arc.
Definition CArc.h:113
double m_endAngle
Definition CArc.h:107
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
CArc()
Construct an empty arc object.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
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.
CArc(double startAngle, double endAngle, const double radius, const CVector2d &center)
Construct an arc with specified parameters.
virtual CRectangle GetBoundingBox() const override
Get bounding box of this shape.
bool operator==(const CArc &arc) const
Compare this arc with another arc for equality.
Definition of graphical circle object.
Definition CCircle.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 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