CParallelogram.h
Go to the documentation of this file.
1 #ifndef i2d_CParallelogram_included
2 #define i2d_CParallelogram_included
3 
4 
5 
6 // Qt includes
7 #include <QtCore/QVector>
8 
9 // ACF includes
10 #include <iser/CArchiveTag.h>
11 #include <i2d/CObject2dBase.h>
12 #include <i2d/CAffine2d.h>
13 #include <i2d/CRectangle.h>
14 
15 
16 namespace i2d
17 {
18 
19 
27 {
28 public:
30 
31  virtual const i2d::CAffine2d& GetTransform() const;
32  virtual void SetTransform(const i2d::CAffine2d& transform);
33  virtual const i2d::CMatrix2d& GetDeformMatrix() const;
34  virtual void SetDeformMatrix(const i2d::CMatrix2d& deform);
35 
36  double GetWidth() const;
37  void SetWidth(double w);
38  double GetHeight() const;
39  void SetHeight(double h);
40  QVector<i2d::CVector2d> GetNodes() const;
41  double GetRotation() const;
42  void SetRotation(double angle);
44  void SetTranslation(const i2d::CVector2d& translation);
45 
46  // reimplemented (i2d::IObject2d)
47  virtual i2d::CVector2d GetCenter() const;
48  virtual void MoveCenterTo(const i2d::CVector2d& position);
49  virtual i2d::CRectangle GetBoundingBox() const;
50  virtual bool Transform(
51  const i2d::ITransformation2d& transformation,
53  double* errorFactorPtr = NULL);
54  virtual bool InvTransform(
55  const i2d::ITransformation2d& transformation,
57  double* errorFactorPtr = NULL);
58  virtual bool GetTransformed(
59  const i2d::ITransformation2d& transformation,
60  i2d::IObject2d& result,
62  double* errorFactorPtr = NULL) const;
63  virtual bool GetInvTransformed(
64  const i2d::ITransformation2d& transformation,
65  i2d::IObject2d& result,
67  double* errorFactorPtr = NULL) const;
68 
69  // reimplemented (istd::IChangeable)
70  virtual int GetSupportedOperations() const;
71  virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
73 
74  // reimplemented (iser::ISerializable)
75  virtual bool Serialize(iser::IArchive& archive);
76 
77 protected:
78  virtual i2d::CVector2d GetCenter(const i2d::CMatrix2d& deformMatrix) const;
79 
80 private:
81  i2d::CAffine2d m_transform;
82 };
83 
84 
85 // inline methods
86 
88 {
89  return m_transform;
90 }
91 
92 
94 {
95  return m_transform.GetDeformMatrix();
96 }
97 
98 
100 {
101  m_transform.SetDeformMatrix(deform);
102 }
103 
104 
105 } // namespace i2d
106 
107 
108 #endif // !i2d_CParallelogram_included
109 
110 
External references are simple ignored.
Definition: IChangeable.h:197
CompatibilityMode
Control how relationship betweeen objects are interpreted.
Definition: IChangeable.h:186
void SetTranslation(const i2d::CVector2d &translation)
virtual const i2d::CMatrix2d & GetDeformMatrix() const
virtual bool InvTransform(const i2d::ITransformation2d &transformation, i2d::ITransformation2d::ExactnessMode mode=i2d::ITransformation2d::EM_NONE, double *errorFactorPtr=NULL)
Do inverse transformation of this object.
virtual void SetDeformMatrix(const i2d::CMatrix2d &deform)
void SetDeformMatrix(const CMatrix2d &deform)
Set rotation, skew and scale part of this affine transformation.
Definition: CAffine2d.h:235
Common interface for all calibration objects.
const CMatrix2d & GetDeformMatrix() const
Get rotation, skew and scale part of this affine transformation.
Definition: CAffine2d.h:229
double GetWidth() const
double GetHeight() const
virtual void SetTransform(const i2d::CAffine2d &transform)
There are no preferences, should be automatically selected.
virtual i2d::CRectangle GetBoundingBox() const
Get bounding box of this shape.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
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 rectangle area orthogonal to axis of coordination system.
Definition: CRectangle.h:26
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
2D matrix.
Definition: CMatrix2d.h:18
void SetHeight(double h)
QVector< i2d::CVector2d > GetNodes() const
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
virtual bool Transform(const i2d::ITransformation2d &transformation, i2d::ITransformation2d::ExactnessMode mode=i2d::ITransformation2d::EM_NONE, double *errorFactorPtr=NULL)
Transform this object using some transformation.
Base class for 2D-objects implementing interface i2d::IObject2d.
Definition: CObject2dBase.h:18
virtual bool GetInvTransformed(const i2d::ITransformation2d &transformation, i2d::IObject2d &result, i2d::ITransformation2d::ExactnessMode mode=i2d::ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const
Calulate inverse transformation of the object into second one.
virtual i2d::CVector2d GetCenter() const
Returns center of this 2D-object.
#define NULL
Definition: istd.h:64
virtual bool GetTransformed(const i2d::ITransformation2d &transformation, i2d::IObject2d &result, i2d::ITransformation2d::ExactnessMode mode=i2d::ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const
Calulate transformation of the object into second one.
void SetRotation(double angle)
void SetWidth(double w)
Common interface for describing the 2D-objects.
Definition: IObject2d.h:22
This class defines parallelogram.
virtual const i2d::CAffine2d & GetTransform() const
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
i2d::CVector2d GetTranslation() const
This class defines an affine 2D-transformation.
Definition: CAffine2d.h:17
virtual void MoveCenterTo(const i2d::CVector2d &position)
Move object to position position.
virtual int GetSupportedOperations() const
Get set of flags for supported operations.
double GetRotation() const

© 2007-2017 Witold Gantzke and Kirill Lepskiy