CAffineTransformation2d.h
Go to the documentation of this file.
1 #ifndef i2d_CAffineTransformation2d_included
2 #define i2d_CAffineTransformation2d_included
3 
4 
5 // ACF includes
7 #include <i2d/CAffine2d.h>
8 
9 
10 namespace i2d
11 {
12 
13 
18 {
19 public:
21 
22  explicit CAffineTransformation2d(const i2d::CAffine2d& transformation);
23 
27  const i2d::CAffine2d& GetTransformation() const;
28 
34 
38  void SetTransformation(const i2d::CAffine2d& transformation);
39 
43  void Reset();
44 
48  void Reset(const CVector2d& translation);
49 
53  void Reset(const CVector2d& translation, double angle, double scale = 1.0);
54 
58  void Reset(const CVector2d& translation, double angle, const CVector2d& scale);
59 
60  // reimplemented (i2d::ITransformation2d)
61  virtual int GetTransformationFlags() const;
62  virtual bool GetDistance(
63  const CVector2d& origPos1,
64  const CVector2d& origPos2,
65  double& result,
66  ExactnessMode mode = EM_NONE) const;
67  virtual bool GetPositionAt(
68  const CVector2d& origPosition,
69  CVector2d& result,
70  ExactnessMode mode = EM_NONE) const;
71  virtual bool GetInvPositionAt(
72  const CVector2d& transfPosition,
73  CVector2d& result,
74  ExactnessMode mode = EM_NONE) const;
75  virtual bool GetLocalTransform(
76  const CVector2d& origPosition,
77  CAffine2d& result,
78  ExactnessMode mode = EM_NONE) const;
79  virtual bool GetLocalInvTransform(
80  const CVector2d& transfPosition,
81  CAffine2d& result,
82  ExactnessMode mode = EM_NONE) const;
83 
84  // reimplemented (imath::TISurjectFunction)
85  virtual bool GetInvValueAt(const CVector2d& argument, CVector2d& result) const;
86  virtual CVector2d GetInvValueAt(const CVector2d& argument) const;
87 
88  // reimplemented (imath::TIMathFunction)
89  virtual bool GetValueAt(const CVector2d& argument, CVector2d& result) const;
90  virtual CVector2d GetValueAt(const CVector2d& argument) const;
91 
92  // reimplemented (iser::ISerializable)
93  virtual bool Serialize(iser::IArchive& archive);
94 
95  // reimplemented (istd::IChangeable)
96  virtual bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
98 
99 protected:
101 };
102 
103 
104 // inline methods
105 
107 {
108  return m_transformation;
109 }
110 
111 
113 {
114  return m_transformation;
115 }
116 
117 
118 } // namespace i2d
119 
120 
121 #endif // !i2d_CAffineTransformation2d_included
122 
123 
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
void Reset()
Set to identity transformation.
External references are simple ignored.
Definition: IChangeable.h:197
CompatibilityMode
Control how relationship betweeen objects are interpreted.
Definition: IChangeable.h:186
virtual bool GetInvValueAt(const CVector2d &argument, CVector2d &result) const
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
Copy this object from another one.
virtual bool GetLocalTransform(const CVector2d &origPosition, CAffine2d &result, ExactnessMode mode=EM_NONE) const
Get local transformation (from original to transformed coordinate system) at some original position...
Common interface for all calibration objects.
const i2d::CAffine2d & GetTransformation() const
Get used transformation object.
virtual int GetTransformationFlags() const
Get flags of describing type of this transformation.
There are no preferences, should be automatically selected.
Represent input/output persistence archive.
Definition: IArchive.h:30
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
virtual bool GetValueAt(const CVector2d &argument, CVector2d &result) const
virtual bool GetInvPositionAt(const CVector2d &transfPosition, CVector2d &result, ExactnessMode mode=EM_NONE) const
Get position after transformation.
virtual bool GetPositionAt(const CVector2d &origPosition, CVector2d &result, ExactnessMode mode=EM_NONE) const
Get position after transformation.
void SetTransformation(const i2d::CAffine2d &transformation)
Set the transformation object.
This class defines an affine 2D-transformation.
Definition: CAffine2d.h:17
virtual bool GetLocalInvTransform(const CVector2d &transfPosition, CAffine2d &result, ExactnessMode mode=EM_NONE) const
Get local transformation (from transformed to original coordinate system) at some transformed positio...
i2d::CAffine2d & GetTransformationRef()
Get reference to internal transformation object.
Definition of an affine transformation for 2D-spaces.
virtual bool GetDistance(const CVector2d &origPos1, const CVector2d &origPos2, double &result, ExactnessMode mode=EM_NONE) const
Compute a shortness distance in transformed coordinations.

© 2007-2017 Witold Gantzke and Kirill Lepskiy