vtkAbstractArray Class Reference

#include <vtkAbstractArray.h>

Inheritance diagram for vtkAbstractArray:

Inheritance graph
[legend]
Collaboration diagram for vtkAbstractArray:

Collaboration graph
[legend]

List of all members.


Detailed Description

Abstract superclass for all arrays.

vtkAbstractArray is an abstract superclass for data array objects. This class defines an API that all subclasses must support. The data type must be assignable and copy-constructible, but no other assumptions about its type are made. Most of the subclasses of this array deal with numeric data either as scalars or tuples of scalars. A program can use the IsNumeric() method to check whether an instance of vtkAbstractArray contains numbers. It is also possible to test for this by attempting to SafeDownCast an array to an instance of vtkDataArray, although this assumes that all numeric arrays will always be descended from vtkDataArray.

Every array has a character-string name. The naming of the array occurs automatically when it is instantiated, but you are free to change this name using the SetName() method. (The array name is used for data manipulation.)

See also:
vtkDataArray vtkStringArray vtkCellArray
Tests:
vtkAbstractArray (Tests)

Definition at line 58 of file vtkAbstractArray.h.

virtual int GetDataTypeSize ()=0
static int GetDataTypeSize (int type)

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual int Allocate (vtkIdType sz, vtkIdType ext=1000)=0
virtual void Initialize ()=0
virtual int GetDataType ()=0
virtual int GetElementComponentSize ()=0
virtual void SetNumberOfTuples (vtkIdType number)=0
virtual void SetTuple (vtkIdType i, vtkIdType j, vtkAbstractArray *source)=0
virtual void InsertTuple (vtkIdType i, vtkIdType j, vtkAbstractArray *source)=0
virtual vtkIdType InsertNextTuple (vtkIdType j, vtkAbstractArray *source)=0
virtual void GetTuples (vtkIdList *ptIds, vtkAbstractArray *output)
virtual void GetTuples (vtkIdType p1, vtkIdType p2, vtkAbstractArray *output)
virtual void * GetVoidPointer (vtkIdType id)=0
virtual void DeepCopy (vtkAbstractArray *da)
virtual void Squeeze ()=0
virtual int Resize (vtkIdType numTuples)=0
virtual void ExportToVoidPointer (void *vtkNotUsed(out_ptr))
virtual unsigned long GetActualMemorySize ()=0
virtual int IsNumeric ()=0
virtual vtkArrayIteratorNewIterator ()=0
virtual void DataChanged ()=0
virtual void ClearLookup ()=0
vtkInformationGetInformation ()
virtual void SetNumberOfComponents (int)
int GetNumberOfComponents ()
vtkIdType GetNumberOfTuples ()
virtual void InterpolateTuple (vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights)=0
virtual void InterpolateTuple (vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t)=0
void Reset ()
vtkIdType GetSize ()
vtkIdType GetMaxId ()
virtual void SetVoidArray (void *vtkNotUsed(array), vtkIdType vtkNotUsed(size), int vtkNotUsed(save))=0
virtual void SetName (const char *)
virtual char * GetName ()
virtual const char * GetDataTypeAsString (void)
virtual unsigned long GetDataSize ()
virtual vtkIdType LookupValue (vtkVariant value)=0
virtual void LookupValue (vtkVariant value, vtkIdList *ids)=0

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkAbstractArraySafeDownCast (vtkObject *o)
static vtkAbstractArrayCreateArray (int dataType)

Protected Member Functions

 vtkAbstractArray (vtkIdType numComp=1)
 ~vtkAbstractArray ()
virtual void SetInformation (vtkInformation *)

Protected Attributes

vtkIdType Size
vtkIdType MaxId
int NumberOfComponents
char * Name
bool RebuildArray
vtkInformationInformation

Member Typedef Documentation


Constructor & Destructor Documentation

vtkAbstractArray::vtkAbstractArray ( vtkIdType  numComp = 1  )  [protected]

vtkAbstractArray::~vtkAbstractArray (  )  [protected]


Member Function Documentation

virtual const char* vtkAbstractArray::GetClassName (  )  [virtual]

static int vtkAbstractArray::IsTypeOf ( const char *  name  )  [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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtk__Int64Array, vtkBitArray, vtkCharArray, vtkDataArray, vtkDoubleArray, vtkFloatArray, vtkIdTypeArray, vtkIntArray, vtkLongArray, vtkLongLongArray, vtkShortArray, vtkSignedCharArray, vtkStringArray, vtkUnsigned__Int64Array, vtkUnsignedCharArray, vtkUnsignedIntArray, vtkUnsignedLongArray, vtkUnsignedLongLongArray, vtkUnsignedShortArray, and vtkVariantArray.

virtual int vtkAbstractArray::IsA ( const char *  name  )  [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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtk__Int64Array, vtkBitArray, vtkCharArray, vtkDataArray, vtkDoubleArray, vtkFloatArray, vtkIdTypeArray, vtkIntArray, vtkLongArray, vtkLongLongArray, vtkShortArray, vtkSignedCharArray, vtkStringArray, vtkUnsigned__Int64Array, vtkUnsignedCharArray, vtkUnsignedIntArray, vtkUnsignedLongArray, vtkUnsignedLongLongArray, vtkUnsignedShortArray, and vtkVariantArray.

static vtkAbstractArray* vtkAbstractArray::SafeDownCast ( vtkObject o  )  [static]

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

Reimplemented in vtk__Int64Array, vtkBitArray, vtkCharArray, vtkDataArray, vtkDataArrayTemplate< T >, vtkDoubleArray, vtkFloatArray, vtkIdTypeArray, vtkIntArray, vtkLongArray, vtkLongLongArray, vtkShortArray, vtkSignedCharArray, vtkStringArray, vtkUnsigned__Int64Array, vtkUnsignedCharArray, vtkUnsignedIntArray, vtkUnsignedLongArray, vtkUnsignedLongLongArray, vtkUnsignedShortArray, and vtkVariantArray.

virtual int vtkAbstractArray::Allocate ( vtkIdType  sz,
vtkIdType  ext = 1000 
) [pure virtual]

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

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::Initialize (  )  [pure virtual]

Release storage and reset array to initial state.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual int vtkAbstractArray::GetDataType (  )  [pure virtual]

virtual int vtkAbstractArray::GetDataTypeSize (  )  [pure virtual]

Return the size of the underlying data type. For a bit, 0 is returned. For string 0 is returned. Arrays with variable length components return 0.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

static int vtkAbstractArray::GetDataTypeSize ( int  type  )  [static]

Return the size of the underlying data type. For a bit, 0 is returned. For string 0 is returned. Arrays with variable length components return 0.

virtual int vtkAbstractArray::GetElementComponentSize (  )  [pure virtual]

Return the size, in bytes, of the lowest-level element of an array. For vtkDataArray and subclasses this is the size of the data type. For vtkStringArray, this is sizeof(vtkStdString::value_type), which winds up being sizeof(char).

Implemented in vtkDataArray, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::SetNumberOfComponents ( int   )  [virtual]

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

int vtkAbstractArray::GetNumberOfComponents (  )  [inline]

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

Definition at line 93 of file vtkAbstractArray.h.

virtual void vtkAbstractArray::SetNumberOfTuples ( vtkIdType  number  )  [pure virtual]

Set the number of tuples (a component group) in the array. Note that this may allocate space depending on the number of components. Also note that if allocation is performed no copy is performed so existing data will be lost (if data conservation is sought, one may use the Resize method instead).

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

vtkIdType vtkAbstractArray::GetNumberOfTuples (  )  [inline]

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

Definition at line 105 of file vtkAbstractArray.h.

virtual void vtkAbstractArray::SetTuple ( vtkIdType  i,
vtkIdType  j,
vtkAbstractArray source 
) [pure virtual]

Set the tuple at the ith location using the jth tuple in the source array. This method assumes that the two arrays have the same type and structure. Note that range checking and memory allocation is not performed; use in conjunction with SetNumberOfTuples() to allocate space.

Implemented in vtkBitArray, vtkDataArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::InsertTuple ( vtkIdType  i,
vtkIdType  j,
vtkAbstractArray source 
) [pure virtual]

Insert the jth tuple in the source array, at ith location in this array. Note that memory allocation is performed as necessary to hold the data.

Implemented in vtkBitArray, vtkDataArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual vtkIdType vtkAbstractArray::InsertNextTuple ( vtkIdType  j,
vtkAbstractArray source 
) [pure virtual]

Insert the jth tuple in the source array, at the end in this array. Note that memory allocation is performed as necessary to hold the data. Returns the location at which the data was inserted.

Implemented in vtkBitArray, vtkDataArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::GetTuples ( vtkIdList ptIds,
vtkAbstractArray output 
) [virtual]

Given a list of point ids, return an array of tuples. You must insure that the output array has been previously allocated with enough space to hold the data.

Reimplemented in vtkDataArray, and vtkStringArray.

virtual void vtkAbstractArray::GetTuples ( vtkIdType  p1,
vtkIdType  p2,
vtkAbstractArray output 
) [virtual]

Get the tuples for the range of points ids specified (i.e., p1->p2 inclusive). You must insure that the output array has been previously allocated with enough space to hold the data.

Reimplemented in vtkDataArray, and vtkStringArray.

virtual void* vtkAbstractArray::GetVoidPointer ( vtkIdType  id  )  [pure virtual]

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

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::DeepCopy ( vtkAbstractArray da  )  [virtual]

Deep copy of data. Implementation left to subclasses, which should support as many type conversions as possible given the data type. Subclasses should call vtkAbstractArray::DeepCopy() so that the information object (if one exists) is copied from da.

Reimplemented in vtkBitArray, vtkDataArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::InterpolateTuple ( vtkIdType  i,
vtkIdList ptIndices,
vtkAbstractArray source,
double *  weights 
) [pure virtual]

Set the ith tuple in this array as the interpolated tuple value, given the ptIndices in the source array and associated interpolation weights. This method assumes that the two arrays are of the same type and strcuture.

Implemented in vtkDataArray, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::InterpolateTuple ( vtkIdType  i,
vtkIdType  id1,
vtkAbstractArray source1,
vtkIdType  id2,
vtkAbstractArray source2,
double  t 
) [pure virtual]

Insert the ith tuple in this array as interpolated from the two values, p1 and p2, and an interpolation factor, t. The interpolation factor ranges from (0,1), with t=0 located at p1. This method assumes that the three arrays are of the same type. p1 is value at index id1 in source1, while, p2 is value at index id2 in source2.

Implemented in vtkDataArray, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::Squeeze (  )  [pure virtual]

Free any unnecessary memory. Description: Resize object to just fit data requirement. Reclaims extra memory.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual int vtkAbstractArray::Resize ( vtkIdType  numTuples  )  [pure virtual]

Resize the array while conserving the data. Returns 1 if resizing succeeded and 0 otherwise.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

void vtkAbstractArray::Reset (  )  [inline]

Reset to an empty state, without freeing any memory.

Definition at line 176 of file vtkAbstractArray.h.

vtkIdType vtkAbstractArray::GetSize (  )  [inline]

Return the size of the data.

Definition at line 182 of file vtkAbstractArray.h.

vtkIdType vtkAbstractArray::GetMaxId (  )  [inline]

What is the maximum id currently in the array.

Definition at line 188 of file vtkAbstractArray.h.

virtual void vtkAbstractArray::SetVoidArray ( void *  vtkNotUsedarray,
vtkIdType   vtkNotUsedsize,
int   vtkNotUsedsave 
) [pure virtual]

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

virtual void vtkAbstractArray::ExportToVoidPointer ( void *  vtkNotUsedout_ptr  )  [inline, virtual]

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.

Definition at line 207 of file vtkAbstractArray.h.

virtual unsigned long vtkAbstractArray::GetActualMemorySize (  )  [pure virtual]

Return the memory in kilobytes consumed by this data array. 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. The information returned is valid only after the pipeline has been updated.

Implemented in vtkDataArray, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::SetName ( const char *   )  [virtual]

Set/get array's name

virtual char* vtkAbstractArray::GetName (  )  [virtual]

Set/get array's name

virtual const char* vtkAbstractArray::GetDataTypeAsString ( void   )  [inline, virtual]

Get the name of a data type as a string.

Definition at line 225 of file vtkAbstractArray.h.

static vtkAbstractArray* vtkAbstractArray::CreateArray ( int  dataType  )  [static]

Creates an array for dataType where dataType is one of VTK_BIT, VTK_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT, VTK_UNSIGNED_SHORT, VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_DOUBLE, VTK_DOUBLE, VTK_ID_TYPE, VTK_STRING. Note that the data array returned has be deleted by the user.

virtual int vtkAbstractArray::IsNumeric (  )  [pure virtual]

This method is here to make backward compatibility easier. It must return true if and only if an array contains numeric data.

Implemented in vtkDataArray, vtkStringArray, and vtkVariantArray.

virtual vtkArrayIterator* vtkAbstractArray::NewIterator (  )  [pure virtual]

Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual unsigned long vtkAbstractArray::GetDataSize (  )  [inline, virtual]

Returns the size of the data in DataTypeSize units. Thus, the number of bytes for the data can be computed by GetDataSize() * GetDataTypeSize(). Non-contiguous or variable- size arrays need to override this method.

Reimplemented in vtkStringArray.

Definition at line 249 of file vtkAbstractArray.h.

virtual vtkIdType vtkAbstractArray::LookupValue ( vtkVariant  value  )  [pure virtual]

Return the indices where a specific value appears.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::LookupValue ( vtkVariant  value,
vtkIdList ids 
) [pure virtual]

Return the indices where a specific value appears.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::DataChanged (  )  [pure virtual]

Tell the array explicitly that the data has changed. This is only necessary to call when you modify the array contents without using the array's API (i.e. you retrieve a pointer to the data and modify the array contents). You need to call this so that the fast lookup will know to rebuild itself. Otherwise, the lookup functions will give incorrect results.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

virtual void vtkAbstractArray::ClearLookup (  )  [pure virtual]

Delete the associated fast lookup data structure on this array, if it exists. The lookup will be rebuilt on the next call to a lookup function.

Implemented in vtkBitArray, vtkDataArrayTemplate< T >, vtkStringArray, and vtkVariantArray.

vtkInformation* vtkAbstractArray::GetInformation (  ) 

Get an information object that can be used to annotate the array. This is NULL by default; you are responsible for allocating an information object if none already exists.

virtual void vtkAbstractArray::SetInformation ( vtkInformation  )  [protected, virtual]

Set an information object that can be used to annotate the array. This is NULL by default; you are responsible for allocating an information object if none already exists.


Member Data Documentation

Definition at line 297 of file vtkAbstractArray.h.

Definition at line 298 of file vtkAbstractArray.h.

Definition at line 299 of file vtkAbstractArray.h.

char* vtkAbstractArray::Name [protected]

Definition at line 301 of file vtkAbstractArray.h.

Definition at line 303 of file vtkAbstractArray.h.

Definition at line 305 of file vtkAbstractArray.h.


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

Generated on Sat Dec 27 13:15:59 2008 for VTK by  doxygen 1.5.6