OpenVDB 7.0.0

Public Types | Public Member Functions | Static Public Attributes | List of all members
Tuple< SIZE, T > Class Template Reference

`#include <Tuple.h>`

## Public Types
using | value_type = T
using | ValueType = T

## Public Member Functions
| Tuple ()
| Default ctor. Does nothing. More...
| Tuple (Tuple const &src)
| Copy constructor. Used when the class signature matches exactly. More...
Tuple & | operator= (Tuple const &src)
| Assignment operator. More...
template<int src_size, typename src_valtype >
| Tuple (Tuple< src_size, src_valtype > const &src)
| Conversion constructor. More...
T | operator[] (int i) const
T & | operator[] (int i)

## Static Public Attributes
static const int | size = SIZE

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

## Detailed Description

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

A base class for homogenous tuple types

## Member Typedef Documentation

## ◆ value_type

using value_type = T

## ◆ ValueType

using ValueType = T

## Constructor & Destructor Documentation

## ◆ Tuple() [1/3]

Tuple | ( |  | ) |
| inline

Default ctor. Does nothing.

This is required because declaring a copy (or other) constructor prevents the compiler from synthesizing a default constructor.

## ◆ Tuple() [2/3]

Tuple | ( | Tuple< SIZE, T > const & | src | ) |
| inline

Copy constructor. Used when the class signature matches exactly.

## ◆ Tuple() [3/3]

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

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]

value_type* asV | ( |  | ) |
| inline

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

## ◆ asV() [2/2]

const value_type* asV | ( |  | ) | const
| inline

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

## ◆ isFinite()

bool isFinite | ( |  | ) | const
| inline

True if no Nan or Inf values are present.

## ◆ isInfinite()

bool isInfinite | ( |  | ) | const
| inline

True if an Inf is present in this tuple.

## ◆ isNan()

bool isNan | ( |  | ) | const
| inline

True if a Nan is present in this tuple.

## ◆ isZero()

bool isZero | ( |  | ) | const
| inline

True if all elements are exactly zero.

## ◆ operator=()

Tuple& operator= | ( | Tuple< SIZE, T > const & | src | ) |
| inline

Assignment operator.

This is required because declaring a copy (or other) constructor prevents the compiler from synthesizing a default assignment operator.

## ◆ operator[]() [1/2]

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

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

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

## ◆ read()

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

Copies this tuple into an array of a compatible type.

## ◆ str()

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

Returns
  string representation of Classname

## ◆ toV()

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

Copies this tuple into an array of a compatible type.

## ◆ write()

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

Copies this tuple into an array of a compatible type.

## Member Data Documentation

## ◆ mm

T mm[SIZE]
| protected

Copies this tuple into an array of a compatible type.

## ◆ size

const int size = SIZE
| static

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

- Tuple.h