Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

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.

Created by:
  • King, Brad
CVS contributions (if > 5%):
  • King, Brad (95%)
CVS logs (CVSweb):
  • .h (/Common/vtkDataArrayTemplate.h)
  • .txx (/Common/vtkDataArrayTemplate.txx)

Definition at line 39 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 GetTuple (vtkIdType i, double *tuple)
void Squeeze ()
virtual void 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)
T * WritePointer (vtkIdType id, vtkIdType number)
void DeepCopy (vtkDataArray *da)
virtual void ComputeRange (int comp)
void SetTuple (vtkIdType i, const float *tuple)
void SetTuple (vtkIdType i, const double *tuple)
void InsertTuple (vtkIdType i, const float *tuple)
void InsertTuple (vtkIdType i, const double *tuple)
vtkIdType InsertNextTuple (const float *tuple)
vtkIdType InsertNextTuple (const double *tuple)
void SetValue (vtkIdType id, T value)
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 42 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 53 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 >::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 >::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>
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>
void vtkDataArrayTemplate< T >::Squeeze  )  [inline, virtual]
 

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

Implements vtkDataArray.

Definition at line 86 of file vtkDataArrayTemplate.h.

References vtkDataArrayTemplate< T >::ResizeAndExtend().

template<class T>
virtual void 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 92 of file vtkDataArrayTemplate.h.

References vtkDataArrayTemplate< T >::Array, and vtkIdType.

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 97 of file vtkDataArrayTemplate.h.

References vtkDataArrayTemplate< T >::Array, and vtkIdType.

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

References vtkDataArrayTemplate< T >::Array, and vtkIdType.

Referenced by vtkDataArrayTemplate< T >::GetVoidPointer().

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.

References vtkDataArrayTemplate< T >::GetPointer(), and vtkIdType.

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.

Referenced by vtkDataArrayTemplate< T >::SetVoidArray().

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.

References vtkDataArrayTemplate< T >::SetArray(), and vtkIdType.

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]
 

Referenced by vtkDataArrayTemplate< T >::Squeeze().

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 162 of file vtkDataArrayTemplate.h.

Referenced by vtkDataArrayTemplate< T >::GetPointer(), vtkDataArrayTemplate< T >::GetValue(), and vtkDataArrayTemplate< T >::SetValue().

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

Definition at line 165 of file vtkDataArrayTemplate.h.

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

Definition at line 166 of file vtkDataArrayTemplate.h.

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

Definition at line 168 of file vtkDataArrayTemplate.h.


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