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

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

Definition at line 54 of file vtkAbstractArray.h.
virtual int GetDataType ()=0
virtual int GetDataTypeSize ()=0
static unsigned long 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 void GetValues (vtkIdList *indices, vtkAbstractArray *output)=0
virtual void GetValues (vtkIdType p1, vtkIdType p2, vtkAbstractArray *output)=0
virtual int GetNumberOfElementComponents ()=0
virtual int GetElementComponentSize ()=0
virtual void * GetVoidPointer (vtkIdType id)=0
virtual void Squeeze ()=0
virtual bool IsNumeric ()=0
virtual void ConvertToContiguous (vtkDataArray **Data, vtkIdTypeArray **Offsets)=0
virtual void ConvertFromContiguous (vtkDataArray *Data, vtkIdTypeArray *Offsets)=0
virtual void DeepCopy (vtkAbstractArray *da)=0
virtual void CopyValue (int toIndex, int fromIndex, vtkAbstractArray *sourceArray)=0
virtual int Resize (vtkIdType numTuples)=0
void Reset ()
vtkIdType GetSize ()
vtkIdType GetMaxId ()
virtual void SetVoidArray (void *vtkNotUsed(array), vtkIdType vtkNotUsed(size), int vtkNotUsed(save))
virtual unsigned long GetActualMemorySize ()=0
void SetName (const char *name)
const char * GetName ()
virtual const char * GetDataTypeAsString (void)

Static Public Member Functions

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

Protected Member Functions

 vtkAbstractArray (vtkIdType numComp=1)
 ~vtkAbstractArray ()

Protected Attributes

vtkIdType Size
vtkIdType MaxId
char * Name
int DataType


Member Typedef Documentation

typedef vtkObject vtkAbstractArray::Superclass
 

Reimplemented from vtkObject.

Reimplemented in vtkStringArray.

Definition at line 57 of file vtkAbstractArray.h.


Constructor & Destructor Documentation

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

vtkAbstractArray::~vtkAbstractArray  )  [protected]
 


Member Function Documentation

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

Reimplemented from vtkObject.

Reimplemented in vtkStringArray.

static int vtkAbstractArray::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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkStringArray.

virtual int vtkAbstractArray::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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented in vtkStringArray.

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

Reimplemented from vtkObject.

Reimplemented in vtkStringArray.

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

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

virtual void vtkAbstractArray::Initialize  )  [pure virtual]
 

Release storage and reset array to initial state.

Implemented in vtkStringArray.

virtual int vtkAbstractArray::GetDataType  )  [pure virtual]
 

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

Implemented in vtkStringArray.

virtual int vtkAbstractArray::GetDataTypeSize  )  [pure virtual]
 

Return the size of the underlying data type. For a bit, 0 is returned. XXX FIXME How will this method behave for variably-sized objects?

Implemented in vtkStringArray.

static unsigned long vtkAbstractArray::GetDataTypeSize int  type  )  [static]
 

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

virtual void vtkAbstractArray::GetValues vtkIdList indices,
vtkAbstractArray output
[pure virtual]
 

Given a list of indices, return an array of values. The caller must ensure that enough room has been allocated within the output array to hold the data and that the data types match well enough to allow any necessary conversions.

Implemented in vtkStringArray.

virtual void vtkAbstractArray::GetValues vtkIdType  p1,
vtkIdType  p2,
vtkAbstractArray output
[pure virtual]
 

Get the values for the range of indices specified (i.e., p1->p2 inclusive). You must insure that the output array has been previously allocated with enough space to hold the data and that the type of the output array is compatible with the type of this array.

Implemented in vtkStringArray.

virtual int vtkAbstractArray::GetNumberOfElementComponents  )  [pure virtual]
 

Return the number of components in a single element of the array. For vtkDataArray and its subclasses, this is the number of components in a tuple. Arrays with variable-length elements (such as vtkStringArray and vtkCellArray) should return 0.

Implemented in vtkStringArray.

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

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

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

Implemented in vtkStringArray.

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

Deep copy of data. Implementation left to subclasses, which should support as many type conversions as possible given the data type.

Implemented in vtkStringArray.

virtual void vtkAbstractArray::CopyValue int  toIndex,
int  fromIndex,
vtkAbstractArray sourceArray
[pure virtual]
 

Copy an element from one array into an element on this array.

Implemented in vtkStringArray.

virtual void vtkAbstractArray::Squeeze  )  [pure virtual]
 

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

Implemented in vtkStringArray.

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

Resize the array while conserving the data.

Implemented in vtkStringArray.

void vtkAbstractArray::Reset  )  [inline]
 

Reset to an empty state, without freeing any memory.

Definition at line 126 of file vtkAbstractArray.h.

vtkIdType vtkAbstractArray::GetSize  )  [inline]
 

Return the size of the data.

Definition at line 132 of file vtkAbstractArray.h.

vtkIdType vtkAbstractArray::GetMaxId  )  [inline]
 

What is the maximum id currently in the array.

Definition at line 138 of file vtkAbstractArray.h.

virtual void vtkAbstractArray::SetVoidArray void *  vtkNotUsed(array),
vtkIdType   vtkNotUsed(size),
int   vtkNotUsed(save)
[inline, 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.

Definition at line 149 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 vtkStringArray.

void vtkAbstractArray::SetName const char *  name  ) 
 

Set/get array's name

const char* vtkAbstractArray::GetName  ) 
 

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.

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

Get the name of a data type as a string. XXX FIXME Find this macro and move it into vtkTypeNames.h or something.

Definition at line 171 of file vtkAbstractArray.h.

virtual bool 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 vtkStringArray.

virtual void vtkAbstractArray::ConvertToContiguous vtkDataArray **  Data,
vtkIdTypeArray **  Offsets
[pure virtual]
 

Flatten an arbitrary array into two separate numeric arrays. The first contains all the data in the source array; the second, the index of the end of each element. This function is meant to assist reading and writing arrays with variable-length elements such as vtkStringArray and vtkCellArray. The arrays will be created within the method body: the caller is responsible for deleting them when no longer needed.

For example, a string array with the elements "This" "Is" "A" "Test" would be converted into the following two arrays: Data: (unsigned char array) ThisIsATest Offsets: 3 5 6 10 vtkDataArray also implements this method, although in practice you shouldn't need it. It ignores the offsets array and takes its tuple-size information from the data array.

Implemented in vtkStringArray.

virtual void vtkAbstractArray::ConvertFromContiguous vtkDataArray Data,
vtkIdTypeArray Offsets
[pure virtual]
 

This is the inverse of ConvertToContiguous(), above.

Implemented in vtkStringArray.


Member Data Documentation

vtkIdType vtkAbstractArray::Size [protected]
 

Definition at line 214 of file vtkAbstractArray.h.

vtkIdType vtkAbstractArray::MaxId [protected]
 

Definition at line 215 of file vtkAbstractArray.h.

char* vtkAbstractArray::Name [protected]
 

Definition at line 217 of file vtkAbstractArray.h.

int vtkAbstractArray::DataType [protected]
 

Definition at line 219 of file vtkAbstractArray.h.


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 23:32:58 2008 for VTK by  doxygen 1.4.3-20050530