VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkTypedDataArray< Scalar > Class Template Reference

Extend vtkDataArray with abstract type-specific API. More...

#include <vtkTypedDataArray.h>

Inheritance diagram for vtkTypedDataArray< Scalar >:
Inheritance graph
[legend]
Collaboration diagram for vtkTypedDataArray< Scalar >:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { VTK_DATA_TYPE = vtkTypeTraits<ValueType>::VTK_TYPE_ID }
typedef Scalar ValueType
typedef
vtkTypedDataArrayIterator
< ValueType
Iterator

Public Member Functions

Iterator Begin ()
Iterator End ()
int GetDataType ()
int GetDataTypeSize ()
virtual void SetNumberOfValues (vtkIdType num)
virtual void SetTupleValue (vtkIdType i, const ValueType *t)=0
virtual void InsertTupleValue (vtkIdType i, const ValueType *t)=0
virtual vtkIdType InsertNextTupleValue (const ValueType *t)=0
virtual ValueType GetValue (vtkIdType idx)=0
virtual ValueTypeGetValueReference (vtkIdType idx)=0
virtual void SetValue (vtkIdType idx, ValueType value)=0
virtual void GetTupleValue (vtkIdType idx, ValueType *t)=0
virtual vtkIdType InsertNextValue (ValueType v)=0
virtual void InsertValue (vtkIdType idx, ValueType v)=0
virtual int GetArrayType ()
virtual vtkIdType LookupTypedValue (ValueType value)=0
virtual void LookupTypedValue (ValueType value, vtkIdList *ids)=0

Static Public Member Functions

static vtkTypedDataArray
< Scalar > * 
FastDownCast (vtkAbstractArray *source)

Protected Member Functions

 vtkTypedDataArray ()
 ~vtkTypedDataArray ()

Detailed Description

template<class Scalar>
class vtkTypedDataArray< Scalar >

Extend vtkDataArray with abstract type-specific API.

This templated class decorates vtkDataArray with additional type-specific methods that can be used to interact with the data.

Warning:
This class uses vtkTypeTraits to implement GetDataType(). Since vtkIdType is a typedef for either a 32- or 64-bit integer, subclasses that are designed to hold vtkIdTypes will, by default, return an incorrect value from GetDataType(). To fix this, such subclasses should override GetDataType() to return VTK_ID_TYPE.
Tests:
vtkTypedDataArray (Tests)

Definition at line 45 of file vtkTypedDataArray.h.


Member Typedef Documentation

template<class Scalar>
typedef Scalar vtkTypedDataArray< Scalar >::ValueType

Typedef to get the type of value stored in the array.

Reimplemented in vtkMappedDataArray< Scalar >, and vtkDataArrayTemplate< T >.

Definition at line 50 of file vtkTypedDataArray.h.

template<class Scalar>
typedef vtkTypedDataArrayIterator<ValueType> vtkTypedDataArray< Scalar >::Iterator

Typedef to a suitable iterator class. Rather than using this member directly, consider using vtkDataArrayIteratorMacro for safety and efficiency.

Reimplemented in vtkDataArrayTemplate< T >.

Definition at line 55 of file vtkTypedDataArray.h.


Member Enumeration Documentation

template<class Scalar>
anonymous enum

Compile time access to the VTK type identifier.

Enumerator:
VTK_DATA_TYPE 

Definition at line 68 of file vtkTypedDataArray.h.


Constructor & Destructor Documentation

template<class Scalar>
vtkTypedDataArray< Scalar >::vtkTypedDataArray ( ) [protected]
template<class Scalar>
vtkTypedDataArray< Scalar >::~vtkTypedDataArray ( ) [protected]

Member Function Documentation

template<class Scalar >
vtkTypedDataArray< Scalar >::Iterator vtkTypedDataArray< Scalar >::Begin ( ) [inline]

Return an iterator initialized to the first element of the data. Rather than using this member directly, consider using vtkDataArrayIteratorMacro for safety and efficiency.

Reimplemented in vtkDataArrayTemplate< T >.

Definition at line 142 of file vtkTypedDataArray.h.

template<class Scalar >
vtkTypedDataArray< Scalar >::Iterator vtkTypedDataArray< Scalar >::End ( ) [inline]

Return an iterator initialized to first element past the end of the data. Rather than using this member directly, consider using vtkDataArrayIteratorMacro for safety and efficiency.

Reimplemented in vtkDataArrayTemplate< T >.

Definition at line 148 of file vtkTypedDataArray.h.

template<class Scalar>
static vtkTypedDataArray<Scalar>* vtkTypedDataArray< Scalar >::FastDownCast ( vtkAbstractArray source) [static]

Perform a fast, safe cast from a vtkAbstractArray to a vtkTypedDataArray. This method checks if: - source->GetArrayType() is appropriate, and - source->GetDataType() matches the Scalar template argument if these conditions are met, the method performs a static_cast to return source as a vtkTypedDataArray pointer. Otherwise, NULL is returned.

Reimplemented from vtkDataArray.

Reimplemented in vtkDataArrayTemplate< T >, and vtkMappedDataArray< Scalar >.

template<class Scalar>
int vtkTypedDataArray< Scalar >::GetDataType ( ) [virtual]

Return the VTK data type held by this array.

Implements vtkAbstractArray.

template<class Scalar>
int vtkTypedDataArray< Scalar >::GetDataTypeSize ( ) [virtual]

Return the size of the element type in bytes.

Implements vtkAbstractArray.

Reimplemented in vtkDataArrayTemplate< T >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::SetNumberOfValues ( vtkIdType  num) [virtual]

Specify the number of values for this object to hold. Does an allocation as well as setting the MaxId ivar. Used in conjunction with SetValue() method for fast insertion.

Reimplemented in vtkDataArrayTemplate< T >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::SetTupleValue ( vtkIdType  i,
const ValueType t 
) [pure virtual]

Set the tuple value at the ith location in the array.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::InsertTupleValue ( vtkIdType  i,
const ValueType t 
) [pure virtual]

Insert (memory allocation performed) the tuple into the ith location in the array.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual vtkIdType vtkTypedDataArray< Scalar >::InsertNextTupleValue ( const ValueType t) [pure virtual]

Insert (memory allocation performed) the tuple onto the end of the array.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual vtkIdType vtkTypedDataArray< Scalar >::LookupTypedValue ( ValueType  value) [pure virtual]

Return the indices where a specific value appears.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::LookupTypedValue ( ValueType  value,
vtkIdList ids 
) [pure virtual]

Return the indices where a specific value appears.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual ValueType vtkTypedDataArray< Scalar >::GetValue ( vtkIdType  idx) [pure virtual]
template<class Scalar>
virtual ValueType& vtkTypedDataArray< Scalar >::GetValueReference ( vtkIdType  idx) [pure virtual]

Get a reference to the scalar value at a particular index.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::SetValue ( vtkIdType  idx,
ValueType  value 
) [pure virtual]

Set the data at a particular index. Does not do range checking. Make sure you use the method SetNumberOfValues() before inserting data.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::GetTupleValue ( vtkIdType  idx,
ValueType t 
) [pure virtual]
template<class Scalar>
virtual vtkIdType vtkTypedDataArray< Scalar >::InsertNextValue ( ValueType  v) [pure virtual]

Insert data at the end of the array. Return its location in the array.

Implemented in vtkDataArrayTemplate< T >, vtkCPExodusIINodalCoordinatesTemplate< Scalar >, and vtkCPExodusIIResultsArrayTemplate< Scalar >.

template<class Scalar>
virtual void vtkTypedDataArray< Scalar >::InsertValue ( vtkIdType  idx,
ValueType  v 
) [pure virtual]
template<class Scalar>
virtual int vtkTypedDataArray< Scalar >::GetArrayType ( ) [inline, virtual]

Method for type-checking in FastDownCast implementations.

Reimplemented from vtkDataArray.

Reimplemented in vtkDataArrayTemplate< T >, and vtkMappedDataArray< Scalar >.

Definition at line 127 of file vtkTypedDataArray.h.


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