Multi-purpose 3D vector class.
More...
#include <cvb/point_3d.hpp>
|
(Note that these are not member functions.)
|
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>. More...
|
|
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. More...
|
|
template<class T > |
Point3D< T > | operator+ (const Point3D< T > &lhs, const Point3D< T > &rhs) |
| Add two points. More...
|
|
template<class T > |
Point3D< T > | operator- (const Point3D< T > &lhs, const Point3D< T > &rhs) |
| Subtracts two points. More...
|
|
template<class T > |
T | operator* (const Point3D< T > &lhs, const Point3D< T > &rhs) |
| Inner product of two point vectors. More...
|
|
template<class T > |
Point3D< T > | operator* (const Point3D< T > &lhs, const T &rhs) |
| Multiply point with scalar. More...
|
|
template<class T > |
Point3D< T > | operator* (const T &lhs, const Point3D< T > &rhs) |
| Multiply scalar with point. More...
|
|
template<class T > |
Point3D< T > | operator/ (const Point3D< T > &lhs, const T &rhs) |
| Divide point by scalar. More...
|
|
template<class T > |
Point3DC< T > | operator* (const T &lhs, const Point3DC< T > &rhs) |
| Multiply scalar with point. More...
|
|
template<class T > |
Point3DH< T > | operator* (const T &lhs, const Point3DH< T > &rhs) |
| Multiply scalar with point. More...
|
|
template<class T, class ENABLE = void>
class Cvb::Point3D< T, ENABLE >
Multi-purpose 3D vector class.
- Examples
- Cvb/CppPointCloudCreateAndHandle.
◆ Point3D() [1/3]
Creates a default point at (0, 0).
- Exceptions
-
Does | not throw any exception. |
◆ Point3D() [2/3]
Create a point from the x, y and z component.
- Parameters
-
[in] | x | Data to initialize with |
[in] | y | Data to initialize with |
[in] | z | Data to initialize with |
- Exceptions
-
Does | not throw any exception. |
◆ Point3D() [3/3]
Construct a point with an initializer list.
- Parameters
-
[in] | list | Containing exactly 3 elements. |
- Exceptions
-
Does | not throw any exception. |
◆ Length()
Gets the length of this point.
- Returns
- length of this point.
- Exceptions
-
Does | not throw any exception. |
◆ operator!=()
bool operator!= |
( |
const Point3D< T > & |
other | ) |
const |
|
inlinenoexcept |
Compares to an other point.
- Parameters
-
- Returns
- True if not equal, otherwise false.
- Exceptions
-
Does | not throw any exception. |
◆ operator*=()
Point3D< T > & operator*= |
( |
const T & |
value | ) |
|
|
inlinenoexcept |
Multiplies by a scalar and assigns to this point.
- Parameters
-
- Returns
- This point.
- Exceptions
-
Does | not throw any exception. |
◆ operator+=()
Adds and assigns to this point.
- Parameters
-
- Returns
- This point.
- Exceptions
-
Does | not throw any exception. |
◆ operator-=()
Subtracts and assigns to this point.
- Parameters
-
- Returns
- This point.
- Exceptions
-
Does | not throw any exception. |
◆ operator/=()
Point3D< T > & operator/= |
( |
const T & |
value | ) |
|
|
inlinenoexcept |
Divide by a scalar and assigns to this point.
- Parameters
-
- Returns
- This point.
- Exceptions
-
Does | not throw any exception. |
◆ operator==()
bool operator== |
( |
const Point3D< T > & |
other | ) |
const |
|
inlinenoexcept |
Compares to an other point.
- Parameters
-
- Returns
- True if equal, otherwise false.
- Exceptions
-
Does | not throw any exception. |
◆ operator[]() [1/2]
const T & operator[] |
( |
int |
index | ) |
const |
|
inlinenoexcept |
Index based element access.
- Parameters
-
[in] | index | Index of the element. |
- Returns
- A const reference to the element.
- Exceptions
-
Does | not throw any exception. |
◆ operator[]() [2/2]
T & operator[] |
( |
int |
index | ) |
|
|
inlinenoexcept |
Index based element access.
- Parameters
-
[in] | index | Index of the element. |
- Returns
- A reference to the element.
- Exceptions
-
Does | not throw any exception. |
◆ SetX()
Set the x component of the point.
- Parameters
-
- Exceptions
-
Does | not throw any exception. |
◆ SetY()
Set the y component of the point.
- Parameters
-
- Exceptions
-
Does | not throw any exception. |
◆ SetZ()
Set the z component of the point.
- Parameters
-
- Exceptions
-
Does | not throw any exception. |
◆ X()
Get the x component of the point.
- Returns
- X component.
- Exceptions
-
Does | not throw any exception. |
◆ Y()
Get the y component of the point.
- Returns
- Y component.
- Exceptions
-
Does | not throw any exception. |
◆ Z()
Get the z component of the point.
- Returns
- Z component.
- Exceptions
-
Does | not throw any exception. |
◆ get()
auto get |
( |
const Point3D< T > & |
point | ) |
-> decltype(point[I])
|
|
related |
Get's the I-th element of the Point3D<T>.
- See also
- Block, Visit
- Precondition
- I < 3
- Template Parameters
-
I | The index of the element. |
- Parameters
-
point | The Point3D<T> to retrieve the I-th element from. |
- Returns
- The I-th element of point.
◆ operator*() [1/5]
Inner product of two point vectors.
- Parameters
-
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side value. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator*() [2/5]
Multiply point with scalar.
- Parameters
-
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side value. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator*() [3/5]
Multiply scalar with point.
- Parameters
-
[in] | lhs | Right hand side value. |
[in] | rhs | Left hand side point. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator*() [4/5]
Multiply scalar with point.
- Parameters
-
[in] | lhs | Right hand side value. |
[in] | rhs | Left hand side point. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator*() [5/5]
Multiply scalar with point.
- Parameters
-
[in] | lhs | Right hand side value. |
[in] | rhs | Left hand side point. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator+()
Add two points.
- Parameters
-
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side point. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator-()
Subtracts two points.
- Parameters
-
[in] | lhs | Right hand side point. |
[in] | rhs | Left hand side point. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ operator/()
Divide point by scalar.
- Parameters
-
[in] | lhs | Right hand side matrix. |
[in] | rhs | Left hand side value. |
- Returns
- The computation result.
- Exceptions
-
Does | not throw any exception. |
◆ set()
void set |
( |
Point3D< T > & |
point, |
|
|
const T & |
val |
|
) |
| |
|
related |
Set's the value of the I-th element in the Point3D<T> point.
- See also
- Block, Visit
- Precondition
- I < 3
- Template Parameters
-
I | The index of the element. |
- Parameters
-
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. |