VTK
|
Abstract interface for N-dimensional arrays. More...
#include <vtkArray.h>
Public Types | |
enum | { DENSE = 0, SPARSE = 1 } |
typedef vtkObject | Superclass |
typedef vtkArrayExtents::CoordinateT | CoordinateT |
typedef vtkArrayExtents::DimensionT | DimensionT |
typedef vtkArrayExtents::SizeT | SizeT |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkArray * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual bool | IsDense ()=0 |
const vtkArrayRange | GetExtent (DimensionT dimension) |
virtual const vtkArrayExtents & | GetExtents ()=0 |
DimensionT | GetDimensions () |
SizeT | GetSize () |
virtual SizeT | GetNonNullSize ()=0 |
void | SetName (const vtkStdString &name) |
vtkStdString | GetName () |
void | SetDimensionLabel (DimensionT i, const vtkStdString &label) |
vtkStdString | GetDimensionLabel (DimensionT i) |
virtual void | GetCoordinatesN (const SizeT n, vtkArrayCoordinates &coordinates)=0 |
virtual vtkVariant | GetVariantValueN (const SizeT n)=0 |
virtual void | SetVariantValueN (const SizeT n, const vtkVariant &value)=0 |
virtual vtkArray * | DeepCopy ()=0 |
void | Resize (const CoordinateT i) |
void | Resize (const CoordinateT i, const CoordinateT j) |
void | Resize (const CoordinateT i, const CoordinateT j, const CoordinateT k) |
void | Resize (const vtkArrayRange &i) |
void | Resize (const vtkArrayRange &i, const vtkArrayRange &j) |
void | Resize (const vtkArrayRange &i, const vtkArrayRange &j, const vtkArrayRange &k) |
void | Resize (const vtkArrayExtents &extents) |
vtkVariant | GetVariantValue (CoordinateT i) |
vtkVariant | GetVariantValue (CoordinateT i, CoordinateT j) |
vtkVariant | GetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k) |
virtual vtkVariant | GetVariantValue (const vtkArrayCoordinates &coordinates)=0 |
void | SetVariantValue (CoordinateT i, const vtkVariant &value) |
void | SetVariantValue (CoordinateT i, CoordinateT j, const vtkVariant &value) |
void | SetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k, const vtkVariant &value) |
virtual void | SetVariantValue (const vtkArrayCoordinates &coordinates, const vtkVariant &value)=0 |
virtual void | CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const vtkArrayCoordinates &target_coordinates)=0 |
virtual void | CopyValue (vtkArray *source, const SizeT source_index, const vtkArrayCoordinates &target_coordinates)=0 |
virtual void | CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const SizeT target_index)=0 |
![]() | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkArray * | SafeDownCast (vtkObjectBase *o) |
static vtkArray * | CreateArray (int StorageType, int ValueType) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
![]() | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkArray () | |
~vtkArray () | |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Additional Inherited Members | |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Abstract interface for N-dimensional arrays.
vtkArray is the root of a hierarchy of arrays that can be used to store data with any number of dimensions. It provides an abstract interface for retrieving and setting array attributes that are independent of the type of values stored in the array - such as the number of dimensions, extents along each dimension, and number of values stored in the array.
To get and set array values, the vtkTypedArray template class derives from vtkArray and provides type-specific methods for retrieval and update.
Two concrete derivatives of vtkTypedArray are provided at the moment: vtkDenseArray and vtkSparseArray, which provide dense and sparse storage for arbitrary-dimension data, respectively. Toolkit users can create their own concrete derivatives that implement alternative storage strategies, such as compressed-sparse-row, etc. You could also create an array that provided read-only access to 'virtual' data, such as an array that returned a Fibonacci sequence, etc.
Definition at line 69 of file vtkArray.h.
typedef vtkObject vtkArray::Superclass |
Definition at line 72 of file vtkArray.h.
Definition at line 75 of file vtkArray.h.
Definition at line 76 of file vtkArray.h.
Definition at line 77 of file vtkArray.h.
anonymous enum |
Enumerator | |
---|---|
DENSE |
Used with CreateArray() to create dense arrays. |
SPARSE |
Used with CreateArray() to create sparse arrays. |
Definition at line 80 of file vtkArray.h.
|
protected |
|
protected |
|
static |
|
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 vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
Reimplemented in vtkTypeTemplate< vtkSparseArray< T >, vtkTypedArray< T > >, vtkTypeTemplate< vtkTypedArray< T >, vtkArray >, and vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > >.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
Reimplemented in vtkTypeTemplate< vtkSparseArray< T >, vtkTypedArray< T > >, vtkTypeTemplate< vtkTypedArray< T >, vtkArray >, and vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > >.
vtkArray* vtkArray::NewInstance | ( | ) | const |
|
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 vtkSparseArray< T >, vtkTypedArray< T >, and vtkDenseArray< T >.
Creates a new array where StorageType is one of vtkArray::DENSE or vtkArray::SPARSE, and ValueType is one of VTK_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT, VTK_UNSIGNED_SHORT, VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_DOUBLE, VTK_ID_TYPE, or VTK_STRING. The caller is responsible for the lifetime of the returned object.
|
pure virtual |
Returns true iff the underlying array storage is "dense", i.e. that GetSize() and GetNonNullSize() will always return the same value. If not, the array is "sparse".
Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.
void vtkArray::Resize | ( | const CoordinateT | i | ) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
void vtkArray::Resize | ( | const CoordinateT | i, |
const CoordinateT | j | ||
) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
void vtkArray::Resize | ( | const CoordinateT | i, |
const CoordinateT | j, | ||
const CoordinateT | k | ||
) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
void vtkArray::Resize | ( | const vtkArrayRange & | i | ) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
void vtkArray::Resize | ( | const vtkArrayRange & | i, |
const vtkArrayRange & | j | ||
) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
void vtkArray::Resize | ( | const vtkArrayRange & | i, |
const vtkArrayRange & | j, | ||
const vtkArrayRange & | k | ||
) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
void vtkArray::Resize | ( | const vtkArrayExtents & | extents | ) |
Resizes the array to the given extents (number of dimensions and size of each dimension). Note that concrete implementations of vtkArray may place constraints on the the extents that they will store, so you cannot assume that GetExtents() will always return the same value passed to Resize(). The contents of the array are undefined after calling Resize() - you should initialize its contents accordingly. In particular, dimension-labels will be undefined, dense array values will be undefined, and sparse arrays will be empty.
const vtkArrayRange vtkArray::GetExtent | ( | DimensionT | dimension | ) |
Returns the extent (valid coordinate range) along the given dimension.
|
pure virtual |
Returns the extents (the number of dimensions and size along each dimension) of the array.
Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.
DimensionT vtkArray::GetDimensions | ( | ) |
Returns the number of dimensions stored in the array. Note that this is the same as calling GetExtents().GetDimensions().
SizeT vtkArray::GetSize | ( | ) |
Returns the number of values stored in the array. Note that this is the same as calling GetExtents().GetSize(), and represents the maximum number of values that could ever be stored using the current extents. This is equal to the number of values stored in a dense array, but may be larger than the number of values stored in a sparse array.
|
pure virtual |
Returns the number of non-null values stored in the array. Note that this value will equal GetSize() for dense arrays, and will be less-than-or-equal to GetSize() for sparse arrays.
Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.
void vtkArray::SetName | ( | const vtkStdString & | name | ) |
Sets the array name.
vtkStdString vtkArray::GetName | ( | ) |
Returns the array name.
void vtkArray::SetDimensionLabel | ( | DimensionT | i, |
const vtkStdString & | label | ||
) |
Sets the label for the i-th array dimension.
vtkStdString vtkArray::GetDimensionLabel | ( | DimensionT | i | ) |
Returns the label for the i-th array dimension.
|
pure virtual |
Returns the coordinates of the n-th value in the array, where n is in the range [0, GetNonNullSize()). Note that the order in which coordinates are visited is undefined, but is guaranteed to match the order in which values are visited using vtkTypedArray::GetValueN() and vtkTypedArray::SetValueN().
Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.
|
inline |
Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Definition at line 231 of file vtkArray.h.
|
inline |
Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Definition at line 236 of file vtkArray.h.
|
inline |
Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Definition at line 241 of file vtkArray.h.
|
pure virtual |
Returns the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Implemented in vtkTypedArray< T >.
|
pure virtual |
Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). This is useful for efficiently visiting every value in the array. Note that the order in which values are visited is undefined, but is guaranteed to match the order used by vtkArray::GetCoordinatesN().
Implemented in vtkTypedArray< T >.
|
inline |
Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Definition at line 246 of file vtkArray.h.
|
inline |
Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Definition at line 251 of file vtkArray.h.
|
inline |
Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Definition at line 256 of file vtkArray.h.
|
pure virtual |
Overwrites the value stored in the array at the given coordinates. Note that the number of dimensions in the supplied coordinates must match the number of dimensions in the array.
Implemented in vtkTypedArray< T >.
|
pure virtual |
Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). This is useful for efficiently visiting every value in the array. Note that the order in which values are visited is undefined, but is guaranteed to match the order used by vtkArray::GetCoordinatesN().
Implemented in vtkTypedArray< T >.
|
pure virtual |
Overwrites a value with a value retrieved from another array. Both arrays must store the same data types.
Implemented in vtkTypedArray< T >.
|
pure virtual |
Overwrites a value with a value retrieved from another array. Both arrays must store the same data types.
Implemented in vtkTypedArray< T >.
|
pure virtual |
Overwrites a value with a value retrieved from another array. Both arrays must store the same data types.
Implemented in vtkTypedArray< T >.
|
pure virtual |
Returns a new array that is a deep copy of this array.
Implemented in vtkSparseArray< T >, and vtkDenseArray< T >.