Go to the documentation of this file.
1 #ifndef i2d_CQuadrangle_included
2 #define i2d_CQuadrangle_included
5 // ACF includes
6 #include <i2d/CObject2dBase.h>
7 #include <i2d/CLine2d.h>
8 #include <i2d/CRectangle.h>
11 namespace i2d
12 {
19 {
20 public:
21  CQuadrangle();
22  CQuadrangle(const CLine2d& firstDiagonal, const CLine2d& secondDiagonal);
23  explicit CQuadrangle(const CRectangle& rectangle);
25  bool operator==(const CQuadrangle& quadrangle) const;
26  bool operator!=(const CQuadrangle& quadrangle) const;
28  bool IsQuadrangleValid() const;
29  bool IsQuadrangleEmpty() const;
31  const CLine2d& GetFirstDiagonal() const;
32  void SetFirstDiagonal(const CLine2d& firstDiagonal);
34  const CLine2d& GetSecondDiagonal() const;
35  void SetSecondDiagonal(const CLine2d& secondDiagonal);
37  // reimplemented (i2d::IObject2d)
38  virtual CVector2d GetCenter() const;
39  virtual void MoveCenterTo(const CVector2d& position);
40  CRectangle GetBoundingBox() const;
41  virtual bool Transform(
42  const ITransformation2d& transformation,
44  double* errorFactorPtr = NULL);
45  virtual bool InvTransform(
46  const ITransformation2d& transformation,
48  double* errorFactorPtr = NULL);
49  virtual bool GetTransformed(
50  const ITransformation2d& transformation,
51  IObject2d& result,
53  double* errorFactorPtr = NULL) const;
54  virtual bool GetInvTransformed(
55  const ITransformation2d& transformation,
56  IObject2d& result,
58  double* errorFactorPtr = NULL) const;
60  // reimplemented (istd::IChangeable)
61  virtual int GetSupportedOperations() const;
62  virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
65  // reimplemented (iser::ISerializable)
66  virtual bool Serialize(iser::IArchive& archive);
68 private:
69  CLine2d m_firstDiagonal;
70  CLine2d m_secondDiagonal;
71 };
74 } // namespace i2d
77 #endif // !i2d_CQuadrangle_included
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
External references are simple ignored.
Definition: IChangeable.h:197
Control how relationship betweeen objects are interpreted.
Definition: IChangeable.h:186
bool operator==(const CQuadrangle &quadrangle) const
void SetFirstDiagonal(const CLine2d &firstDiagonal)
Definition of a line in 2D-space.
Definition: CLine2d.h:24
Common interface for all calibration objects.
virtual CVector2d GetCenter() const
Returns center of this 2D-object.
CRectangle GetBoundingBox() const
Get bounding box of this shape.
virtual bool GetInvTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const
Calulate inverse transformation of the object into second one.
virtual bool Transform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL)
Transform this object using some transformation.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
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 rectangle area orthogonal to axis of coordination system.
Definition: CRectangle.h:26
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
virtual void MoveCenterTo(const CVector2d &position)
Move object to position position.
Base class for 2D-objects implementing interface i2d::IObject2d.
Definition: CObject2dBase.h:18
bool IsQuadrangleValid() const
bool IsQuadrangleEmpty() const
bool operator!=(const CQuadrangle &quadrangle) const
#define NULL
Definition: istd.h:64
const CLine2d & GetSecondDiagonal() const
void SetSecondDiagonal(const CLine2d &secondDiagonal)
Common interface for describing the 2D-objects.
Definition: IObject2d.h:22
Definition of convexes quadrangle object.
Definition: CQuadrangle.h:18
const CLine2d & GetFirstDiagonal() const
virtual int GetSupportedOperations() const
Get set of flags for supported operations.
virtual bool InvTransform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL)
Do inverse transformation of this object.
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
virtual bool GetTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const
Calulate transformation of the object into second one.

© 2007-2017 Witold Gantzke and Kirill Lepskiy