VTK
|
Contiguous storage for N-way arrays. More...
#include <vtkDenseArray.h>
Classes | |
class | HeapMemoryBlock |
class | MemoryBlock |
class | StaticMemoryBlock |
Public Types | |
typedef vtkArray::CoordinateT | CoordinateT |
typedef vtkArray::DimensionT | DimensionT |
typedef vtkArray::SizeT | SizeT |
Public Types inherited from vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > > | |
typedef vtkTypedArray< T > | Superclass |
Public Types inherited from vtkTypedArray< T > | |
typedef vtkArray::CoordinateT | CoordinateT |
typedef vtkArray::SizeT | SizeT |
Public Types inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray > | |
typedef vtkArray | Superclass |
Public Types inherited from vtkArray | |
enum | { DENSE = 0, SPARSE = 1 } |
typedef vtkObject | Superclass |
typedef vtkArrayExtents::CoordinateT | CoordinateT |
typedef vtkArrayExtents::DimensionT | DimensionT |
typedef vtkArrayExtents::SizeT | SizeT |
Public Types inherited from vtkObject | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
void | PrintSelf (ostream &os, vtkIndent indent) |
bool | IsDense () |
const vtkArrayExtents & | GetExtents () |
SizeT | GetNonNullSize () |
void | GetCoordinatesN (const SizeT n, vtkArrayCoordinates &coordinates) |
vtkArray * | DeepCopy () |
const T & | GetValue (CoordinateT i) |
const T & | GetValue (CoordinateT i, CoordinateT j) |
const T & | GetValue (CoordinateT i, CoordinateT j, CoordinateT k) |
const T & | GetValue (const vtkArrayCoordinates &coordinates) |
const T & | GetValueN (const SizeT n) |
void | SetValue (CoordinateT i, const T &value) |
void | SetValue (CoordinateT i, CoordinateT j, const T &value) |
void | SetValue (CoordinateT i, CoordinateT j, CoordinateT k, const T &value) |
void | SetValue (const vtkArrayCoordinates &coordinates, const T &value) |
void | SetValueN (const SizeT n, const T &value) |
Public Member Functions inherited from vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > > | |
vtkDenseArray< T > * | NewInstance () const |
Public Member Functions inherited from vtkTypedArray< T > | |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual vtkVariant | GetVariantValue (const vtkArrayCoordinates &coordinates) |
virtual vtkVariant | GetVariantValueN (const SizeT n) |
virtual void | SetVariantValue (const vtkArrayCoordinates &coordinates, const vtkVariant &value) |
virtual void | SetVariantValueN (const SizeT n, const vtkVariant &value) |
virtual void | CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const vtkArrayCoordinates &target_coordinates) |
virtual void | CopyValue (vtkArray *source, const SizeT source_index, const vtkArrayCoordinates &target_coordinates) |
virtual void | CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const SizeT target_index) |
Public Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray > | |
vtkTypedArray< T > * | NewInstance () const |
Public Member Functions inherited from vtkArray | |
vtkArray * | NewInstance () const |
const vtkArrayRange | GetExtent (DimensionT dimension) |
DimensionT | GetDimensions () |
SizeT | GetSize () |
void | SetName (const vtkStdString &name) |
vtkStdString | GetName () |
void | SetDimensionLabel (DimensionT i, const vtkStdString &label) |
vtkStdString | GetDimensionLabel (DimensionT i) |
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) |
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) |
Public Member Functions inherited from vtkObject | |
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) |
Public Member Functions inherited from vtkObjectBase | |
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 vtkDenseArray< T > * | New () |
Static Public Member Functions inherited from vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > > | |
static vtkDenseArray< T > * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray > | |
static vtkTypedArray< T > * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkArray | |
static int | IsTypeOf (const char *type) |
static vtkArray * | SafeDownCast (vtkObjectBase *o) |
static vtkArray * | CreateArray (int StorageType, int ValueType) |
Static Public Member Functions inherited from vtkObject | |
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 Public Member Functions inherited from vtkObjectBase | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
void | ExternalStorage (const vtkArrayExtents &extents, MemoryBlock *storage) |
void | Fill (const T &value) |
T & | operator[] (const vtkArrayCoordinates &coordinates) |
const T * | GetStorage () const |
T * | GetStorage () |
vtkDenseArray () | |
~vtkDenseArray () | |
Additional Inherited Members | |
Protected Member Functions inherited from vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > > | |
virtual vtkObjectBase * | NewInstanceInternal () const |
virtual int | IsA (const char *type) |
vtkTypeTemplate () | |
Protected Member Functions inherited from vtkTypedArray< T > | |
vtkTypedArray () | |
~vtkTypedArray () | |
Protected Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray > | |
vtkTypeTemplate () | |
Protected Member Functions inherited from vtkArray | |
vtkArray () | |
~vtkArray () | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Static Protected Member Functions inherited from vtkTypeTemplate< vtkDenseArray< T >, vtkTypedArray< T > > | |
static int | IsTypeOf (const char *type) |
Static Protected Member Functions inherited from vtkTypeTemplate< vtkTypedArray< T >, vtkArray > | |
static int | IsTypeOf (const char *type) |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Contiguous storage for N-way arrays.
vtkDenseArray is a concrete vtkArray implementation that stores values using a contiguous block of memory. Values are stored with fortran ordering, meaning that if you iterated over the memory block, the left-most coordinates would vary the fastest.
In addition to the retrieval and update methods provided by vtkTypedArray, vtkDenseArray provides methods to:
Fill the entire array with a specific value.
Retrieve a pointer to the storage memory block.
Definition at line 60 of file vtkDenseArray.h.
typedef vtkArray::CoordinateT vtkDenseArray< T >::CoordinateT |
Definition at line 67 of file vtkDenseArray.h.
typedef vtkArray::DimensionT vtkDenseArray< T >::DimensionT |
Definition at line 68 of file vtkDenseArray.h.
typedef vtkArray::SizeT vtkDenseArray< T >::SizeT |
Definition at line 69 of file vtkDenseArray.h.
|
protected |
Stores the current array extents (its size along each dimension)
|
protected |
Stores the current array extents (its size along each dimension)
|
static |
|
virtual |
|
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".
Implements vtkArray.
|
virtual |
Returns the extents (the number of dimensions and size along each dimension) of the array.
Implements vtkArray.
|
virtual |
|
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().
Implements vtkArray.
|
virtual |
Returns a new array that is a deep copy of this array.
Implements vtkArray.
|
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.
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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().
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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.
Implements vtkTypedArray< T >.
|
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().
Implements vtkTypedArray< T >.
void vtkDenseArray< T >::ExternalStorage | ( | const vtkArrayExtents & | extents, |
MemoryBlock * | storage | ||
) |
Initializes the array to use an externally-allocated memory block. The supplied MemoryBlock must be large enough to store extents.GetSize() values. The contents of the memory must be stored contiguously with fortran ordering, Dimension-labels are undefined after calling ExternalStorage() - you should initialize them accordingly. The array will use the supplied memory for storage until the array goes out of scope, is configured to use a different memory block by calling ExternalStorage() again, or is configured to use internally-allocated memory by calling Resize(). Note that the array will delete the supplied memory block when it is no longer in use. caller's responsibility to ensure that the memory does not go out-of-scope until the array has been destroyed or is no longer using it.
void vtkDenseArray< T >::Fill | ( | const T & | value | ) |
Fills every element in the array with the given value.
T& vtkDenseArray< T >::operator[] | ( | const vtkArrayCoordinates & | coordinates | ) |
Returns a value by-reference, which is useful for performance and code-clarity.
const T* vtkDenseArray< T >::GetStorage | ( | ) | const |
Returns a read-only reference to the underlying storage. Values are stored contiguously with fortran ordering.
T* vtkDenseArray< T >::GetStorage | ( | ) |
Returns a mutable reference to the underlying storage. Values are stored contiguously with fortran ordering. Use at your own risk!