20 template <
class T,
class ENABLE =
void>
29 class Point3DH<T, typename EnableIfArithmetic<T>::type> final
79 :
Point3DH(point3d.X(), point3d.Y(), point3d.Z())
88 template <std::
size_t N>
91 static_assert(N == 4,
"CVB: Point3DH must have 4 elements");
100 T
X() const noexcept {
…}
120 T
Y() const noexcept {
…}
140 T
Z() const noexcept {
…}
160 T
W() const noexcept {
…}
197 return (x_ == other.x_ && y_ == other.y_ && z_ == other.z_ && w_ == other.w_);
208 return !(*
this == other);
216 return Point3DH<C>(
static_cast<C
>(
X()),
static_cast<C
>(
Y()),
static_cast<C
>(
Z()),
static_cast<C
>(
W()));
287 assert(index < 4 && index >= 0);
288 return *(&x_ + index);
299 assert(index < 4 && index >= 0);
300 return *(&x_ + index);
304 T x_ =
static_cast<T
>(0.0);
305 T y_ =
static_cast<T
>(0.0);
306 T z_ =
static_cast<T
>(0.0);
307 T w_ =
static_cast<T
>(1.0);
322 return Point3DH<T>(lhs.
X() + rhs.
X(), lhs.
Y() + rhs.
Y(), lhs.
Z() + rhs.
Z(), lhs.
W() + rhs.
W());
337 return Point3DH<T>(lhs.
X() - rhs.
X(), lhs.
Y() - rhs.
Y(), lhs.
Z() - rhs.
Z(), lhs.
W() - rhs.
W());
352 return lhs.
X() * rhs.
X() + lhs.
Y() * rhs.
Y() + lhs.
Z() * rhs.
Z() + lhs.
W() * rhs.
W();
367 return Point3DH<T>(lhs.
X() * rhs, lhs.
Y() * rhs, lhs.
Z() * rhs, lhs.
W() * rhs);
397 return Point3DH<T>(lhs.
X() / rhs, lhs.
Y() / rhs, lhs.
Z() / rhs, lhs.
W() / rhs);
Multi-purpose 3D vector class (homogeneous).
Definition point_3d_h.hpp:22
Point3DH< T > operator*(const Point3DH< T > &lhs, const T &rhs)
Multiply point with scalar.
Definition point_3d_h.hpp:365
T operator*(const Point3DH< T > &lhs, const Point3DH< T > &rhs)
Inner product of two point vectors.
Definition point_3d_h.hpp:350
Point3DH< T > & operator*=(const T &value) noexcept
Multiplies by a scalar and assigns to this point.
Definition point_3d_h.hpp:255
const T & operator[](int index) const noexcept
Index based element access.
Definition point_3d_h.hpp:285
Point3DH(T x, T y, T z, T w) noexcept
Create a point from the x-, y-, z- and w-component.
Definition point_3d_h.hpp:65
T X() const noexcept
Gets the x-component of the point.
Definition point_3d_h.hpp:100
T W() const noexcept
Gets the w-component of the point.
Definition point_3d_h.hpp:160
Point3DH< T > & operator-=(const Point3DH< T > &point) noexcept
Subtracts and assigns to this point.
Definition point_3d_h.hpp:240
T Y() const noexcept
Gets the y-component of the point.
Definition point_3d_h.hpp:120
void SetX(T x) noexcept
Sets the x-component of the point.
Definition point_3d_h.hpp:110
Point3DH< T > & operator/=(const T &value) noexcept
Divide by a scalar and assigns to this point.
Definition point_3d_h.hpp:270
void SetY(T y)
Sets the y-component of the point.
Definition point_3d_h.hpp:130
Point3DH< T > operator-(const Point3DH< T > &lhs, const Point3DH< T > &rhs)
Subtracts two points.
Definition point_3d_h.hpp:335
Point3DH< T > operator+(const Point3DH< T > &lhs, const Point3DH< T > &rhs)
Add two points.
Definition point_3d_h.hpp:320
Point3DH() noexcept=default
Creates a default point at (0, 0).
T Z() const noexcept
Gets the z-component of the point.
Definition point_3d_h.hpp:140
Point3DH(const T(&list)[N]) noexcept
Construct a point with an initializer list.
Definition point_3d_h.hpp:89
Point3DH< T > & operator+=(const Point3DH< T > &point) noexcept
Adds and assigns to this point.
Definition point_3d_h.hpp:225
void SetW(T w)
Sets the w-component of the point.
Definition point_3d_h.hpp:170
Point3DH(Point3D< T > point3d) noexcept
Create a homogeneous point from a point.
Definition point_3d_h.hpp:78
bool operator==(const Point3DH< T > &other) const noexcept
Compares to an other point.
Definition point_3d_h.hpp:195
void Normalize() noexcept
Normalize the x-, y-, and z- with the w-component.
Definition point_3d_h.hpp:181
T & operator[](int index) noexcept
Index based element access.
Definition point_3d_h.hpp:297
void SetZ(T z)
Sets the z-component of the point.
Definition point_3d_h.hpp:150
Point3DH< T > operator/(const Point3DH< T > &lhs, const T &rhs)
Divide point by scalar.
Definition point_3d_h.hpp:395
bool operator!=(const Point3DH< T > &other) const noexcept
Compares to an other point.
Definition point_3d_h.hpp:206
Multi-purpose 3D vector class.
Definition point_3d.hpp:22
Point3DH< T > operator*(const T &lhs, const Point3DH< T > &rhs)
Multiply scalar with point.
Definition point_3d_h.hpp:380
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
Point3DH< T > Vector3DH
Alias for Point3D.
Definition point_3d_h.hpp:402