Jet  v1.3.3
Public Member Functions | Public Attributes | List of all members
jet::Size3 Class Reference

3-D size class. More...

#include <jet/size3.h>

Public Member Functions

constexpr Size3 ()
 Constructs default size (0, 0, 0). More...
 
constexpr Size3 (size_t x_, size_t y_, size_t z_)
 Constructs size with given parameters x_, y_, and z_. More...
 
constexpr Size3 (const Size2 &v, size_t z_)
 Constructs size with a 2-D size and a scalar. More...
 
template<typename U >
 Size3 (const std::initializer_list< U > &lst)
 Constructs size with initializer list. More...
 
constexpr Size3 (const Size3 &v)
 Copy constructor. More...
 
void set (size_t s)
 Set all x, y, and z components to s. More...
 
void set (size_t x, size_t y, size_t z)
 Set x, y, and z components with given parameters. More...
 
void set (const Size2 &sz, size_t z)
 Set x, y, and z components with given sz.x, sz.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 Size3 &v)
 Set x, y, and z with other size pt. More...
 
void setZero ()
 Set both x, y, and z to zero. More...
 
Size3 add (size_t v) const
 Computes this + (v, v, v). More...
 
Size3 add (const Size3 &v) const
 Computes this + (v.x, v.y, v.z). More...
 
Size3 sub (size_t v) const
 Computes this - (v, v, v). More...
 
Size3 sub (const Size3 &v) const
 Computes this - (v.x, v.y, v.z). More...
 
Size3 mul (size_t v) const
 Computes this * (v, v, v). More...
 
Size3 mul (const Size3 &v) const
 Computes this * (v.x, v.y, v.z). More...
 
Size3 div (size_t v) const
 Computes this / (v, v, v). More...
 
Size3 div (const Size3 &v) const
 Computes this / (v.x, v.y, v.z). More...
 
Size3 rsub (size_t v) const
 Computes (v, v, v) - this. More...
 
Size3 rsub (const Size3 &v) const
 Computes (v.x, v.y, v.z) - this. More...
 
Size3 rdiv (size_t v) const
 Computes (v, v, v) / this. More...
 
Size3 rdiv (const Size3 &v) const
 Computes (v.x, v.y, v.z) / this. More...
 
void iadd (size_t v)
 Computes this += (v, v, v). More...
 
void iadd (const Size3 &v)
 Computes this += (v.x, v.y, v.z). More...
 
void isub (size_t v)
 Computes this -= (v, v, v). More...
 
void isub (const Size3 &v)
 Computes this -= (v.x, v.y, v.z). More...
 
void imul (size_t v)
 Computes this *= (v, v, v). More...
 
void imul (const Size3 &v)
 Computes this *= (v.x, v.y, v.z). More...
 
void idiv (size_t v)
 Computes this /= (v, v, v). More...
 
void idiv (const Size3 &v)
 Computes this /= (v.x, v.y, v.z). More...
 
const size_t & at (size_t i) const
 Returns const reference to the i -th element of the size. More...
 
size_t & at (size_t i)
 Returns reference to the i -th element of the size. More...
 
size_t sum () const
 Returns the sum of all the components (i.e. x + y). More...
 
size_t min () const
 Returns the minimum value among x, y, and z. More...
 
size_t max () const
 Returns the maximum value among x, y, and z. More...
 
size_t absmin () const
 Returns the absolute minimum value among x, y, and z. More...
 
size_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...
 
bool isEqual (const Size3 &other) const
 Returns true if other is the same as this size. More...
 
size_t & operator[] (size_t i)
 Returns reference to the i -th element of the size. More...
 
const size_t & operator[] (size_t i) const
 Returns const reference to the i -th element of the size. More...
 
template<typename U >
Size3operator= (const std::initializer_list< U > &lst)
 Set x, y, and z components with given initializer list. More...
 
Size3operator= (const Size3 &v)
 Set x, y, and z with other size pt. More...
 
Size3operator+= (size_t v)
 Computes this += (v, v, v) More...
 
Size3operator+= (const Size3 &v)
 Computes this += (v.x, v.y, v.z) More...
 
Size3operator-= (size_t v)
 Computes this -= (v, v, v) More...
 
Size3operator-= (const Size3 &v)
 Computes this -= (v.x, v.y, v.z) More...
 
Size3operator*= (size_t v)
 Computes this *= (v, v, v) More...
 
Size3operator*= (const Size3 &v)
 Computes this *= (v.x, v.y, v.z) More...
 
Size3operator/= (size_t v)
 Computes this /= (v, v, v) More...
 
Size3operator/= (const Size3 &v)
 Computes this /= (v.x, v.y, v.z) More...
 
bool operator== (const Size3 &v) const
 Returns true if other is the same as this size. More...
 
bool operator!= (const Size3 &v) const
 Returns true if other is the not same as this size. More...
 

Public Attributes

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

Detailed Description

3-D size class.

This class defines simple 3-D size data.

Constructor & Destructor Documentation

◆ Size3() [1/5]

constexpr jet::Size3::Size3 ( )
inlineconstexpr

Constructs default size (0, 0, 0).

◆ Size3() [2/5]

constexpr jet::Size3::Size3 ( size_t  x_,
size_t  y_,
size_t  z_ 
)
inlineconstexpr

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

◆ Size3() [3/5]

constexpr jet::Size3::Size3 ( const Size2 v,
size_t  z_ 
)
inlineconstexpr

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

◆ Size3() [4/5]

template<typename U >
jet::Size3::Size3 ( const std::initializer_list< U > &  lst)

Constructs size with initializer list.

◆ Size3() [5/5]

constexpr jet::Size3::Size3 ( const Size3 v)
inlineconstexpr

Copy constructor.

Member Function Documentation

◆ absmax()

size_t jet::Size3::absmax ( ) const

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

◆ absmin()

size_t jet::Size3::absmin ( ) const

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

◆ add() [1/2]

Size3 jet::Size3::add ( const Size3 v) const

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

◆ add() [2/2]

Size3 jet::Size3::add ( size_t  v) const

Computes this + (v, v, v).

◆ at() [1/2]

size_t& jet::Size3::at ( size_t  i)

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

◆ at() [2/2]

const size_t& jet::Size3::at ( size_t  i) const

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

◆ div() [1/2]

Size3 jet::Size3::div ( const Size3 v) const

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

◆ div() [2/2]

Size3 jet::Size3::div ( size_t  v) const

Computes this / (v, v, v).

◆ dominantAxis()

size_t jet::Size3::dominantAxis ( ) const

Returns the index of the dominant axis.

◆ iadd() [1/2]

void jet::Size3::iadd ( const Size3 v)

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

◆ iadd() [2/2]

void jet::Size3::iadd ( size_t  v)

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

◆ idiv() [1/2]

void jet::Size3::idiv ( const Size3 v)

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

◆ idiv() [2/2]

void jet::Size3::idiv ( size_t  v)

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

◆ imul() [1/2]

void jet::Size3::imul ( const Size3 v)

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

◆ imul() [2/2]

void jet::Size3::imul ( size_t  v)

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

◆ isEqual()

bool jet::Size3::isEqual ( const Size3 other) const

Returns true if other is the same as this size.

◆ isub() [1/2]

void jet::Size3::isub ( const Size3 v)

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

◆ isub() [2/2]

void jet::Size3::isub ( size_t  v)

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

◆ max()

size_t jet::Size3::max ( ) const

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

◆ min()

size_t jet::Size3::min ( ) const

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

◆ mul() [1/2]

Size3 jet::Size3::mul ( const Size3 v) const

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

◆ mul() [2/2]

Size3 jet::Size3::mul ( size_t  v) const

Computes this * (v, v, v).

◆ operator!=()

bool jet::Size3::operator!= ( const Size3 v) const

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

◆ operator*=() [1/2]

Size3& jet::Size3::operator*= ( const Size3 v)

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

◆ operator*=() [2/2]

Size3& jet::Size3::operator*= ( size_t  v)

Computes this *= (v, v, v)

◆ operator+=() [1/2]

Size3& jet::Size3::operator+= ( const Size3 v)

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

◆ operator+=() [2/2]

Size3& jet::Size3::operator+= ( size_t  v)

Computes this += (v, v, v)

◆ operator-=() [1/2]

Size3& jet::Size3::operator-= ( const Size3 v)

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

◆ operator-=() [2/2]

Size3& jet::Size3::operator-= ( size_t  v)

Computes this -= (v, v, v)

◆ operator/=() [1/2]

Size3& jet::Size3::operator/= ( const Size3 v)

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

◆ operator/=() [2/2]

Size3& jet::Size3::operator/= ( size_t  v)

Computes this /= (v, v, v)

◆ operator=() [1/2]

Size3& jet::Size3::operator= ( const Size3 v)

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

◆ operator=() [2/2]

template<typename U >
Size3& jet::Size3::operator= ( const std::initializer_list< U > &  lst)

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

◆ operator==()

bool jet::Size3::operator== ( const Size3 v) const

Returns true if other is the same as this size.

◆ operator[]() [1/2]

size_t& jet::Size3::operator[] ( size_t  i)

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

◆ operator[]() [2/2]

const size_t& jet::Size3::operator[] ( size_t  i) const

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

◆ rdiv() [1/2]

Size3 jet::Size3::rdiv ( const Size3 v) const

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

◆ rdiv() [2/2]

Size3 jet::Size3::rdiv ( size_t  v) const

Computes (v, v, v) / this.

◆ rsub() [1/2]

Size3 jet::Size3::rsub ( const Size3 v) const

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

◆ rsub() [2/2]

Size3 jet::Size3::rsub ( size_t  v) const

Computes (v, v, v) - this.

◆ set() [1/5]

void jet::Size3::set ( const Size2 sz,
size_t  z 
)

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

◆ set() [2/5]

void jet::Size3::set ( const Size3 v)

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

◆ set() [3/5]

template<typename U >
void jet::Size3::set ( const std::initializer_list< U > &  lst)

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

◆ set() [4/5]

void jet::Size3::set ( size_t  s)

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

◆ set() [5/5]

void jet::Size3::set ( size_t  x,
size_t  y,
size_t  z 
)

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

◆ setZero()

void jet::Size3::setZero ( )

Set both x, y, and z to zero.

◆ sub() [1/2]

Size3 jet::Size3::sub ( const Size3 v) const

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

◆ sub() [2/2]

Size3 jet::Size3::sub ( size_t  v) const

Computes this - (v, v, v).

◆ subminantAxis()

size_t jet::Size3::subminantAxis ( ) const

Returns the index of the subminant axis.

◆ sum()

size_t jet::Size3::sum ( ) const

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

Member Data Documentation

◆ x

size_t jet::Size3::x

X (or the first) component of the size.

◆ y

size_t jet::Size3::y

Y (or the second) component of the size.

◆ z

size_t jet::Size3::z

Z (or the third) component of the size.


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