Documentation for vtkFieldData

vtkFieldData - represent and manipulate fields of data

Super Class: vtkObject

Description:

vtkFieldData represents and manipulates fields of data. The model of a field is a m x n matrix of data values, where m is the number of tuples, and n is the number of components. (A tuple is a row of n components in the matrix.) The field is assumed to be composed of a set of one or more data arrays, where the data in the arrays are of different types (e.g., int, float, char, etc.), and there may be variable numbers of components in each array. Note that each data array is assumed to be "m" in length (i.e., number of tuples), which typically corresponds to the number of points or cells in a dataset. There are two ways of manipulating and interfacing to fields. You can do it generically by manipulating components/tuples via a float-type data exchange, or you can do it by grabbing the arrays and manipulating them directly. The former is simpler but performs type conversion, which is bad if your data has non-castable types like (void) pointers, or you lose information as a result of the cast. The, more efficient method means managing each array in the field. Using this method you can create faster, more efficient algorithms that do not lose information.

 

See Also:

vtkDataArray vtkAttribueData vtkPointData vtkCellData

 

Methods:

void vtkFieldData ()
void vtkFieldData ()
static vtkFieldData *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
void Initialize ()
int Allocate (const int ,const int )
vtkFieldData *MakeObject ()
void SetNumberOfArrays (int )
void SetArray (int ,vtkDataArray *)
int GetNumberOfArrays ()
vtkDataArray *GetArray (int )
void SetArrayName (int ,char *)
char *GetArrayName (int )
int GetNumberOfComponents ()
int GetNumberOfTuples ()
void SetNumberOfTuples (const int )
float *GetTuple (const int )
void GetTuple (const int ,float *)
void SetTuple (const int ,const float *)
void InsertTuple (const int ,const float *)
int InsertNextTuple (const float *)
float GetComponent (const int ,const int )
void SetComponent (const int ,const int ,const float )
void InsertComponent (const int ,const int ,const float )
void DeepCopy (vtkFieldData *)
void ShallowCopy (vtkFieldData *)
void Squeeze ()
void Reset ()
void GetField (vtkIdList * ,vtkFieldData *)
void DeepCopy (vtkFieldData &)
void ShallowCopy (vtkFieldData &)
void GetField (vtkIdList & ,vtkFieldData &)

 

Detailed Method Descriptions:

Release all data but do not delete object.

void Initialize ()

Allocate data for each array.

int Allocate (const int ,const int )

Virtual constructor creates a field with the same number of data arrays and types of data arrays, but the arrays contain nothing.

vtkFieldData *MakeObject ()

Set the number of arrays used to define the field.

void SetNumberOfArrays (int )

Set an array to define the field.

void SetArray (int ,vtkDataArray *)

Get the number of arrays of data available.

int GetNumberOfArrays ()

Return the ith array in the field. A NULL is returned if the index i is out if range.

vtkDataArray *GetArray (int )

Set/Get the name for an array of data.

void SetArrayName (int ,char *)
char *GetArrayName (int )

Get the number of components in the field. This is determined by adding up the components in each non-NULL array.

int GetNumberOfComponents ()

Get the number of tuples in the field.

int GetNumberOfTuples ()

Set the number of tuples for each data array in the field.

void SetNumberOfTuples (const int )

Return a tuple consisting of a concatentation of all data from all the different arrays. Note that everything is converted to and from float values.

float *GetTuple (const int )

Copy the ith tuple value into a user provided tuple array. Make sure that you've allocated enough space for the copy.

void GetTuple (const int ,float *)

Set the tuple value at the ith location. Set operations mean that no range chaecking is performed, so they're faster.

void SetTuple (const int ,const float *)

Insert the tuple value at the ith location. Range checking is performed and memory allocates as necessary.

void InsertTuple (const int ,const float *)

Insert the tuple value at the end of the tuple matrix. Range checking is performed and memory is allocated as necessary.

int InsertNextTuple (const float *)

Get the component value at the ith tuple (or row) and jth component (or column).

float GetComponent (const int ,const int )

Set the component value at the ith tuple (or row) and jth component (or column). Range checking is not performed, so set the object up properly before invoking.

void SetComponent (const int ,const int ,const float )

Insert the component value at the ith tuple (or row) and jth component (or column). Range checking is performed and memory allocated as necessary o hold data.

void InsertComponent (const int ,const int ,const float )

Copy a field by creating new data arrays (i.e., duplicate storage).

void DeepCopy (vtkFieldData *)

Copy a field by reference counting the data arrays.

void ShallowCopy (vtkFieldData *)

Squeezes each data array in the field (Squeeze() reclaims unused memory.)

void Squeeze ()

Resets each data array in the field (Reset() does not release memory but it makes the arrays look like they are empty.)

void Reset ()

Get a field from a list of ids. Supplied field f should have same types and number of data arrays as this one (i.e., like MakeObject() returns).

void GetField (vtkIdList * ,vtkFieldData *)

For legacy compatibility. Do not use.

void DeepCopy (vtkFieldData &)
void ShallowCopy (vtkFieldData &)