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