vtkArrayMap Class Reference

#include <vtkArrayMap.h>

Inheritance diagram for vtkArrayMap:

Inheritance graph
[legend]
Collaboration diagram for vtkArrayMap:

Collaboration graph
[legend]

List of all members.


Detailed Description

Map values in an input array to different values in an output array of (possibly) different type.

vtkArrayMap allows you to associate certain values of an attribute array (on either a vertex, edge, point, or cell) with different values in a newly created attribute array.

vtkArrayMap manages an internal STL map of vtkVariants that can be added to or cleared. When this filter executes, each "key" is searched for in the input array and the indices of the output array at which there were matches the set to the mapped "value".

You can control whether the input array values are passed to the output before the mapping occurs (using PassArray) or, if not, what value to set the unmapped indices to (using FillValue).

One application of this filter is to help address the dirty data problem. For example, using vtkArrayMap you could associate the vertex values "Foo, John", "Foo, John.", and "John Foo" with a single entity.

Definition at line 46 of file vtkArrayMap.h.


Public Types

enum  FieldType {
  POINT_DATA = 0, CELL_DATA = 1, VERTEX_DATA = 2, EDGE_DATA = 3,
  NUM_ATTRIBUTE_LOCS
}
typedef vtkPassInputTypeAlgorithm Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void AddToMap (vtkVariant from, vtkVariant to)
void AddToMap (int from, int to)
void AddToMap (int from, char *to)
void AddToMap (char *from, int to)
void AddToMap (char *from, char *to)
void ClearMap ()
int GetMapSize ()
virtual void SetFieldType (int)
virtual int GetFieldType ()
virtual void SetPassArray (int)
virtual int GetPassArray ()
virtual void PassArrayOn ()
virtual void PassArrayOff ()
virtual void SetFillValue (double)
virtual double GetFillValue ()
virtual void SetInputArrayName (const char *)
virtual char * GetInputArrayName ()
virtual void SetOutputArrayName (const char *)
virtual char * GetOutputArrayName ()
virtual int GetOutputArrayType ()
virtual void SetOutputArrayType (int)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkArrayMapSafeDownCast (vtkObject *o)
static vtkArrayMapNew ()

Protected Member Functions

 vtkArrayMap ()
virtual ~vtkArrayMap ()
int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
int FillInputPortInformation (int, vtkInformation *)

Protected Attributes

char * InputArrayName
char * OutputArrayName
int OutputArrayType
int FieldType
int MapType
int PassArray
double FillValue
vtkMapType * Map

Member Typedef Documentation

Reimplemented from vtkPassInputTypeAlgorithm.

Definition at line 49 of file vtkArrayMap.h.


Member Enumeration Documentation

Enumerator:
POINT_DATA 
CELL_DATA 
VERTEX_DATA 
EDGE_DATA 
NUM_ATTRIBUTE_LOCS 

Definition at line 116 of file vtkArrayMap.h.


Constructor & Destructor Documentation

vtkArrayMap::vtkArrayMap (  )  [protected]

virtual vtkArrayMap::~vtkArrayMap (  )  [protected, virtual]


Member Function Documentation

virtual const char* vtkArrayMap::GetClassName (  )  [virtual]

Reimplemented from vtkPassInputTypeAlgorithm.

static int vtkArrayMap::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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkPassInputTypeAlgorithm.

virtual int vtkArrayMap::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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkPassInputTypeAlgorithm.

static vtkArrayMap* vtkArrayMap::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkPassInputTypeAlgorithm.

void vtkArrayMap::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 vtkPassInputTypeAlgorithm.

static vtkArrayMap* vtkArrayMap::New (  )  [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkPassInputTypeAlgorithm.

virtual void vtkArrayMap::SetFieldType ( int   )  [virtual]

Set/Get where the data is located that is being mapped. See FieldType enumeration for possible values. Default is POINT_DATA.

virtual int vtkArrayMap::GetFieldType (  )  [virtual]

Set/Get where the data is located that is being mapped. See FieldType enumeration for possible values. Default is POINT_DATA.

virtual void vtkArrayMap::SetPassArray ( int   )  [virtual]

Set/Get whether to copy the data from the input array to the output array before the mapping occurs. If turned off, FillValue is used to initialize any unmapped array indices. Default is off.

virtual int vtkArrayMap::GetPassArray (  )  [virtual]

Set/Get whether to copy the data from the input array to the output array before the mapping occurs. If turned off, FillValue is used to initialize any unmapped array indices. Default is off.

virtual void vtkArrayMap::PassArrayOn (  )  [virtual]

Set/Get whether to copy the data from the input array to the output array before the mapping occurs. If turned off, FillValue is used to initialize any unmapped array indices. Default is off.

virtual void vtkArrayMap::PassArrayOff (  )  [virtual]

Set/Get whether to copy the data from the input array to the output array before the mapping occurs. If turned off, FillValue is used to initialize any unmapped array indices. Default is off.

virtual void vtkArrayMap::SetFillValue ( double   )  [virtual]

Set/Get whether to copy the data from the input array to the output array before the mapping occurs. If turned off, FillValue is used to initialize any unmapped array indices. Default is -1.

virtual double vtkArrayMap::GetFillValue (  )  [virtual]

Set/Get whether to copy the data from the input array to the output array before the mapping occurs. If turned off, FillValue is used to initialize any unmapped array indices. Default is -1.

virtual void vtkArrayMap::SetInputArrayName ( const char *   )  [virtual]

Set/Get the name of the input array. This must be set prior to execution.

virtual char* vtkArrayMap::GetInputArrayName (  )  [virtual]

Set/Get the name of the input array. This must be set prior to execution.

virtual void vtkArrayMap::SetOutputArrayName ( const char *   )  [virtual]

Set/Get the name of the output array. Default is "ArrayMap".

virtual char* vtkArrayMap::GetOutputArrayName (  )  [virtual]

Set/Get the name of the output array. Default is "ArrayMap".

virtual int vtkArrayMap::GetOutputArrayType (  )  [virtual]

Set/Get the type of the output array. See vtkSetGet.h for possible values. Default is VTK_INT.

virtual void vtkArrayMap::SetOutputArrayType ( int   )  [virtual]

Set/Get the type of the output array. See vtkSetGet.h for possible values. Default is VTK_INT.

void vtkArrayMap::AddToMap ( vtkVariant  from,
vtkVariant  to 
)

Add to the internal STL map. "from" should be a value in the input array and "to" should be the new value it gets assigned in the output array. BTX

void vtkArrayMap::AddToMap ( int  from,
int  to 
)

void vtkArrayMap::AddToMap ( int  from,
char *  to 
)

void vtkArrayMap::AddToMap ( char *  from,
int  to 
)

void vtkArrayMap::AddToMap ( char *  from,
char *  to 
)

void vtkArrayMap::ClearMap (  ) 

Clear the internal map.

int vtkArrayMap::GetMapSize (  ) 

Get the size of the internal map.

int vtkArrayMap::RequestData ( vtkInformation ,
vtkInformationVector **  ,
vtkInformationVector  
) [protected, virtual]

This is called within ProcessRequest when a request asks the algorithm to do its work. This is the method you should override to do whatever the algorithm is designed to do. This happens during the fourth pass in the pipeline execution process.

Reimplemented from vtkPassInputTypeAlgorithm.

int vtkArrayMap::FillInputPortInformation ( int  port,
vtkInformation info 
) [protected, virtual]

Fill the input port information objects for this algorithm. This is invoked by the first call to GetInputPortInformation for each port so subclasses can specify what they can handle.

Reimplemented from vtkPassInputTypeAlgorithm.


Member Data Documentation

char* vtkArrayMap::InputArrayName [protected]

Definition at line 134 of file vtkArrayMap.h.

char* vtkArrayMap::OutputArrayName [protected]

Definition at line 135 of file vtkArrayMap.h.

Definition at line 136 of file vtkArrayMap.h.

int vtkArrayMap::FieldType [protected]

Definition at line 137 of file vtkArrayMap.h.

int vtkArrayMap::MapType [protected]

Definition at line 138 of file vtkArrayMap.h.

int vtkArrayMap::PassArray [protected]

Definition at line 139 of file vtkArrayMap.h.

double vtkArrayMap::FillValue [protected]

Definition at line 140 of file vtkArrayMap.h.

vtkMapType* vtkArrayMap::Map [protected]

Definition at line 143 of file vtkArrayMap.h.


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

Generated on Sat Dec 27 13:16:59 2008 for VTK by  doxygen 1.5.6