VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
vtkSplitField Class Reference

Split a field into single component fields. More...

#include <vtkSplitField.h>

Inherits vtkDataSetAlgorithm.

Collaboration diagram for vtkSplitField:
[legend]

Classes

struct  Component
 

Public Types

enum  FieldLocations { DATA_OBJECT =0, POINT_DATA =1, CELL_DATA =2 }
 
typedef vtkDataSetAlgorithm Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkSplitFieldNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
void SetInputField (int attributeType, int fieldLoc)
 
void SetInputField (const char *name, int fieldLoc)
 
void SetInputField (const char *name, const char *fieldLoc)
 
void Split (int component, const char *arrayName)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkSplitFieldSafeDownCast (vtkObjectBase *o)
 
static vtkSplitFieldNew ()
 

Protected Types

enum  FieldTypes { NAME, ATTRIBUTE }
 

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
 vtkSplitField ()
 
virtual ~vtkSplitField ()
 
int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *)
 
vtkDataArray * SplitArray (vtkDataArray *da, int component)
 
ComponentGetNextComponent (Component *op)
 
ComponentGetFirst ()
 
void AddComponent (Component *op)
 
ComponentFindComponent (int index)
 
void DeleteAllComponents ()
 
void PrintComponent (Component *op, ostream &os, vtkIndent indent)
 
void PrintAllComponents (ostream &os, vtkIndent indent)
 

Protected Attributes

char * FieldName
 
int FieldType
 
int AttributeType
 
int FieldLocation
 
ComponentHead
 
ComponentTail
 

Static Protected Attributes

static char FieldLocationNames [3][12]
 
static char AttributeNames [vtkDataSetAttributes::NUM_ATTRIBUTES][10]
 

Detailed Description

Split a field into single component fields.

vtkSplitField is used to split a multi-component field (vtkDataArray) into multiple single component fields. The new fields are put in the same field data as the original field. The output arrays are of the same type as the input array. Example:

sf->SetInputField("gradient", vtkSplitField::POINT_DATA);
sf->Split(0, "firstcomponent");

tells vtkSplitField to extract the first component of the field called gradient and create an array called firstcomponent (the new field will be in the output's point data). The same can be done from Tcl:

sf SetInputField gradient POINT_DATA
sf Split 0 firstcomponent

AttributeTypes: SCALARS, VECTORS, NORMALS, TCOORDS, TENSORS
Field locations: DATA_OBJECT, POINT_DATA, CELL_DATA

Note that, by default, the original array is also passed through.

Warning
When using Tcl, Java, Python or Visual Basic bindings, the array name can not be one of the AttributeTypes when calling Split() which takes strings as arguments. The Tcl (Java etc.) command will always assume the string corresponds to an attribute type when the argument is one of the AttributeTypes. In this situation, use the Split() which takes enums.
See Also
vtkFieldData vtkDataSet vtkDataObjectToDataSetFilter vtkDataSetAttributes vtkDataArray vtkRearrangeFields vtkAssignAttribute vtkMergeFields
Tests:
vtkSplitField (Tests)

Definition at line 66 of file vtkSplitField.h.

Member Typedef Documentation

typedef vtkDataSetAlgorithm vtkSplitField::Superclass

Definition at line 69 of file vtkSplitField.h.

Member Enumeration Documentation

Enumerator
DATA_OBJECT 
POINT_DATA 
CELL_DATA 

Definition at line 91 of file vtkSplitField.h.

enum vtkSplitField::FieldTypes
protected
Enumerator
NAME 
ATTRIBUTE 

Definition at line 123 of file vtkSplitField.h.

Constructor & Destructor Documentation

vtkSplitField::vtkSplitField ( )
protected
virtual vtkSplitField::~vtkSplitField ( )
protectedvirtual

Member Function Documentation

static int vtkSplitField::IsTypeOf ( const char *  type)
static
virtual int vtkSplitField::IsA ( const char *  type)
virtual
static vtkSplitField* vtkSplitField::SafeDownCast ( vtkObjectBase *  o)
static
virtual vtkObjectBase* vtkSplitField::NewInstanceInternal ( ) const
protectedvirtual
vtkSplitField* vtkSplitField::NewInstance ( ) const
void vtkSplitField::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
static vtkSplitField* vtkSplitField::New ( )
static

Create a new vtkSplitField.

void vtkSplitField::SetInputField ( int  attributeType,
int  fieldLoc 
)

Use the given attribute in the field data given by fieldLoc as input.

void vtkSplitField::SetInputField ( const char *  name,
int  fieldLoc 
)

Use the array with given name in the field data given by fieldLoc as input.

void vtkSplitField::SetInputField ( const char *  name,
const char *  fieldLoc 
)

Helper method used by other language bindings. Allows the caller to specify arguments as strings instead of enums.

void vtkSplitField::Split ( int  component,
const char *  arrayName 
)

Create a new array with the given component.

int vtkSplitField::RequestData ( vtkInformation *  ,
vtkInformationVector **  ,
vtkInformationVector *   
)
protected
vtkDataArray* vtkSplitField::SplitArray ( vtkDataArray *  da,
int  component 
)
protected
Component* vtkSplitField::GetNextComponent ( Component op)
inlineprotected

Definition at line 151 of file vtkSplitField.h.

Component* vtkSplitField::GetFirst ( )
inlineprotected

Definition at line 153 of file vtkSplitField.h.

void vtkSplitField::AddComponent ( Component op)
protected
Component* vtkSplitField::FindComponent ( int  index)
protected
void vtkSplitField::DeleteAllComponents ( )
protected
void vtkSplitField::PrintComponent ( Component op,
ostream &  os,
vtkIndent  indent 
)
protected
void vtkSplitField::PrintAllComponents ( ostream &  os,
vtkIndent  indent 
)
protected

Member Data Documentation

char* vtkSplitField::FieldName
protected

Definition at line 135 of file vtkSplitField.h.

int vtkSplitField::FieldType
protected

Definition at line 136 of file vtkSplitField.h.

int vtkSplitField::AttributeType
protected

Definition at line 137 of file vtkSplitField.h.

int vtkSplitField::FieldLocation
protected

Definition at line 138 of file vtkSplitField.h.

char vtkSplitField::FieldLocationNames[3][12]
staticprotected

Definition at line 140 of file vtkSplitField.h.

char vtkSplitField::AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10]
staticprotected

Definition at line 141 of file vtkSplitField.h.

Component* vtkSplitField::Head
protected

Definition at line 147 of file vtkSplitField.h.

Component* vtkSplitField::Tail
protected

Definition at line 148 of file vtkSplitField.h.


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