Multi-purpose 3D vector class (homogeneous). More...
#include <cvb/point_3d_h.hpp>
Public Member Functions | |
Point3DH () noexcept=default | |
Creates a default point at (0, 0). More... | |
Point3DH (T x, T y, T z) noexcept | |
Create a point from the x-, y- and z-component. More... | |
Point3DH (T x, T y, T z, T w) noexcept | |
Create a point from the x-, y-, z- and w-component. More... | |
Point3DH (Point3D< T > point3d) noexcept | |
Create a homogeneous point from a point. More... | |
template<std::size_t N> | |
Point3DH (const T(&list)[N]) noexcept | |
Construct a point with an initializer list. More... | |
T | X () const noexcept |
Gets the x-component of the point. More... | |
void | SetX (T x) noexcept |
Sets the x-component of the point. More... | |
T | Y () const noexcept |
Gets the y-component of the point. More... | |
void | SetY (T y) |
Sets the y-component of the point. More... | |
T | Z () const noexcept |
Gets the z-component of the point. More... | |
void | SetZ (T z) |
Sets the z-component of the point. More... | |
T | W () const noexcept |
Gets the w-component of the point. More... | |
void | SetW (T w) |
Sets the w-component of the point. More... | |
void | Normalize () noexcept |
Normalize the x-, y-, and z- with the w-component. More... | |
bool | operator== (const Point3DH< T > &other) const noexcept |
Compares to an other point. More... | |
bool | operator!= (const Point3DH< T > &other) const noexcept |
Compares to an other point. More... | |
template<class C > | |
operator Point3DH< C > () const noexcept | |
Enable casting. | |
Point3DH< T > & | operator+= (const Point3DH< T > &point) noexcept |
Adds and assigns to this point. More... | |
Point3DH< T > & | operator-= (const Point3DH< T > &point) noexcept |
Subtracts and assigns to this point. More... | |
Point3DH< T > & | operator*= (const T &value) noexcept |
Multiplies by a scalar and assigns to this point. More... | |
Point3DH< T > & | operator/= (const T &value) noexcept |
Divide by a scalar and assigns to this point. More... | |
const T & | operator[] (int index) const noexcept |
Index based element access. More... | |
T & | operator[] (int index) noexcept |
Index based element access. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<size_t I, class T , std::enable_if_t< less< I, 4 >::value, int > = 0> | |
auto | get (const Point3DH< T > &point) noexcept -> decltype(point[I]) |
Get's the I-th element of the Point3DH<T>. More... | |
template<size_t I, class T , std::enable_if_t< less< I, 4 >::value, int > = 0> | |
void | set (Point3DH< T > &point, const T &val) noexcept |
Set's the value of the I-th element in the Point3DH<T> point. More... | |
template<class T > | |
Point3DH< T > | operator+ (const Point3DH< T > &lhs, const Point3DH< T > &rhs) |
Add two points. More... | |
template<class T > | |
Point3DH< T > | operator- (const Point3DH< T > &lhs, const Point3DH< T > &rhs) |
Subtracts two points. More... | |
template<class T > | |
T | operator* (const Point3DH< T > &lhs, const Point3DH< T > &rhs) |
Inner product of two point vectors. More... | |
template<class T > | |
Point3DH< T > | operator* (const Point3DH< T > &lhs, const T &rhs) |
Multiply point with scalar. More... | |
template<class T > | |
Point3DH< T > | operator/ (const Point3DH< T > &lhs, const T &rhs) |
Divide point by scalar. More... | |
Multi-purpose 3D vector class (homogeneous).
|
defaultnoexcept |
Creates a default point at (0, 0).
Does | not throw any exception. |
|
inlinenoexcept |
Create a point from the x-, y- and z-component.
[in] | x | Data to initialize with. |
[in] | y | Data to initialize with. |
[in] | z | Data to initialize with. |
Does | not throw any exception. |
|
inlinenoexcept |
Create a point from the x-, y-, z- and w-component.
[in] | x | Data to initialize with. |
[in] | y | Data to initialize with. |
[in] | z | Data to initialize with. |
[in] | w | Data to initialize with. |
Does | not throw any exception. |
Create a homogeneous point from a point.
[in] | point3d | 3D Point with x-, y- and z-component. |
Does | not throw any exception. |
|
inlinenoexcept |
Construct a point with an initializer list.
[in] | list | Containing exactly 4 elements. |
Does | not throw any exception. |
|
inlinenoexcept |
Normalize the x-, y-, and z- with the w-component.
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other point.
[in] | other | Other point. |
Does | not throw any exception. |
|
inlinenoexcept |
Multiplies by a scalar and assigns to this point.
[in] | value | The scalar. |
Does | not throw any exception. |
Adds and assigns to this point.
[in] | point | Other point. |
Does | not throw any exception. |
Subtracts and assigns to this point.
[in] | point | Other point. |
Does | not throw any exception. |
|
inlinenoexcept |
Divide by a scalar and assigns to this point.
[in] | value | The scalar. |
Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other point.
[in] | other | Other point. |
Does | not throw any exception. |
|
inlinenoexcept |
Index based element access.
[in] | index | Index of the element. |
Does | not throw any exception. |
|
inlinenoexcept |
Index based element access.
[in] | index | Index of the element. |
Does | not throw any exception. |
|
inline |
Sets the w-component of the point.
[in] | w | W-component. |
Does | not throw any exception. |
|
inlinenoexcept |
Sets the x-component of the point.
[in] | x | X-component. |
Does | not throw any exception. |
|
inline |
Sets the y-component of the point.
[in] | y | Y-component. |
Does | not throw any exception. |
|
inline |
Sets the z-component of the point.
[in] | z | Z-component. |
Does | not throw any exception. |
|
inlinenoexcept |
Gets the w-component of the point.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the x-component of the point.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the y-component of the point.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the z-component of the point.
Does | not throw any exception. |
|
related |
Inner product of two point vectors.
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side value. |
Does | not throw any exception. |
Multiply point with scalar.
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side value. |
Does | not throw any exception. |
Add two points.
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side point. |
Does | not throw any exception. |
Subtracts two points.
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side point. |
Does | not throw any exception. |
Divide point by scalar.
[in] | lhs | Right hand side matrix. |
[in] | rhs | Left hand side value. |
Does | not throw any exception. |
|
related |