VTK
9.1.0
|
templated base type for containers of constant size. More...
#include <vtkTuple.h>
Public Member Functions | |
vtkTuple ()=default | |
The default constructor does not initialize values. More... | |
vtkTuple (const T &scalar) | |
Initialize all of the tuple's elements with the supplied scalar. More... | |
vtkTuple (const T *init) | |
Initialize the tuple's elements with the elements of the supplied array. More... | |
vtkTuple (const std::array< T, Size > &values) | |
Initialize the tuple's elements using a std::array for matching type and size. More... | |
int | GetSize () const |
Get the size of the tuple. More... | |
T * | GetData () |
Get a pointer to the underlying data of the tuple. More... | |
const T * | GetData () const |
T & | operator[] (int i) |
Get a reference to the underlying data element of the tuple. More... | |
const T & | operator[] (int i) const |
T | operator() (int i) const |
Get the value of the tuple at the index specified. More... | |
bool | Compare (const vtkTuple< T, Size > &other, const T &tol) const |
Equality operator with a tolerance to allow fuzzy comparisons. More... | |
template<typename TR > | |
vtkTuple< TR, Size > | Cast () const |
Cast the tuple to the specified type, returning the result. More... | |
Protected Attributes | |
T | Data [Size] |
The only thing stored in memory! More... | |
templated base type for containers of constant size.
This class is a templated data type for storing and manipulating tuples.
Definition at line 37 of file vtkTuple.h.
|
default |
The default constructor does not initialize values.
If initializtion is desired, this should be done explicitly using the constructors for scalar initialization, or other suitable constructors taking arguments.
|
inlineexplicit |
Initialize all of the tuple's elements with the supplied scalar.
Definition at line 50 of file vtkTuple.h.
|
inlineexplicit |
Initialize the tuple's elements with the elements of the supplied array.
Note that the supplied pointer must contain at least as many elements as the tuple, or it will result in access to out of bounds memory.
Definition at line 63 of file vtkTuple.h.
|
inlineexplicit |
Initialize the tuple's elements using a std::array
for matching type and size.
Example usage: vtkTuple<double, 2 >({0.1, 0.2})
.
Definition at line 75 of file vtkTuple.h.
|
inline |
Get the size of the tuple.
Definition at line 83 of file vtkTuple.h.
|
inline |
Get a pointer to the underlying data of the tuple.
Definition at line 88 of file vtkTuple.h.
|
inline |
Definition at line 89 of file vtkTuple.h.
|
inline |
Get a reference to the underlying data element of the tuple.
This works similarly to the way C++ STL containers work. No bounds checking is performed.
Definition at line 96 of file vtkTuple.h.
|
inline |
Definition at line 97 of file vtkTuple.h.
|
inline |
Get the value of the tuple at the index specified.
Does bounds checking, similar to the at(i) method of C++ STL containers, but only when the code is compiled in debug mode.
Definition at line 105 of file vtkTuple.h.
|
inline |
Equality operator with a tolerance to allow fuzzy comparisons.
Definition at line 116 of file vtkTuple.h.
|
inline |
Cast the tuple to the specified type, returning the result.
Definition at line 138 of file vtkTuple.h.
|
protected |
The only thing stored in memory!
Definition at line 154 of file vtkTuple.h.