Jet  v1.3.3
Public Member Functions | Public Attributes | List of all members
jet::Point< T, 3 > Class Template Reference

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...
 
sum () const
 Returns the sum of all the components (i.e. x + y). More...
 
min () const
 Returns the minimum value among x, y, and z. More...
 
max () const
 Returns the maximum value among x, y, and z. More...
 
absmin () const
 Returns the absolute minimum value among x, y, and z. More...
 
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...
 
Pointoperator= (const std::initializer_list< T > &lst)
 Set x, y, and z components with given initializer list. More...
 
Pointoperator= (const Point &v)
 Set x, y, and z with other point pt. More...
 
Pointoperator+= (T v)
 Computes this += (v, v, v) More...
 
Pointoperator+= (const Point &v)
 Computes this += (v.x, v.y, v.z) More...
 
Pointoperator-= (T v)
 Computes this -= (v, v, v) More...
 
Pointoperator-= (const Point &v)
 Computes this -= (v.x, v.y, v.z) More...
 
Pointoperator*= (T v)
 Computes this *= (v, v, v) More...
 
Pointoperator*= (const Point &v)
 Computes this *= (v.x, v.y, v.z) More...
 
Pointoperator/= (T v)
 Computes this /= (v, v, v) More...
 
Pointoperator/= (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

x
 X (or the first) component of the point. More...
 
y
 Y (or the second) component of the point. More...
 
z
 Z (or the third) component of the point. More...
 

Detailed Description

template<typename T>
class jet::Point< T, 3 >

3-D point class.

This class defines simple 3-D point data.

Template Parameters
T- Type of the element

Constructor & Destructor Documentation

◆ Point() [1/5]

template<typename T >
constexpr jet::Point< T, 3 >::Point ( )
inlineconstexpr

Constructs default point (0, 0, 0).

◆ Point() [2/5]

template<typename T >
constexpr jet::Point< T, 3 >::Point ( x_,
y_,
z_ 
)
inlineconstexpr

Constructs point with given parameters x_, y_, and z_.

◆ Point() [3/5]

template<typename T >
constexpr jet::Point< T, 3 >::Point ( const Point2< T > &  v,
z_ 
)
inlineconstexpr

Constructs point with a 2-D point and a scalar.

◆ Point() [4/5]

template<typename T >
template<typename U >
jet::Point< T, 3 >::Point ( const std::initializer_list< U > &  lst)

Constructs point with initializer list.

◆ Point() [5/5]

template<typename T >
constexpr jet::Point< T, 3 >::Point ( const Point< T, 3 > &  v)
inlineconstexpr

Copy constructor.

Member Function Documentation

◆ absmax()

template<typename T >
T jet::Point< T, 3 >::absmax ( ) const

Returns the absolute maximum value among x, y, and z.

◆ absmin()

template<typename T >
T jet::Point< T, 3 >::absmin ( ) const

Returns the absolute minimum value among x, y, and z.

◆ add() [1/2]

template<typename T >
Point jet::Point< T, 3 >::add ( const Point< T, 3 > &  v) const

Computes this + (v.x, v.y, v.z).

◆ add() [2/2]

template<typename T >
Point jet::Point< T, 3 >::add ( v) const

Computes this + (v, v, v).

◆ at() [1/2]

template<typename T >
T& jet::Point< T, 3 >::at ( size_t  i)

Returns reference to the i -th element of the point.

◆ at() [2/2]

template<typename T >
const T& jet::Point< T, 3 >::at ( size_t  i) const

Returns const reference to the i -th element of the point.

◆ castTo()

template<typename T >
template<typename U >
Point<U, 3> jet::Point< T, 3 >::castTo ( ) const

Returns a point with different value type.

◆ div() [1/2]

template<typename T >
Point jet::Point< T, 3 >::div ( const Point< T, 3 > &  v) const

Computes this / (v.x, v.y, v.z).

◆ div() [2/2]

template<typename T >
Point jet::Point< T, 3 >::div ( v) const

Computes this / (v, v, v).

◆ dominantAxis()

template<typename T >
size_t jet::Point< T, 3 >::dominantAxis ( ) const

Returns the index of the dominant axis.

◆ iadd() [1/2]

template<typename T >
void jet::Point< T, 3 >::iadd ( const Point< T, 3 > &  v)

Computes this += (v.x, v.y, v.z).

◆ iadd() [2/2]

template<typename T >
void jet::Point< T, 3 >::iadd ( v)

Computes this += (v, v, v).

◆ idiv() [1/2]

template<typename T >
void jet::Point< T, 3 >::idiv ( const Point< T, 3 > &  v)

Computes this /= (v.x, v.y, v.z).

◆ idiv() [2/2]

template<typename T >
void jet::Point< T, 3 >::idiv ( v)

Computes this /= (v, v, v).

◆ imul() [1/2]

template<typename T >
void jet::Point< T, 3 >::imul ( const Point< T, 3 > &  v)

Computes this *= (v.x, v.y, v.z).

◆ imul() [2/2]

template<typename T >
void jet::Point< T, 3 >::imul ( v)

Computes this *= (v, v, v).

◆ isEqual()

template<typename T >
bool jet::Point< T, 3 >::isEqual ( const Point< T, 3 > &  other) const

Returns true if other is the same as this point.

◆ isub() [1/2]

template<typename T >
void jet::Point< T, 3 >::isub ( const Point< T, 3 > &  v)

Computes this -= (v.x, v.y, v.z).

◆ isub() [2/2]

template<typename T >
void jet::Point< T, 3 >::isub ( v)

Computes this -= (v, v, v).

◆ max()

template<typename T >
T jet::Point< T, 3 >::max ( ) const

Returns the maximum value among x, y, and z.

◆ min()

template<typename T >
T jet::Point< T, 3 >::min ( ) const

Returns the minimum value among x, y, and z.

◆ mul() [1/2]

template<typename T >
Point jet::Point< T, 3 >::mul ( const Point< T, 3 > &  v) const

Computes this * (v.x, v.y, v.z).

◆ mul() [2/2]

template<typename T >
Point jet::Point< T, 3 >::mul ( v) const

Computes this * (v, v, v).

◆ operator!=()

template<typename T >
bool jet::Point< T, 3 >::operator!= ( const Point< T, 3 > &  v) const

Returns true if other is the not same as this point.

◆ operator*=() [1/2]

template<typename T >
Point& jet::Point< T, 3 >::operator*= ( const Point< T, 3 > &  v)

Computes this *= (v.x, v.y, v.z)

◆ operator*=() [2/2]

template<typename T >
Point& jet::Point< T, 3 >::operator*= ( v)

Computes this *= (v, v, v)

◆ operator+=() [1/2]

template<typename T >
Point& jet::Point< T, 3 >::operator+= ( const Point< T, 3 > &  v)

Computes this += (v.x, v.y, v.z)

◆ operator+=() [2/2]

template<typename T >
Point& jet::Point< T, 3 >::operator+= ( v)

Computes this += (v, v, v)

◆ operator-=() [1/2]

template<typename T >
Point& jet::Point< T, 3 >::operator-= ( const Point< T, 3 > &  v)

Computes this -= (v.x, v.y, v.z)

◆ operator-=() [2/2]

template<typename T >
Point& jet::Point< T, 3 >::operator-= ( v)

Computes this -= (v, v, v)

◆ operator/=() [1/2]

template<typename T >
Point& jet::Point< T, 3 >::operator/= ( const Point< T, 3 > &  v)

Computes this /= (v.x, v.y, v.z)

◆ operator/=() [2/2]

template<typename T >
Point& jet::Point< T, 3 >::operator/= ( v)

Computes this /= (v, v, v)

◆ operator=() [1/2]

template<typename T >
Point& jet::Point< T, 3 >::operator= ( const Point< T, 3 > &  v)

Set x, y, and z with other point pt.

◆ operator=() [2/2]

template<typename T >
Point& jet::Point< T, 3 >::operator= ( const std::initializer_list< T > &  lst)

Set x, y, and z components with given initializer list.

◆ operator==()

template<typename T >
bool jet::Point< T, 3 >::operator== ( const Point< T, 3 > &  v) const

Returns true if other is the same as this point.

◆ operator[]() [1/2]

template<typename T >
T& jet::Point< T, 3 >::operator[] ( size_t  i)

Returns reference to the i -th element of the point.

◆ operator[]() [2/2]

template<typename T >
const T& jet::Point< T, 3 >::operator[] ( size_t  i) const

Returns const reference to the i -th element of the point.

◆ rdiv() [1/2]

template<typename T >
Point jet::Point< T, 3 >::rdiv ( const Point< T, 3 > &  v) const

Computes (v.x, v.y, v.z) / this.

◆ rdiv() [2/2]

template<typename T >
Point jet::Point< T, 3 >::rdiv ( v) const

Computes (v, v, v) / this.

◆ rsub() [1/2]

template<typename T >
Point jet::Point< T, 3 >::rsub ( const Point< T, 3 > &  v) const

Computes (v.x, v.y, v.z) - this.

◆ rsub() [2/2]

template<typename T >
Point jet::Point< T, 3 >::rsub ( v) const

Computes (v, v, v) - this.

◆ set() [1/5]

template<typename T >
void jet::Point< T, 3 >::set ( const Point< T, 3 > &  v)

Set x, y, and z with other point pt.

◆ set() [2/5]

template<typename T >
void jet::Point< T, 3 >::set ( const Point2< T > &  pt,
z 
)

Set x, y, and z components with given pt.x, pt.y, and z.

◆ set() [3/5]

template<typename T >
template<typename U >
void jet::Point< T, 3 >::set ( const std::initializer_list< U > &  lst)

Set x, y, and z components with given initializer list.

◆ set() [4/5]

template<typename T >
void jet::Point< T, 3 >::set ( s)

Set all x, y, and z components to s.

◆ set() [5/5]

template<typename T >
void jet::Point< T, 3 >::set ( x,
y,
z 
)

Set x, y, and z components with given parameters.

◆ setZero()

template<typename T >
void jet::Point< T, 3 >::setZero ( )

Set both x, y, and z to zero.

◆ sub() [1/2]

template<typename T >
Point jet::Point< T, 3 >::sub ( const Point< T, 3 > &  v) const

Computes this - (v.x, v.y, v.z).

◆ sub() [2/2]

template<typename T >
Point jet::Point< T, 3 >::sub ( v) const

Computes this - (v, v, v).

◆ subminantAxis()

template<typename T >
size_t jet::Point< T, 3 >::subminantAxis ( ) const

Returns the index of the subminant axis.

◆ sum()

template<typename T >
T jet::Point< T, 3 >::sum ( ) const

Returns the sum of all the components (i.e. x + y).

Member Data Documentation

◆ x

template<typename T >
T jet::Point< T, 3 >::x

X (or the first) component of the point.

◆ y

template<typename T >
T jet::Point< T, 3 >::y

Y (or the second) component of the point.

◆ z

template<typename T >
T jet::Point< T, 3 >::z

Z (or the third) component of the point.


The documentation for this class was generated from the following file: