|
Jet
v1.3.3
|
3-D point class. More...
#include <jet/point3.h>
Public Member Functions | |
| constexpr | Point () |
| Constructs default point (0, 0, 0). More... | |
| constexpr | Point (T x_, T y_, T z_) |
Constructs point with given parameters x_, y_, and z_. More... | |
| constexpr | Point (const Point2< T > &v, T z_) |
| Constructs point with a 2-D point and a scalar. More... | |
| template<typename U > | |
| Point (const std::initializer_list< U > &lst) | |
| Constructs point with initializer list. More... | |
| constexpr | Point (const Point &v) |
| Copy constructor. More... | |
| void | set (T s) |
Set all x, y, and z components to s. More... | |
| void | set (T x, T y, T z) |
| Set x, y, and z components with given parameters. More... | |
| void | set (const Point2< T > &pt, T z) |
Set x, y, and z components with given pt.x, pt.y, and z. More... | |
| template<typename U > | |
| void | set (const std::initializer_list< U > &lst) |
| Set x, y, and z components with given initializer list. More... | |
| void | set (const Point &v) |
Set x, y, and z with other point pt. More... | |
| void | setZero () |
| Set both x, y, and z to zero. More... | |
| Point | add (T v) const |
| Computes this + (v, v, v). More... | |
| Point | add (const Point &v) const |
| Computes this + (v.x, v.y, v.z). More... | |
| Point | sub (T v) const |
| Computes this - (v, v, v). More... | |
| Point | sub (const Point &v) const |
| Computes this - (v.x, v.y, v.z). More... | |
| Point | mul (T v) const |
| Computes this * (v, v, v). More... | |
| Point | mul (const Point &v) const |
| Computes this * (v.x, v.y, v.z). More... | |
| Point | div (T v) const |
| Computes this / (v, v, v). More... | |
| Point | div (const Point &v) const |
| Computes this / (v.x, v.y, v.z). More... | |
| Point | rsub (T v) const |
| Computes (v, v, v) - this. More... | |
| Point | rsub (const Point &v) const |
| Computes (v.x, v.y, v.z) - this. More... | |
| Point | rdiv (T v) const |
| Computes (v, v, v) / this. More... | |
| Point | rdiv (const Point &v) const |
| Computes (v.x, v.y, v.z) / this. More... | |
| void | iadd (T v) |
| Computes this += (v, v, v). More... | |
| void | iadd (const Point &v) |
| Computes this += (v.x, v.y, v.z). More... | |
| void | isub (T v) |
| Computes this -= (v, v, v). More... | |
| void | isub (const Point &v) |
| Computes this -= (v.x, v.y, v.z). More... | |
| void | imul (T v) |
| Computes this *= (v, v, v). More... | |
| void | imul (const Point &v) |
| Computes this *= (v.x, v.y, v.z). More... | |
| void | idiv (T v) |
| Computes this /= (v, v, v). More... | |
| void | idiv (const Point &v) |
| Computes this /= (v.x, v.y, v.z). More... | |
| const T & | at (size_t i) const |
Returns const reference to the i -th element of the point. More... | |
| T & | at (size_t i) |
Returns reference to the i -th element of the point. More... | |
| T | sum () const |
| Returns the sum of all the components (i.e. x + y). More... | |
| T | min () const |
| Returns the minimum value among x, y, and z. More... | |
| T | max () const |
| Returns the maximum value among x, y, and z. More... | |
| T | absmin () const |
| Returns the absolute minimum value among x, y, and z. More... | |
| T | absmax () const |
| Returns the absolute maximum value among x, y, and z. More... | |
| size_t | dominantAxis () const |
| Returns the index of the dominant axis. More... | |
| size_t | subminantAxis () const |
| Returns the index of the subminant axis. More... | |
| template<typename U > | |
| Point< U, 3 > | castTo () const |
| Returns a point with different value type. More... | |
| bool | isEqual (const Point &other) const |
Returns true if other is the same as this point. More... | |
| T & | operator[] (size_t i) |
Returns reference to the i -th element of the point. More... | |
| const T & | operator[] (size_t i) const |
Returns const reference to the i -th element of the point. More... | |
| Point & | operator= (const std::initializer_list< T > &lst) |
| Set x, y, and z components with given initializer list. More... | |
| Point & | operator= (const Point &v) |
Set x, y, and z with other point pt. More... | |
| Point & | operator+= (T v) |
| Computes this += (v, v, v) More... | |
| Point & | operator+= (const Point &v) |
| Computes this += (v.x, v.y, v.z) More... | |
| Point & | operator-= (T v) |
| Computes this -= (v, v, v) More... | |
| Point & | operator-= (const Point &v) |
| Computes this -= (v.x, v.y, v.z) More... | |
| Point & | operator*= (T v) |
| Computes this *= (v, v, v) More... | |
| Point & | operator*= (const Point &v) |
| Computes this *= (v.x, v.y, v.z) More... | |
| Point & | operator/= (T v) |
| Computes this /= (v, v, v) More... | |
| Point & | operator/= (const Point &v) |
| Computes this /= (v.x, v.y, v.z) More... | |
| bool | operator== (const Point &v) const |
Returns true if other is the same as this point. More... | |
| bool | operator!= (const Point &v) const |
Returns true if other is the not same as this point. More... | |
Public Attributes | |
| T | x |
| X (or the first) component of the point. More... | |
| T | y |
| Y (or the second) component of the point. More... | |
| T | z |
| Z (or the third) component of the point. More... | |
3-D point class.
This class defines simple 3-D point data.
| T | - Type of the element |
|
inlineconstexpr |
Constructs default point (0, 0, 0).
|
inlineconstexpr |
Constructs point with given parameters x_, y_, and z_.
|
inlineconstexpr |
Constructs point with a 2-D point and a scalar.
| jet::Point< T, 3 >::Point | ( | const std::initializer_list< U > & | lst | ) |
Constructs point with initializer list.
|
inlineconstexpr |
Copy constructor.
| T jet::Point< T, 3 >::absmax | ( | ) | const |
Returns the absolute maximum value among x, y, and z.
| T jet::Point< T, 3 >::absmin | ( | ) | const |
Returns the absolute minimum value among x, y, and z.
| Point jet::Point< T, 3 >::add | ( | const Point< T, 3 > & | v | ) | const |
Computes this + (v.x, v.y, v.z).
| Point jet::Point< T, 3 >::add | ( | T | v | ) | const |
Computes this + (v, v, v).
| T& jet::Point< T, 3 >::at | ( | size_t | i | ) |
Returns reference to the i -th element of the point.
| const T& jet::Point< T, 3 >::at | ( | size_t | i | ) | const |
Returns const reference to the i -th element of the point.
Returns a point with different value type.
| Point jet::Point< T, 3 >::div | ( | const Point< T, 3 > & | v | ) | const |
Computes this / (v.x, v.y, v.z).
| Point jet::Point< T, 3 >::div | ( | T | v | ) | const |
Computes this / (v, v, v).
| size_t jet::Point< T, 3 >::dominantAxis | ( | ) | const |
Returns the index of the dominant axis.
| void jet::Point< T, 3 >::iadd | ( | const Point< T, 3 > & | v | ) |
Computes this += (v.x, v.y, v.z).
| void jet::Point< T, 3 >::iadd | ( | T | v | ) |
Computes this += (v, v, v).
| void jet::Point< T, 3 >::idiv | ( | const Point< T, 3 > & | v | ) |
Computes this /= (v.x, v.y, v.z).
| void jet::Point< T, 3 >::idiv | ( | T | v | ) |
Computes this /= (v, v, v).
| void jet::Point< T, 3 >::imul | ( | const Point< T, 3 > & | v | ) |
Computes this *= (v.x, v.y, v.z).
| void jet::Point< T, 3 >::imul | ( | T | v | ) |
Computes this *= (v, v, v).
| bool jet::Point< T, 3 >::isEqual | ( | const Point< T, 3 > & | other | ) | const |
Returns true if other is the same as this point.
| void jet::Point< T, 3 >::isub | ( | const Point< T, 3 > & | v | ) |
Computes this -= (v.x, v.y, v.z).
| void jet::Point< T, 3 >::isub | ( | T | v | ) |
Computes this -= (v, v, v).
| T jet::Point< T, 3 >::max | ( | ) | const |
Returns the maximum value among x, y, and z.
| T jet::Point< T, 3 >::min | ( | ) | const |
Returns the minimum value among x, y, and z.
| Point jet::Point< T, 3 >::mul | ( | const Point< T, 3 > & | v | ) | const |
Computes this * (v.x, v.y, v.z).
| Point jet::Point< T, 3 >::mul | ( | T | v | ) | const |
Computes this * (v, v, v).
| bool jet::Point< T, 3 >::operator!= | ( | const Point< T, 3 > & | v | ) | const |
Returns true if other is the not same as this point.
| Point& jet::Point< T, 3 >::operator*= | ( | const Point< T, 3 > & | v | ) |
Computes this *= (v.x, v.y, v.z)
| Point& jet::Point< T, 3 >::operator*= | ( | T | v | ) |
Computes this *= (v, v, v)
| Point& jet::Point< T, 3 >::operator+= | ( | const Point< T, 3 > & | v | ) |
Computes this += (v.x, v.y, v.z)
| Point& jet::Point< T, 3 >::operator+= | ( | T | v | ) |
Computes this += (v, v, v)
| Point& jet::Point< T, 3 >::operator-= | ( | const Point< T, 3 > & | v | ) |
Computes this -= (v.x, v.y, v.z)
| Point& jet::Point< T, 3 >::operator-= | ( | T | v | ) |
Computes this -= (v, v, v)
| Point& jet::Point< T, 3 >::operator/= | ( | const Point< T, 3 > & | v | ) |
Computes this /= (v.x, v.y, v.z)
| Point& jet::Point< T, 3 >::operator/= | ( | T | v | ) |
Computes this /= (v, v, v)
| Point& jet::Point< T, 3 >::operator= | ( | const Point< T, 3 > & | v | ) |
Set x, y, and z with other point pt.
| Point& jet::Point< T, 3 >::operator= | ( | const std::initializer_list< T > & | lst | ) |
Set x, y, and z components with given initializer list.
| bool jet::Point< T, 3 >::operator== | ( | const Point< T, 3 > & | v | ) | const |
Returns true if other is the same as this point.
| T& jet::Point< T, 3 >::operator[] | ( | size_t | i | ) |
Returns reference to the i -th element of the point.
| const T& jet::Point< T, 3 >::operator[] | ( | size_t | i | ) | const |
Returns const reference to the i -th element of the point.
| Point jet::Point< T, 3 >::rdiv | ( | const Point< T, 3 > & | v | ) | const |
Computes (v.x, v.y, v.z) / this.
| Point jet::Point< T, 3 >::rdiv | ( | T | v | ) | const |
Computes (v, v, v) / this.
| Point jet::Point< T, 3 >::rsub | ( | const Point< T, 3 > & | v | ) | const |
Computes (v.x, v.y, v.z) - this.
| Point jet::Point< T, 3 >::rsub | ( | T | v | ) | const |
Computes (v, v, v) - this.
| void jet::Point< T, 3 >::set | ( | const Point< T, 3 > & | v | ) |
Set x, y, and z with other point pt.
| void jet::Point< T, 3 >::set | ( | const Point2< T > & | pt, |
| T | z | ||
| ) |
Set x, y, and z components with given pt.x, pt.y, and z.
| void jet::Point< T, 3 >::set | ( | const std::initializer_list< U > & | lst | ) |
Set x, y, and z components with given initializer list.
| void jet::Point< T, 3 >::set | ( | T | s | ) |
Set all x, y, and z components to s.
| void jet::Point< T, 3 >::set | ( | T | x, |
| T | y, | ||
| T | z | ||
| ) |
Set x, y, and z components with given parameters.
| void jet::Point< T, 3 >::setZero | ( | ) |
Set both x, y, and z to zero.
| Point jet::Point< T, 3 >::sub | ( | const Point< T, 3 > & | v | ) | const |
Computes this - (v.x, v.y, v.z).
| Point jet::Point< T, 3 >::sub | ( | T | v | ) | const |
Computes this - (v, v, v).
| size_t jet::Point< T, 3 >::subminantAxis | ( | ) | const |
Returns the index of the subminant axis.
| T jet::Point< T, 3 >::sum | ( | ) | const |
Returns the sum of all the components (i.e. x + y).
| T jet::Point< T, 3 >::x |
X (or the first) component of the point.
| T jet::Point< T, 3 >::y |
Y (or the second) component of the point.
| T jet::Point< T, 3 >::z |
Z (or the third) component of the point.
1.8.18