vtkDataArrayTemplate< T > Class Template Reference

#include <vtkDataArrayTemplate.h>

Inheritance diagram for vtkDataArrayTemplate< T >:

Inheritance graph
[legend]
Collaboration diagram for vtkDataArrayTemplate< T >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class T>
class vtkDataArrayTemplate< T >

Implementation template for vtkDataArray.

There is a vtkDataArray subclass for each native type supported by VTK. This template is used to implement all the subclasses in the same way while avoiding code duplication.

Definition at line 29 of file vtkDataArrayTemplate.h.


Public Types

typedef vtkDataArray Superclass

Public Member Functions

void PrintSelf (ostream &os, vtkIndent indent)
int Allocate (vtkIdType sz, vtkIdType ext=1000)
void Initialize ()
int GetDataTypeSize ()
void SetNumberOfTuples (vtkIdType number)
double * GetTuple (vtkIdType i)
void Squeeze ()
virtual int Resize (vtkIdType numTuples)
GetValue (vtkIdType id)
void SetNumberOfValues (vtkIdType number)
void InsertValue (vtkIdType id, T f)
vtkIdType InsertNextValue (T f)
double GetComponent (vtkIdType i, int j)
void SetComponent (vtkIdType i, int j, double c)
virtual void InsertComponent (vtkIdType i, int j, double c)
void DeepCopy (vtkDataArray *da)
void ExportToVoidPointer (void *out_ptr)
virtual void ComputeRange (int comp)
void GetTuple (vtkIdType i, double *tuple)
void GetTupleValue (vtkIdType i, T *tuple)
void SetTuple (vtkIdType i, const float *tuple)
void SetTuple (vtkIdType i, const double *tuple)
void SetTupleValue (vtkIdType i, const T *tuple)
void InsertTuple (vtkIdType i, const float *tuple)
void InsertTuple (vtkIdType i, const double *tuple)
void InsertTupleValue (vtkIdType i, const T *tuple)
vtkIdType InsertNextTuple (const float *tuple)
vtkIdType InsertNextTuple (const double *tuple)
vtkIdType InsertNextTupleValue (const T *tuple)
void SetValue (vtkIdType id, T value)
T * WritePointer (vtkIdType id, vtkIdType number)
void * WriteVoidPointer (vtkIdType id, vtkIdType number)
T * GetPointer (vtkIdType id)
void * GetVoidPointer (vtkIdType id)
void SetArray (T *array, vtkIdType size, int save)
void SetVoidArray (void *array, vtkIdType size, int save)

Protected Member Functions

 vtkDataArrayTemplate (vtkIdType numComp)
 ~vtkDataArrayTemplate ()
T * ResizeAndExtend (vtkIdType sz)
void ComputeScalarRange (int comp)
void ComputeVectorRange ()

Protected Attributes

T * Array
int TupleSize
double * Tuple
int SaveUserArray

Member Typedef Documentation

template<class T>
typedef vtkDataArray vtkDataArrayTemplate< T >::Superclass

Reimplemented from vtkDataArray.

Definition at line 32 of file vtkDataArrayTemplate.h.


Constructor & Destructor Documentation

template<class T>
vtkDataArrayTemplate< T >::vtkDataArrayTemplate ( vtkIdType  numComp  )  [protected]

template<class T>
vtkDataArrayTemplate< T >::~vtkDataArrayTemplate (  )  [protected]


Member Function Documentation

template<class T>
void vtkDataArrayTemplate< T >::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 vtkDataArray.

template<class T>
int vtkDataArrayTemplate< T >::Allocate ( vtkIdType  sz,
vtkIdType  ext = 1000 
) [virtual]

Allocate memory for this array. Delete old storage only if necessary. Note that ext is no longer used.

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::Initialize (  )  [virtual]

Release storage and reset array to initial state.

Implements vtkDataArray.

template<class T>
int vtkDataArrayTemplate< T >::GetDataTypeSize (  )  [inline, virtual]

Return the size of the data type.

Implements vtkDataArray.

Definition at line 43 of file vtkDataArrayTemplate.h.

template<class T>
void vtkDataArrayTemplate< T >::SetNumberOfTuples ( vtkIdType  number  )  [virtual]

Set the number of n-tuples in the array.

Implements vtkDataArray.

template<class T>
double* vtkDataArrayTemplate< T >::GetTuple ( vtkIdType  i  )  [virtual]

Get a pointer to a tuple at the ith location. This is a dangerous method (it is not thread safe since a pointer is returned).

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::GetTuple ( vtkIdType  i,
double *  tuple 
) [virtual]

Copy the tuple value into a user-provided array.

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::GetTupleValue ( vtkIdType  i,
T *  tuple 
)

Copy the tuple value into a user-provided array.

template<class T>
void vtkDataArrayTemplate< T >::SetTuple ( vtkIdType  i,
const float *  tuple 
) [virtual]

Set the tuple value at the ith location in the array.

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::SetTuple ( vtkIdType  i,
const double *  tuple 
) [virtual]

Set the tuple value at the ith location in the array.

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::SetTupleValue ( vtkIdType  i,
const T *  tuple 
)

Set the tuple value at the ith location in the array.

template<class T>
void vtkDataArrayTemplate< T >::InsertTuple ( vtkIdType  i,
const float *  tuple 
) [virtual]

Insert (memory allocation performed) the tuple into the ith location in the array.

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::InsertTuple ( vtkIdType  i,
const double *  tuple 
) [virtual]

Insert (memory allocation performed) the tuple into the ith location in the array.

Implements vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::InsertTupleValue ( vtkIdType  i,
const T *  tuple 
)

Insert (memory allocation performed) the tuple into the ith location in the array.

template<class T>
vtkIdType vtkDataArrayTemplate< T >::InsertNextTuple ( const float *  tuple  )  [virtual]

Insert (memory allocation performed) the tuple onto the end of the array.

Implements vtkDataArray.

template<class T>
vtkIdType vtkDataArrayTemplate< T >::InsertNextTuple ( const double *  tuple  )  [virtual]

Insert (memory allocation performed) the tuple onto the end of the array.

Implements vtkDataArray.

template<class T>
vtkIdType vtkDataArrayTemplate< T >::InsertNextTupleValue ( const T *  tuple  ) 

Insert (memory allocation performed) the tuple onto the end of the array.

template<class T>
void vtkDataArrayTemplate< T >::Squeeze (  )  [inline, virtual]

Resize object to just fit data requirement. Reclaims extra memory.

Implements vtkDataArray.

Definition at line 82 of file vtkDataArrayTemplate.h.

template<class T>
virtual int vtkDataArrayTemplate< T >::Resize ( vtkIdType  numTuples  )  [virtual]

Resize the array while conserving the data.

Implements vtkDataArray.

template<class T>
T vtkDataArrayTemplate< T >::GetValue ( vtkIdType  id  )  [inline]

Get the data at a particular index.

Definition at line 88 of file vtkDataArrayTemplate.h.

template<class T>
void vtkDataArrayTemplate< T >::SetValue ( vtkIdType  id,
value 
) [inline]

Set the data at a particular index. Does not do range checking. Make sure you use the method SetNumberOfValues() before inserting data.

Definition at line 93 of file vtkDataArrayTemplate.h.

template<class T>
void vtkDataArrayTemplate< T >::SetNumberOfValues ( vtkIdType  number  ) 

Specify the number of values for this object to hold. Does an allocation as well as setting the MaxId ivar. Used in conjunction with SetValue() method for fast insertion.

template<class T>
void vtkDataArrayTemplate< T >::InsertValue ( vtkIdType  id,
f 
)

Insert data at a specified position in the array.

template<class T>
vtkIdType vtkDataArrayTemplate< T >::InsertNextValue ( f  ) 

Insert data at the end of the array. Return its location in the array.

template<class T>
double vtkDataArrayTemplate< T >::GetComponent ( vtkIdType  i,
int  j 
) [virtual]

Return the data component at the ith tuple and jth component location. Note that i is less then NumberOfTuples and j is less then NumberOfComponents.

Reimplemented from vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::SetComponent ( vtkIdType  i,
int  j,
double  c 
) [virtual]

Set the data component at the ith tuple and jth component location. Note that i is less then NumberOfTuples and j is less then NumberOfComponents. Make sure enough memory has been allocated (use SetNumberOfTuples() and SetNumberOfComponents()).

Reimplemented from vtkDataArray.

template<class T>
virtual void vtkDataArrayTemplate< T >::InsertComponent ( vtkIdType  i,
int  j,
double  c 
) [virtual]

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

Reimplemented from vtkDataArray.

template<class T>
T* vtkDataArrayTemplate< T >::WritePointer ( vtkIdType  id,
vtkIdType  number 
)

Get the address of a particular data index. Make sure data is allocated for the number of items requested. Set MaxId according to the number of data values requested.

template<class T>
void* vtkDataArrayTemplate< T >::WriteVoidPointer ( vtkIdType  id,
vtkIdType  number 
) [inline, virtual]

Get the address of a particular data index. Make sure data is allocated for the number of items requested. Set MaxId according to the number of data values requested.

Implements vtkDataArray.

Definition at line 130 of file vtkDataArrayTemplate.h.

template<class T>
T* vtkDataArrayTemplate< T >::GetPointer ( vtkIdType  id  )  [inline]

Get the address of a particular data index. Performs no checks to verify that the memory has been allocated etc.

Definition at line 137 of file vtkDataArrayTemplate.h.

template<class T>
void* vtkDataArrayTemplate< T >::GetVoidPointer ( vtkIdType  id  )  [inline, virtual]

Get the address of a particular data index. Performs no checks to verify that the memory has been allocated etc.

Implements vtkDataArray.

Definition at line 138 of file vtkDataArrayTemplate.h.

template<class T>
void vtkDataArrayTemplate< T >::DeepCopy ( vtkDataArray da  )  [virtual]

Deep copy of another double array.

Reimplemented from vtkDataArray.

template<class T>
void vtkDataArrayTemplate< T >::SetArray ( T *  array,
vtkIdType  size,
int  save 
)

This method lets the user specify data to be held by the array. The array argument is a pointer to the data. size is the size of the array supplied by the user. Set save to 1 to keep the class from deleting the array when it cleans up or reallocates memory. The class uses the actual array provided; it does not copy the data from the suppled array.

template<class T>
void vtkDataArrayTemplate< T >::SetVoidArray ( void *  array,
vtkIdType  size,
int  save 
) [inline]

This method lets the user specify data to be held by the array. The array argument is a pointer to the data. size is the size of the array supplied by the user. Set save to 1 to keep the class from deleting the array when it cleans up or reallocates memory. The class uses the actual array provided; it does not copy the data from the suppled array.

Definition at line 152 of file vtkDataArrayTemplate.h.

template<class T>
void vtkDataArrayTemplate< T >::ExportToVoidPointer ( void *  out_ptr  ) 

This method copies the array data to the void pointer specified by the user. It is up to the user to allocate enough memory for the void pointer.

template<class T>
virtual void vtkDataArrayTemplate< T >::ComputeRange ( int  comp  )  [virtual]

Do not call. Use GetRange.

Reimplemented from vtkDataArray.

template<class T>
T* vtkDataArrayTemplate< T >::ResizeAndExtend ( vtkIdType  sz  )  [protected]

template<class T>
void vtkDataArrayTemplate< T >::ComputeScalarRange ( int  comp  )  [protected]

template<class T>
void vtkDataArrayTemplate< T >::ComputeVectorRange (  )  [protected]


Member Data Documentation

template<class T>
T* vtkDataArrayTemplate< T >::Array [protected]

Definition at line 167 of file vtkDataArrayTemplate.h.

template<class T>
int vtkDataArrayTemplate< T >::TupleSize [protected]

Definition at line 170 of file vtkDataArrayTemplate.h.

template<class T>
double* vtkDataArrayTemplate< T >::Tuple [protected]

Definition at line 171 of file vtkDataArrayTemplate.h.

template<class T>
int vtkDataArrayTemplate< T >::SaveUserArray [protected]

Definition at line 173 of file vtkDataArrayTemplate.h.


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

Generated on Fri Oct 10 09:34:54 2008 for VTK by  doxygen 1.5.6