VTK
Public Types | Public Member Functions | Protected Member Functions | List of all members
vtkTypedArray< T > Class Template Referenceabstract

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

#include <vtkTypedArray.h>

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

Public Types

typedef vtkArray::CoordinateT CoordinateT
 
typedef vtkArray::SizeT SizeT
 
- Public Types inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray >
typedef vtkArray Superclass
 
- Public Types inherited from vtkArray
enum  { DENSE = 0, SPARSE = 1 }
 
typedef vtkObject Superclass
 
typedef vtkArrayExtents::CoordinateT CoordinateT
 
typedef vtkArrayExtents::DimensionT DimensionT
 
typedef vtkArrayExtents::SizeT SizeT
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

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
 
- Public Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray >
vtkTypedArray< T > * NewInstance () const
 
- Public Member Functions inherited from vtkArray
vtkArrayNewInstance () const
 
virtual bool IsDense ()=0
 
const vtkArrayRange GetExtent (DimensionT dimension)
 
virtual const vtkArrayExtentsGetExtents ()=0
 
DimensionT GetDimensions ()
 
SizeT GetSize ()
 
virtual SizeT GetNonNullSize ()=0
 
void SetName (const vtkStdString &name)
 
vtkStdString GetName ()
 
void SetDimensionLabel (DimensionT i, const vtkStdString &label)
 
vtkStdString GetDimensionLabel (DimensionT i)
 
virtual void GetCoordinatesN (const SizeT n, vtkArrayCoordinates &coordinates)=0
 
virtual vtkArrayDeepCopy ()=0
 
void Resize (const CoordinateT i)
 
void Resize (const CoordinateT i, const CoordinateT j)
 
void Resize (const CoordinateT i, const CoordinateT j, const CoordinateT k)
 
void Resize (const vtkArrayRange &i)
 
void Resize (const vtkArrayRange &i, const vtkArrayRange &j)
 
void Resize (const vtkArrayRange &i, const vtkArrayRange &j, const vtkArrayRange &k)
 
void Resize (const vtkArrayExtents &extents)
 
vtkVariant GetVariantValue (CoordinateT i)
 
vtkVariant GetVariantValue (CoordinateT i, CoordinateT j)
 
vtkVariant GetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k)
 
void SetVariantValue (CoordinateT i, const vtkVariant &value)
 
void SetVariantValue (CoordinateT i, CoordinateT j, const vtkVariant &value)
 
void SetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k, const vtkVariant &value)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Protected Member Functions

 vtkTypedArray ()
 
 ~vtkTypedArray ()
 
- Protected Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray >
virtual vtkObjectBaseNewInstanceInternal () const
 
virtual int IsA (const char *type)
 
 vtkTypeTemplate ()
 
- Protected Member Functions inherited from vtkArray
 vtkArray ()
 
 ~vtkArray ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Static Public Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray >
static vtkTypedArray< T > * SafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkArray
static int IsTypeOf (const char *type)
 
static vtkArraySafeDownCast (vtkObjectBase *o)
 
static vtkArrayCreateArray (int StorageType, int ValueType)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
- Static Protected Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray >
static int IsTypeOf (const char *type)
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

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

Definition at line 61 of file vtkTypedArray.h.

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

Definition at line 62 of file vtkTypedArray.h.

Constructor & Destructor Documentation

template<typename T>
vtkTypedArray< T >::vtkTypedArray ( )
inlineprotected

Definition at line 113 of file vtkTypedArray.h.

template<typename T>
vtkTypedArray< T >::~vtkTypedArray ( )
inlineprotected

Definition at line 114 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.

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: