IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
peak_icv_coordinate_system.hpp
Go to the documentation of this file.
1
11#pragma once
12
17#include <peak_icv_c/algorithms/calibration/peak_icv_calibration_view.h>
18#include <limits>
19#include <utility>
20#include <vector>
21
22namespace peak
23{
24namespace icv
25{
26
27namespace experimental
28{
29
42class CoordinateSystem : public detail::IPrintable<CoordinateSystem>
43{
44public:
50 CoordinateSystem() = default;
51
64 : m_origin(origin)
65 , m_xAxis(xAxis)
66 , m_yAxis(yAxis)
67 , m_zAxis(zAxis)
68 {}
69
75 PEAK_ICV_NO_DISCARD peak::common::PointF GetOrigin() const
76 {
77 return m_origin;
78 }
79
86 PEAK_ICV_NO_DISCARD peak::common::VectorF GetXAxis() const
87 {
88 return m_xAxis;
89 }
90
97 PEAK_ICV_NO_DISCARD peak::common::VectorF GetYAxis() const
98 {
99 return m_yAxis;
100 }
101
108 PEAK_ICV_NO_DISCARD peak::common::VectorF GetZAxis() const
109 {
110 return m_zAxis;
111 }
112
113 bool operator==(const CoordinateSystem& rhs) const
114 {
115 return m_origin == rhs.GetOrigin() && m_xAxis == rhs.GetXAxis() && m_yAxis == rhs.GetYAxis() && m_zAxis == rhs.GetZAxis();
116 }
117
118protected:
119 void Print(detail::CommaSeperatedStream& stream) const override
120 {
121 stream << m_origin << m_xAxis << m_yAxis << m_zAxis;
122 }
123
124private:
125 friend peak::common::detail::BackendAccessor<CoordinateSystem>;
126
127 explicit CoordinateSystem(const peak_icv_coordinate_system& coordinateSystem);
128
129 peak::common::PointF m_origin{ 0, 0 };
130 peak::common::VectorF m_xAxis{ 1, 0 };
131 peak::common::VectorF m_yAxis{ 0, 1 };
132 peak::common::VectorF m_zAxis{ 0, 0 };
133};
134
135inline CoordinateSystem::CoordinateSystem(const peak_icv_coordinate_system& coordinateSystem)
136 : m_origin(peak::common::detail::BackendAccessor<peak::common::PointF>::CreateInstance(coordinateSystem.origin))
137 , m_xAxis(peak::common::detail::BackendAccessor<peak::common::VectorF>::CreateInstance(coordinateSystem.x_axis))
138 , m_yAxis(peak::common::detail::BackendAccessor<peak::common::VectorF>::CreateInstance(coordinateSystem.y_axis))
139 , m_zAxis(peak::common::detail::BackendAccessor<peak::common::VectorF>::CreateInstance(coordinateSystem.z_axis))
140{}
141} /* namespace experimental */
142
143} /* namespace icv */
144} /* namespace peak */
Represents the coordinate system of a calibration view projected into the image plane....
peak::common::VectorF GetZAxis() const
Returns the vector that describes the z-axis of the coordinate system. Its length is determined by tw...
CoordinateSystem(peak::common::PointF origin, peak::common::VectorF xAxis, peak::common::VectorF yAxis, peak::common::VectorF zAxis)
CoordinateSystem constructor from origin, xAxis, yAxis and zAxis.
bool operator==(const CoordinateSystem &rhs) const
CoordinateSystem()=default
CoordinateSystem constructor.
peak::common::VectorF GetXAxis() const
Returns the vector that describes the x-axis of the coordinate system. Its length is determined by tw...
peak::common::PointF GetOrigin() const
Returns the location of the coordinate system origin.
peak::common::VectorF GetYAxis() const
Returns the vector that describes the y-axis of the coordinate system. Its length is determined by tw...
detail::PointT< float > PointF
2D point with single-precision floating-point coordinates.
peak::common::PointF VectorF
Alias for a 2D point with floating point coordinates.