Loading...
Searching...
No Matches
Tuple< SIZE, T > Class Template Reference

`#include <openvdb/math/Tuple.h>`

Inheritance diagram for Tuple< SIZE, T >:

## Public Types

using | value_type = T
using | ValueType = T

## Public Member Functions

| Tuple ()=default
template<int src_size, typename src_valtype>
| Tuple (Tuple< src_size, src_valtype > const &src)
| Conversion constructor.
template<typename IdxT, typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>
T | operator[] (IdxT i) const
template<typename IdxT, typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>
T & | operator[] (IdxT i)
T | operator[] (int i) const
T & | operator[] (int i)

## Static Public Attributes

static const int | size = SIZE

## Compatibility

These are mostly for backwards compatibility with functions that take old-style Vs (which are just arrays).
T | mm [SIZE]
| Copies this tuple into an array of a compatible type.
template<typename S>
void | toV (S *v) const
| Copies this tuple into an array of a compatible type.
value_type * | asV ()
| Exposes the internal array. Be careful when using this function.
value_type const * | asV () const
| Exposes the internal array. Be careful when using this function.
std::string | str () const
void | write (std::ostream &os) const
| Copies this tuple into an array of a compatible type.
void | read (std::istream &is)
| Copies this tuple into an array of a compatible type.
bool | isNan () const
| True if a Nan is present in this tuple.
bool | isInfinite () const
| True if an Inf is present in this tuple.
bool | isFinite () const
| True if no Nan or Inf values are present.
bool | isZero () const
| True if all elements are exactly zero.

## Detailed Description

template<int SIZE, typename T>
class openvdb::v11_0::math::Tuple< SIZE, T >

A base class for homogenous tuple types

## Member Typedef Documentation

## value_type

template<int SIZE, typename T>

using value_type = T

## ValueType

template<int SIZE, typename T>

using ValueType = T

## Constructor & Destructor Documentation

## Tuple() [1/2]

template<int SIZE, typename T>

Tuple | ( |  | ) |

default

Trivial constructor, the Tuple is NOT initialized

Note
  destructor, copy constructor, assignment operator and move constructor are left to be defined by the compiler (default)

## Tuple() [2/2]

template<int SIZE, typename T>
template<int src_size, typename src_valtype>

Tuple | ( | Tuple< src_size, src_valtype > const & | src | ) |

inlineexplicit

Conversion constructor.

Tuples with different value types and different sizes can be interconverted using this member. Converting from a larger tuple results in truncation; converting from a smaller tuple results in the extra data members being zeroed out. This function assumes that the integer 0 is convertible to the tuple's value type.

## Member Function Documentation

## asV() [1/2]

template<int SIZE, typename T>

value_type * asV | ( |  | ) |

inline

Exposes the internal array. Be careful when using this function.

## asV() [2/2]

template<int SIZE, typename T>

value_type const * asV | ( |  | ) | const

inline

Exposes the internal array. Be careful when using this function.

## isFinite()

template<int SIZE, typename T>

bool isFinite | ( |  | ) | const

inline

True if no Nan or Inf values are present.

## isInfinite()

template<int SIZE, typename T>

bool isInfinite | ( |  | ) | const

inline

True if an Inf is present in this tuple.

## isNan()

template<int SIZE, typename T>

bool isNan | ( |  | ) | const

inline

True if a Nan is present in this tuple.

## isZero()

template<int SIZE, typename T>

bool isZero | ( |  | ) | const

inline

True if all elements are exactly zero.

## operator[]() [1/4]

template<int SIZE, typename T>
template<typename IdxT, typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>

T & operator[] | ( | IdxT | i | ) |

inline

## operator[]() [2/4]

template<int SIZE, typename T>
template<typename IdxT, typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>

T operator[] | ( | IdxT | i | ) | const

inline

## operator[]() [3/4]

template<int SIZE, typename T>

T & operator[] | ( | int | i | ) |

inline

## operator[]() [4/4]

template<int SIZE, typename T>

T operator[] | ( | int | i | ) | const

inline

## read()

template<int SIZE, typename T>

void read | ( | std::istream & | is | ) |

inline

Copies this tuple into an array of a compatible type.

## str()

template<int SIZE, typename T>

std::string str | ( |  | ) | const

inline

Returns
  string representation of Classname

## toV()

template<int SIZE, typename T>
template<typename S>

void toV | ( | S * | v | ) | const

inline

Copies this tuple into an array of a compatible type.

## write()

template<int SIZE, typename T>

void write | ( | std::ostream & | os | ) | const

inline

Copies this tuple into an array of a compatible type.

## Member Data Documentation

## mm

template<int SIZE, typename T>

T mm[SIZE]

protected

Copies this tuple into an array of a compatible type.

## size

template<int SIZE, typename T>

const int size = SIZE

static