CPerspectiveCalibration2d.h
Go to the documentation of this file.
1 #ifndef icalib_CPerspectiveCalibration2d_included
2 #define icalib_CPerspectiveCalibration2d_included
3 
4 
5 // ACF includes
6 #include <i2d/ICalibration2d.h>
7 #include <i2d/CAffine2d.h>
8 #include <i2d/CRectangle.h>
9 
10 
11 namespace icalib
12 {
13 
14 
22 {
23 public:
25  CPerspectiveCalibration2d(const i2d::CAffine2d& affinePart, const i2d::CVector2d& perspectiveAxis);
26 
30  void Reset();
31 
32  const i2d::CAffine2d& GetAffinePart() const;
34  virtual void SetAffinePart(const i2d::CAffine2d& value);
35 
36  const i2d::CVector2d& GetPerspAxis() const;
37  virtual void SetPerspAxis(const i2d::CVector2d& value);
38 
39  void SetArgumentArea(const i2d::CRectangle* areaPtr);
40  void SetResultArea(const i2d::CRectangle* areaPtr);
41  void SetArgumentUnitInfo(const imath::IUnitInfo* unitInfoPtr);
42  void SetResultUnitInfo(const imath::IUnitInfo* unitInfoPtr);
43 
44  bool operator==(const CPerspectiveCalibration2d& calib) const;
45  bool operator!=(const CPerspectiveCalibration2d& calib) const;
46 
47  // reimplemented (i2d::ICalibration2d)
48  virtual const i2d::CRectangle* GetArgumentArea() const;
49  virtual const i2d::CRectangle* GetResultArea() const;
50  virtual const imath::IUnitInfo* GetArgumentUnitInfo() const;
51  virtual const imath::IUnitInfo* GetResultUnitInfo() const;
52  virtual const ICalibration2d* CreateCombinedCalibration(const ITransformation2d& transformation) const;
53 
54  // reimplemented (i2d::ITransformation2d)
55  virtual int GetTransformationFlags() const;
56  virtual bool GetDistance(
57  const i2d::CVector2d& origPos1,
58  const i2d::CVector2d& origPos2,
59  double& result,
60  ExactnessMode mode = EM_NONE) const;
61  virtual bool GetPositionAt(
62  const i2d::CVector2d& origPosition,
63  i2d::CVector2d& result,
64  ExactnessMode mode = EM_NONE) const;
65  virtual bool GetInvPositionAt(
66  const i2d::CVector2d& transfPosition,
67  i2d::CVector2d& result,
68  ExactnessMode mode = EM_NONE) const;
69  virtual bool GetLocalTransform(
70  const i2d::CVector2d& origPosition,
71  i2d::CAffine2d& result,
72  ExactnessMode mode = EM_NONE) const;
73  virtual bool GetLocalInvTransform(
74  const i2d::CVector2d& transfPosition,
75  i2d::CAffine2d& result,
76  ExactnessMode mode = EM_NONE) const;
77 
78  // reimplemented (imath::TISurjectFunction)
79  virtual bool GetInvValueAt(const i2d::CVector2d& argument, i2d::CVector2d& result) const;
80  virtual i2d::CVector2d GetInvValueAt(const i2d::CVector2d& argument) const;
81 
82  // reimplemented (imath::TIMathFunction)
83  virtual bool GetValueAt(const i2d::CVector2d& argument, i2d::CVector2d& result) const;
84  virtual i2d::CVector2d GetValueAt(const i2d::CVector2d& argument) const;
85 
86  // reimplemented (iser::ISerializable)
87  virtual bool Serialize(iser::IArchive& archive);
88 
89  // reimplemented (istd::IChangeable)
90  virtual int GetSupportedOperations() const;
91  virtual bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
92  virtual bool IsEqual(const istd::IChangeable& object) const;
93  virtual istd::IChangeable* CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const;
94  virtual bool ResetData(CompatibilityMode mode = CM_WITHOUT_REFS);
95 
96 protected:
98 
99  // reimplemented (istd::IChangeable)
100  virtual void OnEndChanges(const ChangeSet& changeSet);
101 
102 private:
103  i2d::CAffine2d m_affinePart;
104  i2d::CVector2d m_perspAxis;
105 
106  const i2d::CRectangle* m_argumentAreaPtr;
107  const i2d::CRectangle* m_resultAreaPtr;
108  const imath::IUnitInfo* m_argumentUnitInfoPtr;
109  const imath::IUnitInfo* m_resultUnitInfoPtr;
110 
111  int m_transformationFlags;
112 };
113 
114 
115 // inline methods
116 
118 {
119  return m_affinePart;
120 }
121 
122 
124 {
125  return m_affinePart;
126 }
127 
128 
130 {
131  return m_perspAxis;
132 }
133 
134 
136 {
137  return !operator==(calib);
138 }
139 
140 
141 } // namespace icalib
142 
143 
144 #endif // !icalib_CPerspectiveCalibration2d_included
145 
146 
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
virtual void SetPerspAxis(const i2d::CVector2d &value)
virtual int GetTransformationFlags() const
virtual bool ResetData(CompatibilityMode mode=CM_WITHOUT_REFS)
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
virtual bool GetLocalInvTransform(const i2d::CVector2d &transfPosition, i2d::CAffine2d &result, ExactnessMode mode=EM_NONE) const
virtual bool Serialize(iser::IArchive &archive)
void SetArgumentUnitInfo(const imath::IUnitInfo *unitInfoPtr)
const i2d::CAffine2d & GetAffinePart() const
virtual bool GetInvValueAt(const i2d::CVector2d &argument, i2d::CVector2d &result) const
bool operator==(const CPerspectiveCalibration2d &calib) const
virtual bool IsEqual(const istd::IChangeable &object) const
virtual bool GetPositionAt(const i2d::CVector2d &origPosition, i2d::CVector2d &result, ExactnessMode mode=EM_NONE) const
void SetResultUnitInfo(const imath::IUnitInfo *unitInfoPtr)
virtual const ICalibration2d * CreateCombinedCalibration(const ITransformation2d &transformation) const
virtual bool GetValueAt(const i2d::CVector2d &argument, i2d::CVector2d &result) const
virtual void SetAffinePart(const i2d::CAffine2d &value)
void Reset()
Reset this calibration, set to be identity transform.
virtual const imath::IUnitInfo * GetResultUnitInfo() const
void SetArgumentArea(const i2d::CRectangle *areaPtr)
virtual bool GetDistance(const i2d::CVector2d &origPos1, const i2d::CVector2d &origPos2, double &result, ExactnessMode mode=EM_NONE) const
virtual int GetSupportedOperations() const
void SetResultArea(const i2d::CRectangle *areaPtr)
bool operator!=(const CPerspectiveCalibration2d &calib) const
virtual void OnEndChanges(const ChangeSet &changeSet)
const i2d::CVector2d & GetPerspAxis() const
virtual const i2d::CRectangle * GetArgumentArea() const
virtual bool GetLocalTransform(const i2d::CVector2d &origPosition, i2d::CAffine2d &result, ExactnessMode mode=EM_NONE) const
virtual const i2d::CRectangle * GetResultArea() const
virtual const imath::IUnitInfo * GetArgumentUnitInfo() const
virtual bool GetInvPositionAt(const i2d::CVector2d &transfPosition, i2d::CVector2d &result, ExactnessMode mode=EM_NONE) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy