Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkFieldData Class Reference

represent and manipulate fields of data. More...

#include <vtkFieldData.h>

Inheritance diagram for vtkFieldData:

Inheritance graph
[legend]
Collaboration diagram for vtkFieldData:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void Initialize ()
int Allocate (const int sz, const int ext=1000)
vtkFieldData * MakeObject ()
void SetNumberOfArrays (int num)
void SetArray (int i, vtkDataArray *)
int GetNumberOfArrays ()
vtkDataArrayGetArray (int i)
int AddArray (vtkDataArray *array)
int AddArray (vtkDataArray *array, const char *name)
int AddReplaceArray (vtkDataArray *array, const char *name)
int AddNoReplaceArray (vtkDataArray *array, const char *name)
int GetArrayContainingComponent (int i, int &arrayComp)
vtkDataArrayGetArray (const char *arrayName)
vtkDataArrayGetArray (const char *arrayName, int &index)
void SetArrayName (int i, const char *name)
char * GetArrayName (int i)
int GetNumberOfComponents ()
int GetNumberOfTuples ()
void SetNumberOfTuples (const int number)
float * GetTuple (const int i)
void GetTuple (const int i, float *tuple)
void SetTuple (const int i, const float *tuple)
void InsertTuple (const int i, const float *tuple)
int InsertNextTuple (const float *tuple)
float GetComponent (const int i, const int j)
void SetComponent (const int i, const int j, const float c)
void InsertComponent (const int i, const int j, const float c)
void DeepCopy (vtkFieldData *da)
void ShallowCopy (vtkFieldData *da)
void Squeeze ()
void Reset ()
void GetField (vtkIdList *ptId, vtkFieldData *f)
virtual unsigned long GetActualMemorySize ()
void DeepCopy (vtkFieldData &da)
void ShallowCopy (vtkFieldData &da)
void GetField (vtkIdList &ptId, vtkFieldData &f)

Static Public Methods

vtkFieldData * New ()
int IsTypeOf (const char *type)
vtkFieldData * SafeDownCast (vtkObject *o)

Protected Methods

 vtkFieldData ()
 ~vtkFieldData ()
 vtkFieldData (const vtkFieldData &)
void operator= (const vtkFieldData &)

Protected Attributes

int NumberOfArrays
vtkDataArray ** Data
char ** ArrayNames
int TupleSize
float * Tuple

Detailed Description

represent and manipulate fields of data.

Date:
2000/12/10 20:08:09
Revision:
1.26

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
Examples:
vtkFieldData (examples)

Definition at line 77 of file vtkFieldData.h.


Constructor & Destructor Documentation

vtkFieldData::vtkFieldData   [protected]
 

vtkFieldData::~vtkFieldData   [protected]
 

vtkFieldData::vtkFieldData const vtkFieldData &    [inline, protected]
 

Definition at line 230 of file vtkFieldData.h.


Member Function Documentation

vtkFieldData* vtkFieldData::New   [static]
 

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

Reimplemented from vtkObject.

virtual const char* vtkFieldData::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

int vtkFieldData::IsTypeOf const char *    type [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.

virtual int vtkFieldData::IsA const char *    type [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.

vtkFieldData* vtkFieldData::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

void vtkFieldData::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.

void vtkFieldData::Initialize  
 

Release all data but do not delete object.

int vtkFieldData::Allocate const int    sz,
const int    ext = 1000
 

Allocate data for each array.

vtkFieldData* vtkFieldData::MakeObject  
 

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

void vtkFieldData::SetNumberOfArrays int    num
 

Set the number of arrays used to define the field.

void vtkFieldData::SetArray int    i,
vtkDataArray  
 

Set an array to define the field.

int vtkFieldData::GetNumberOfArrays  
 

Get the number of arrays of data available.

vtkDataArray* vtkFieldData::GetArray int    i
 

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

int vtkFieldData::AddArray vtkDataArray   array
 

Add an array to the end of the array list, return the new array index

int vtkFieldData::AddArray vtkDataArray   array,
const char *    name
 

Add an array to the end of the array list, and set the name return the new array index

int vtkFieldData::AddReplaceArray vtkDataArray   array,
const char *    name
 

Add an array to the end of the array list, and set the name return the new array index. if array with given name already exists - overwrites it

int vtkFieldData::AddNoReplaceArray vtkDataArray   array,
const char *    name
 

Add an array to the end of the array list, and set the name return the new array index. returns -1 if array with given name already exists and does not overwrite it

int vtkFieldData::GetArrayContainingComponent int    i,
int &    arrayComp
 

Return the array containing the ith component of the field. The return value is an integer number n 0<=n<this->NumberOfArrays. Also, an integer value is returned indicating the component in the array is returned. Method returns -1 if specified component is not in the field.

vtkDataArray* vtkFieldData::GetArray const char *    arrayName
 

Return the array with the name given. Returns NULL is array not found.

vtkDataArray* vtkFieldData::GetArray const char *    arrayName,
int &    index
 

Return the array with the name given. Returns NULL is array not found. Also returns index of array if found, -1 otherwise

void vtkFieldData::SetArrayName int    i,
const char *    name
 

Set/Get the name for an array of data.

char* vtkFieldData::GetArrayName int    i
 

int vtkFieldData::GetNumberOfComponents  
 

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

int vtkFieldData::GetNumberOfTuples  
 

Get the number of tuples in the field. Note: some fields have arrays with different numbers of tuples; this method returns the number of tuples in the first array. Mixed-length arrays may have to be treated specially.

void vtkFieldData::SetNumberOfTuples const int    number
 

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

float* vtkFieldData::GetTuple const int    i
 

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

void vtkFieldData::GetTuple const int    i,
float *    tuple
 

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

void vtkFieldData::SetTuple const int    i,
const float *    tuple
 

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

void vtkFieldData::InsertTuple const int    i,
const float *    tuple
 

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

int vtkFieldData::InsertNextTuple const float *    tuple
 

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

float vtkFieldData::GetComponent const int    i,
const int    j
 

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

void vtkFieldData::SetComponent const int    i,
const int    j,
const float    c
 

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 vtkFieldData::InsertComponent const int    i,
const int    j,
const float    c
 

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 vtkFieldData::DeepCopy vtkFieldData *    da
 

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

void vtkFieldData::ShallowCopy vtkFieldData *    da
 

Copy a field by reference counting the data arrays.

void vtkFieldData::Squeeze  
 

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

void vtkFieldData::Reset  
 

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

void vtkFieldData::GetField vtkIdList   ptId,
vtkFieldData *    f
 

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).

virtual unsigned long vtkFieldData::GetActualMemorySize   [virtual]
 

Return the memory in kilobytes consumed by this field data. Used to support streaming and reading/writing data. The value returned is guaranteed to be greater than or equal to the memory required to actually represent the data represented by this object.

void vtkFieldData::DeepCopy vtkFieldData &    da [inline]
 

For legacy compatibility. Do not use.

Definition at line 219 of file vtkFieldData.h.

void vtkFieldData::ShallowCopy vtkFieldData &    da [inline]
 

Definition at line 221 of file vtkFieldData.h.

void vtkFieldData::GetField vtkIdList   ptId,
vtkFieldData &    f
[inline]
 

Definition at line 223 of file vtkFieldData.h.

void vtkFieldData::operator= const vtkFieldData &    [inline, protected]
 

Definition at line 231 of file vtkFieldData.h.


Member Data Documentation

int vtkFieldData::NumberOfArrays [protected]
 

Definition at line 233 of file vtkFieldData.h.

vtkDataArray** vtkFieldData::Data [protected]
 

Definition at line 234 of file vtkFieldData.h.

char** vtkFieldData::ArrayNames [protected]
 

Definition at line 235 of file vtkFieldData.h.

int vtkFieldData::TupleSize [protected]
 

Definition at line 237 of file vtkFieldData.h.

float* vtkFieldData::Tuple [protected]
 

Definition at line 238 of file vtkFieldData.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 12:47:55 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001