16#pragma pack ( push, 4 )
21template<
class T,
class ENABLE =
void>
85 :
Point3DC(point3d.X(), point3d.Y(), point3d.Z())
94 template<std::
size_t N>
97 static_assert(N == 4,
"CVB: Point3DC must have 4 elements");
98 std::copy(std::begin(list), std::end(list), &x_);
190 return sqrt(x_ * x_ + y_ * y_ + z_ * z_);
202 return (x_ == other.x_ && y_ == other.y_ && z_ == other.z_ && c_ == other.c_);
214 return !(*
this == other);
222 return Point3DC<C>(
static_cast<C
>(
X()),
static_cast<C
>(
Y()),
static_cast<C
>(
Z()),
static_cast<C
>(C()));
236 c_ = std::min(c_, point.c_);
252 c_ = std::min(c_, point.c_);
293 assert(index < 4 && index >= 0);
294 return *(&x_ + index);
305 assert(index < 4 && index >= 0);
306 return *(&x_ + index);
311 T x_ =
static_cast<T
>(0.0);
312 T y_ =
static_cast<T
>(0.0);
313 T z_ =
static_cast<T
>(0.0);
314 T c_ =
static_cast<T
>(1.0);
364 return lhs.
X() * rhs.
X() + lhs.
Y() * rhs.
Y() + lhs.
Z() * rhs.
Z() ;
Multi-purpose 3D vector class with confidence.
Definition: point_3d_c.hpp:23
Point3DC() noexcept=default
Creates a default point at (0, 0).
const T & operator[](int index) const noexcept
Index based element access.
Definition: point_3d_c.hpp:291
Point3DC(Point3D< T > point3d) noexcept
Create a 3D point with confidence from a point.
Definition: point_3d_c.hpp:84
Point3DC< T > & operator+=(const Point3DC< T > &point) noexcept
Adds and assigns to this point.
Definition: point_3d_c.hpp:231
T X() const noexcept
Gets the x-component of the point.
Definition: point_3d_c.hpp:108
T Y() const noexcept
Gets the y-component of the point.
Definition: point_3d_c.hpp:128
void SetX(T x) noexcept
Sets the x-component of the point.
Definition: point_3d_c.hpp:118
Point3DC(const T(&list)[N]) noexcept
Construct a point with an initializer list.
Definition: point_3d_c.hpp:95
void SetY(T y)
Sets the y-component of the point.
Definition: point_3d_c.hpp:138
Point3DC< T > & operator/=(const T &value) noexcept
Divide by a scalar and assigns to this point.
Definition: point_3d_c.hpp:277
bool operator!=(const Point3DC< T > &other) const noexcept
Compares to an other point.
Definition: point_3d_c.hpp:212
Point3DC< T > operator+(const Point3DC< T > &lhs, const Point3DC< T > &rhs)
Add two points.
Definition: point_3d_c.hpp:328
Point3DC< T > & operator-=(const Point3DC< T > &point) noexcept
Subtracts and assigns to this point.
Definition: point_3d_c.hpp:247
T Z() const noexcept
Gets the z-component of the point.
Definition: point_3d_c.hpp:148
void SetConfidence(T c)
Sets confidence of the point.
Definition: point_3d_c.hpp:178
Point3DC(T x, T y, T z, T c) noexcept
Create a point from the x-, y-, z- component and confidence.
Definition: point_3d_c.hpp:70
Point3DC< T > & operator*=(const T &value) noexcept
Multiplies by a scalar and assigns to this point.
Definition: point_3d_c.hpp:263
Point3DC< T > operator/(const Point3DC< T > &lhs, const T &rhs)
Divide point by scalar.
Definition: point_3d_c.hpp:409
Point3DC< T > operator*(const Point3DC< T > &lhs, const T &rhs)
Multiply point with scalar.
Definition: point_3d_c.hpp:377
T Confidence() const noexcept
Gets confidence of the point.
Definition: point_3d_c.hpp:168
T Length() const noexcept
Gets the length of this point.
Definition: point_3d_c.hpp:188
Point3DC< T > operator-(const Point3DC< T > &lhs, const Point3DC< T > &rhs)
Subtracts two points.
Definition: point_3d_c.hpp:345
bool operator==(const Point3DC< T > &other) const noexcept
Compares to an other point.
Definition: point_3d_c.hpp:200
T & operator[](int index) noexcept
Index based element access.
Definition: point_3d_c.hpp:303
void SetZ(T z)
Sets the z-component of the point.
Definition: point_3d_c.hpp:158
T operator*(const Point3DC< T > &lhs, const Point3DC< T > &rhs)
Inner product of two point vectors.
Definition: point_3d_c.hpp:362
Multi-purpose 3D vector class.
Definition: point_3d.hpp:22
Point3DC< T > operator*(const T &lhs, const Point3DC< T > &rhs)
Multiply scalar with point.
Definition: point_3d_c.hpp:394
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24