VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkArrayIterator Class Reference

Abstract superclass to iterate over elements in an vtkAbstractArray. More...

#include <vtkArrayIterator.h>

Inheritance diagram for vtkArrayIterator:
Inheritance graph
[legend]
Collaboration diagram for vtkArrayIterator:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkArrayIteratorNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual void Initialize (vtkAbstractArray *array)=0

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkArrayIteratorSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
virtual int GetDataType ()=0
 vtkArrayIterator ()
 ~vtkArrayIterator ()

Detailed Description

Abstract superclass to iterate over elements in an vtkAbstractArray.

vtkArrayIterator is used to iterate over elements in any vtkAbstractArray subclass. The vtkArrayIteratorTemplateMacro is used to centralize the set of types supported by Execute methods. It also avoids duplication of long switch statement case lists.

Note that in this macro VTK_TT is defined to be the type of the iterator for the given type of array. One must include the vtkArrayIteratorIncludes.h header file to provide for extending of this macro by addition of new iterators.

Example usage:

 vtkArrayIter* iter = array->NewIterator();
 switch(array->GetDataType())
   {
   vtkArrayIteratorTemplateMacro(myFunc(static_cast<VTK_TT*>(iter), arg2));
   }
 iter->Delete();

Definition at line 48 of file vtkArrayIterator.h.


Member Typedef Documentation


Constructor & Destructor Documentation

Get the data type from the underlying array. Returns 0 if no underlying array is present.

Get the data type from the underlying array. Returns 0 if no underlying array is present.


Member Function Documentation

static int vtkArrayIterator::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkTypeTemplate< vtkArrayIteratorTemplate< T >, vtkArrayIterator >, and vtkBitArrayIterator.

virtual int vtkArrayIterator::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkTypeTemplate< vtkArrayIteratorTemplate< T >, vtkArrayIterator >, and vtkBitArrayIterator.

virtual vtkObjectBase* vtkArrayIterator::NewInstanceInternal ( ) const [protected, virtual]
void vtkArrayIterator::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 vtkObject.

Reimplemented in vtkArrayIteratorTemplate< T >, and vtkBitArrayIterator.

virtual void vtkArrayIterator::Initialize ( vtkAbstractArray array) [pure virtual]

Set the array this iterator will iterate over. After Initialize() has been called, the iterator is valid so long as the Array has not been modified (except using the iterator itself). If the array is modified, the iterator must be re-intialized.

Implemented in vtkArrayIteratorTemplate< T >, and vtkBitArrayIterator.

virtual int vtkArrayIterator::GetDataType ( ) [pure virtual]

Get the data type from the underlying array. Returns 0 if no underlying array is present.

Implemented in vtkArrayIteratorTemplate< T >, and vtkBitArrayIterator.


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