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