ACF $AcfVersion:0$
ITransformation2d.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
7
9
10#include <i2d/CVector2d.h>
11#include <i2d/CMatrix2d.h>
12
13
14namespace i2d
15{
16
17
18class CAffine2d;
19
20
28 virtual public imath::TISurjectFunction<CVector2d, CVector2d>,
29 virtual public iser::ISerializable
30{
31public:
51
56 {
60 TF_FORWARD = 1 << 0,
64 TF_INVERTED = 1 << 1,
68 TF_INJECTIVE = 1 << 2,
72 TF_SURJECTIVE = 1 << 3,
88 TF_AFFINE = 1 << 7,
92 TF_CONTINUES = 1 << 8
93 };
94
98 virtual int GetTransformationFlags() const = 0;
99
108 virtual bool GetDistance(
109 const CVector2d& origPos1,
110 const CVector2d& origPos2,
111 double& result,
112 ExactnessMode mode = EM_NONE) const = 0;
113
121 virtual bool GetPositionAt(
122 const CVector2d& origPosition,
123 CVector2d& result,
124 ExactnessMode mode = EM_NONE) const = 0;
125
133 virtual bool GetInvPositionAt(
134 const CVector2d& transfPosition,
135 CVector2d& result,
136 ExactnessMode mode = EM_NONE) const = 0;
137
145 virtual bool GetLocalTransform(
146 const CVector2d& origPosition,
147 CAffine2d& result,
148 ExactnessMode mode = EM_NONE) const = 0;
149
158 const CVector2d& transfPosition,
159 CAffine2d& result,
160 ExactnessMode mode = EM_NONE) const = 0;
161};
162
163
164} // namespace i2d
165
166
167
168
This class defines an affine 2D-transformation.
Definition CAffine2d.h:18
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Common interface for all calibration objects.
virtual bool GetPositionAt(const CVector2d &origPosition, CVector2d &result, ExactnessMode mode=EM_NONE) const =0
Get position after transformation.
virtual int GetTransformationFlags() const =0
Get flags of describing type of this transformation.
@ EM_EXACT
Only precise calculation should be done.
@ EM_ANY
It is only important to output some result.
@ EM_NONE
There are no preferences, should be automatically selected.
@ EM_VISUAL
Only visual similarity of transformation is important.
virtual bool GetInvPositionAt(const CVector2d &transfPosition, CVector2d &result, ExactnessMode mode=EM_NONE) const =0
Get position after transformation.
virtual bool GetDistance(const CVector2d &origPos1, const CVector2d &origPos2, double &result, ExactnessMode mode=EM_NONE) const =0
Compute a shortness distance in transformed coordinations.
virtual bool GetLocalTransform(const CVector2d &origPosition, CAffine2d &result, ExactnessMode mode=EM_NONE) const =0
Get local transformation (from original to transformed coordinate system) at some original position.
TransformationFlags
Flags indication type of this transformation and supported operations.
@ TF_AFFINE
This is affine transformation.
@ TF_FORWARD
There are some arguments (inputs) where the transformation function is defined.
@ TF_PRESERVE_NULL
This transformation preserve position [0, 0].
@ TF_PRESERVE_ANGLE
This transformation preserve angles.
@ TF_SURJECTIVE
Function in surjective, it means there is at least one input value for each outputs.
@ TF_INJECTIVE
Function in injective, it means for each input values the output value is defined.
@ TF_INVERTED
There are some outputs where the inverted transformation is defined.
@ TF_CONTINUES
This transformation is represented by continues function.
@ TF_PRESERVE_DISTANCE
This transformation preserve distance.
virtual bool GetLocalInvTransform(const CVector2d &transfPosition, CAffine2d &result, ExactnessMode mode=EM_NONE) const =0
Get local transformation (from transformed to original coordinate system) at some transformed positio...
Template interface for any surjective mathematical function.
Common class for all classes which objects can be archived or restored from archive.
Contains the 2D objects.
Definition CAffine2d.h:11