IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
peak_icv_coordinate_system.hpp
Go to the documentation of this file.
1
11#pragma once
12
15#include <peak_common_c/detail/peak_common_defines.h>
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
27
40class CoordinateSystem : public detail::IPrintable<CoordinateSystem>
41{
42public:
48 CoordinateSystem() = default;
49
62 : m_origin(origin)
63 , m_xAxis(xAxis)
64 , m_yAxis(yAxis)
65 , m_zAxis(zAxis)
66 {}
67
73 PEAK_COMMON_NO_DISCARD peak::common::PointF GetOrigin() const
74 {
75 return m_origin;
76 }
77
84 PEAK_COMMON_NO_DISCARD peak::common::VectorF GetXAxis() const
85 {
86 return m_xAxis;
87 }
88
95 PEAK_COMMON_NO_DISCARD peak::common::VectorF GetYAxis() const
96 {
97 return m_yAxis;
98 }
99
106 PEAK_COMMON_NO_DISCARD peak::common::VectorF GetZAxis() const
107 {
108 return m_zAxis;
109 }
110
111 bool operator==(const CoordinateSystem& rhs) const
112 {
113 return m_origin == rhs.GetOrigin() && m_xAxis == rhs.GetXAxis() && m_yAxis == rhs.GetYAxis() && m_zAxis == rhs.GetZAxis();
114 }
115
116protected:
117 void Print(detail::CommaSeperatedStream& stream) const override
118 {
119 stream << m_origin << m_xAxis << m_yAxis << m_zAxis;
120 }
121
122private:
123 friend peak::common::detail::BackendAccessor<CoordinateSystem>;
124
125 explicit CoordinateSystem(const peak_icv_coordinate_system& coordinateSystem);
126
127 peak::common::PointF m_origin{ 0, 0 };
128 peak::common::VectorF m_xAxis{ 1, 0 };
129 peak::common::VectorF m_yAxis{ 0, 1 };
130 peak::common::VectorF m_zAxis{ 0, 0 };
131};
132
133inline CoordinateSystem::CoordinateSystem(const peak_icv_coordinate_system& coordinateSystem)
134 : m_origin(peak::common::detail::BackendAccessor<peak::common::PointF>::CreateInstance(coordinateSystem.origin))
135 , m_xAxis(peak::common::detail::BackendAccessor<peak::common::VectorF>::CreateInstance(coordinateSystem.x_axis))
136 , m_yAxis(peak::common::detail::BackendAccessor<peak::common::VectorF>::CreateInstance(coordinateSystem.y_axis))
137 , m_zAxis(peak::common::detail::BackendAccessor<peak::common::VectorF>::CreateInstance(coordinateSystem.z_axis))
138{}
139
140} /* namespace icv */
141} /* 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.