VTK
Public Types | Public Member Functions | Protected Member Functions
vtkTypedArray< T > Class Template Reference

Provides a type-specific interface to N-way arrays. More...

#include <vtkTypedArray.h>

Inheritance diagram for vtkTypedArray< T >:
Inheritance graph
[legend]
Collaboration diagram for vtkTypedArray< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkArray::CoordinateT CoordinateT
typedef vtkArray::SizeT SizeT

Public Member Functions

void PrintSelf (ostream &os, vtkIndent indent)
virtual vtkVariant GetVariantValue (const vtkArrayCoordinates &coordinates)
virtual vtkVariant GetVariantValueN (const SizeT n)
virtual void SetVariantValue (const vtkArrayCoordinates &coordinates, const vtkVariant &value)
virtual void SetVariantValueN (const SizeT n, const vtkVariant &value)
virtual void CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const vtkArrayCoordinates &target_coordinates)
virtual void CopyValue (vtkArray *source, const SizeT source_index, const vtkArrayCoordinates &target_coordinates)
virtual void CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const SizeT target_index)
virtual const T & GetValueN (const SizeT n)=0
virtual void SetValueN (const SizeT n, const T &value)=0
virtual const T & GetValue (CoordinateT i)=0
virtual const T & GetValue (CoordinateT i, CoordinateT j)=0
virtual const T & GetValue (CoordinateT i, CoordinateT j, CoordinateT k)=0
virtual const T & GetValue (const vtkArrayCoordinates &coordinates)=0
virtual void SetValue (CoordinateT i, const T &value)=0
virtual void SetValue (CoordinateT i, CoordinateT j, const T &value)=0
virtual void SetValue (CoordinateT i, CoordinateT j, CoordinateT k, const T &value)=0
virtual void SetValue (const vtkArrayCoordinates &coordinates, const T &value)=0

Protected Member Functions

 vtkTypedArray ()
 ~vtkTypedArray ()

Detailed Description

template<typename T>
class vtkTypedArray< T >

Provides a type-specific interface to N-way arrays.

vtkTypedArray provides an interface for retrieving and updating data in an arbitrary-dimension array. It derives from vtkArray and is templated on the type of value stored in the array.

Methods are provided for retrieving and updating array values based either on their array coordinates, or on a 1-dimensional integer index. The latter approach can be used to iterate over the values in an array in arbitrary order, which is useful when writing filters that operate efficiently on sparse arrays and arrays that can have any number of dimensions.

Special overloaded methods provide simple access for arrays with one, two, or three dimensions.

See also:
vtkArray, vtkDenseArray, vtkSparseArray
Thanks:
Developed by Timothy M. Shead (tshea.nosp@m.d@sa.nosp@m.ndia..nosp@m.gov) at Sandia National Laboratories.
Tests:
vtkTypedArray (Tests)

Definition at line 58 of file vtkTypedArray.h.


Member Typedef Documentation

template<typename T>
typedef vtkArray::CoordinateT vtkTypedArray< T >::CoordinateT

Reimplemented from vtkArray.

Reimplemented in vtkSparseArray< T >, and vtkDenseArray< T >.

Definition at line 61 of file vtkTypedArray.h.

template<typename T>
typedef vtkArray::SizeT vtkTypedArray< T >::SizeT

Reimplemented from vtkArray.

Reimplemented in vtkSparseArray< T >, and vtkDenseArray< T >.

Definition at line 62 of file vtkTypedArray.h.


Constructor & Destructor Documentation

template<typename T>
vtkTypedArray< T >::vtkTypedArray ( ) [inline, protected]

Definition at line 122 of file vtkTypedArray.h.

template<typename T>
vtkTypedArray< T >::~vtkTypedArray ( ) [inline, protected]

Definition at line 123 of file vtkTypedArray.h.


Member Function Documentation

template<typename T>
void vtkTypedArray< T >::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkArray.

Reimplemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual vtkVariant vtkTypedArray< T >::GetVariantValue ( const vtkArrayCoordinates coordinates) [virtual]

Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implements vtkArray.

template<typename T>
virtual vtkVariant vtkTypedArray< T >::GetVariantValueN ( const SizeT  n) [virtual]

Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). This is useful for efficiently visiting every value in the array. Note that the order in which values are visited is undefined, but is guaranteed to match the order used by vtkArray::GetCoordinatesN().

Implements vtkArray.

template<typename T>
virtual void vtkTypedArray< T >::SetVariantValue ( const vtkArrayCoordinates coordinates,
const vtkVariant value 
) [virtual]

Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implements vtkArray.

template<typename T>
virtual void vtkTypedArray< T >::SetVariantValueN ( const SizeT  n,
const vtkVariant value 
) [virtual]

Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). This is useful for efficiently visiting every value in the array. Note that the order in which values are visited is undefined, but is guaranteed to match the order used by vtkArray::GetCoordinatesN().

Implements vtkArray.

template<typename T>
virtual void vtkTypedArray< T >::CopyValue ( vtkArray source,
const vtkArrayCoordinates source_coordinates,
const vtkArrayCoordinates target_coordinates 
) [virtual]

Overwrites a value with a value retrieved from another array. Both arrays must store the same data types.

Implements vtkArray.

template<typename T>
virtual void vtkTypedArray< T >::CopyValue ( vtkArray source,
const SizeT  source_index,
const vtkArrayCoordinates target_coordinates 
) [virtual]

Overwrites a value with a value retrieved from another array. Both arrays must store the same data types.

Implements vtkArray.

template<typename T>
virtual void vtkTypedArray< T >::CopyValue ( vtkArray source,
const vtkArrayCoordinates source_coordinates,
const SizeT  target_index 
) [virtual]

Overwrites a value with a value retrieved from another array. Both arrays must store the same data types.

Implements vtkArray.

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( CoordinateT  i) [pure virtual]

Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( CoordinateT  i,
CoordinateT  j 
) [pure virtual]

Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k 
) [pure virtual]

Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( const vtkArrayCoordinates coordinates) [pure virtual]

Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual const T& vtkTypedArray< T >::GetValueN ( const SizeT  n) [pure virtual]

Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). This is useful for efficiently visiting every value in the array. Note that the order in which values are visited is undefined, but is guaranteed to match the order used by vtkArray::GetCoordinatesN().

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( CoordinateT  i,
const T &  value 
) [pure virtual]

Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( CoordinateT  i,
CoordinateT  j,
const T &  value 
) [pure virtual]

Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k,
const T &  value 
) [pure virtual]

Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( const vtkArrayCoordinates coordinates,
const T &  value 
) [pure virtual]

Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.

template<typename T>
virtual void vtkTypedArray< T >::SetValueN ( const SizeT  n,
const T &  value 
) [pure virtual]

Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). This is useful for efficiently visiting every value in the array. Note that the order in which values are visited is undefined, but is guaranteed to match the order used by vtkArray::GetCoordinatesN().

Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.


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