Documentation for vtkDataArray

vtkDataArray - abstract superclass for arrays

Super Class: vtkObject

Description:

vtkDataArray is an abstract superclass for data array objects. This class defines an API that all array objects must support. Note that the concrete subclasses of this class represent data in native form (char, int, etc.) and often have specialized more efficient methods for operating on this data (for example, getting pointers to data or getting/inserting data in native form). The logical structure of this class is an array of tuples, where each tuple is made up of n-components (also called a component group), and n is the number of component values in a tuple(n >= 1). Another view of this class is a mxn matrix, where m is the number of tuples, and n is the number of components in a tuple. Thus vtkDataArray can be used to represent scalars (1-4 components), 3D vectors (3 components), texture coordinates (1-3 components), tensors, (9 components) and so on.

 

See Also:

vtkBitArray vtkCharArray vtkUnsignedCharArray vtkShortArray vtkUnsignedShortArray vtkIntArray vtkUnsignedIntArray vtkLongArray vtkUnsignedLongArray vtkFloatArray vtkDoubleArray vtkVoidArray

 

Methods:

void vtkDataArray (int )
int Allocate (const int ,const int )
void Initialize ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
vtkDataArray *MakeObject ()
int GetDataType ()
void SetNumberOfComponents (int )
int GetNumberOfComponents ()
void SetNumberOfTuples (const int )
int GetNumberOfTuples ()
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 GetData (int ,int ,int ,int ,vtkFloatArray &)
void DeepCopy (vtkDataArray *)
void *GetVoidPointer (const int )
void Squeeze ()
void Reset ()
int GetSize ()
int GetMaxId ()
int GetExtend ()
void DeepCopy (vtkDataArray &)

 

Detailed Method Descriptions:

Construct object with default tuple dimension (number of components) of 1.

void vtkDataArray (int )

Virtual constructor creates an object of the same type as this one. The created object also has the same number of components. You are responsible for freeing the object.

vtkDataArray *MakeObject ()

Return the underlying data type. An integer indicating data type is returned as specified in vtkSetGet.h.

int GetDataType ()

Set/Get the dimension (n) of the components. Must be >= 1. Make sure that this is set before allocation.

void SetNumberOfComponents (int )
int GetNumberOfComponents ()

Set the number of tuples (a component group) in the array. Note that this may allocate space depending on the number of components.

void SetNumberOfTuples (const int )

Get the number of tuples (a component group) in the array.

int GetNumberOfTuples ()

Get the data tuple at ith location. Return it as a pointer to an array. Note: this method is not thread-safe, and the pointer is only valid as long as another method incovation to a vtk object is not performed.

float *GetTuple (const int )

Get the data tuple at ith location by filling in a user-provided array, Make sure that your array is large enough to hold the NumberOfComponents amount of data being returned.

void GetTuple (const int ,float *)

Set the data tuple at ith location. Note that range checking or memory allocation is not performed; use this method in conjunction with SetNumberOfTuples() to allocate space.

void SetTuple (const int ,const float *)

Insert the data tuple at ith location. Note that memory allocation is performed as necessary to hold the data.

void InsertTuple (const int ,const float *)

Insert the data tuple at the end of the array and return the location at which the data was inserted. Memory is allocated as necessary to hold the data.

int InsertNextTuple (const float *)

Return the data component at the ith tuple and jth component location. Note that i

float GetComponent (const int ,const int )

Set the data component at the ith tuple and jth component location. Note that i

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

Insert the data component at ith tuple and jth component location. Note that memory allocation is performed as necessary to hold the data.

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

Get the data as a float array in the range (tupleMin,tupleMax) and (compMin, compMax). The resulting float array consists of all data in the tuple range specified and only the component range specified. This process typically requires casting the data from native form into floating point values. This method is provided as a convenience for data exchange, and is not very fast.

void GetData (int ,int ,int ,int ,vtkFloatArray &)

Deep copy of data. Copies data from different data arrays even if they are different types (using floating-point exchange).

void DeepCopy (vtkDataArray *)

Return a void pointer. For image pipeline interface and other special pointer manipulation.

void *GetVoidPointer (const int )

Free any unneccesary memory.

void Squeeze ()

Return the size of the data.

void Reset ()

What is the maximum id currently in the array.

int GetSize ()

By how many elements should the array increase when more memory is required.

int GetMaxId ()

For legacy compatibility. Do not use.

int GetExtend ()