VTK
9.1.0
|
Provides a type-specific interface to N-way arrays. More...
#include <vtkTypedArray.h>
Public Types | |
typedef vtkArray::CoordinateT | CoordinateT |
typedef vtkArray::SizeT | SizeT |
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 Member Functions | |
vtkTemplateTypeMacro (vtkTypedArray< T >, vtkArray) | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
vtkVariant | GetVariantValue (const vtkArrayCoordinates &coordinates) override |
Returns the value stored in the array at the given coordinates. | |
vtkVariant | GetVariantValueN (const SizeT n) override |
Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). | |
void | SetVariantValue (const vtkArrayCoordinates &coordinates, const vtkVariant &value) override |
Overwrites the value stored in the array at the given coordinates. | |
void | SetVariantValueN (const SizeT n, const vtkVariant &value) override |
Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). | |
void | CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const vtkArrayCoordinates &target_coordinates) override |
Overwrites a value with a value retrieved from another array. | |
void | CopyValue (vtkArray *source, const SizeT source_index, const vtkArrayCoordinates &target_coordinates) override |
Overwrites a value with a value retrieved from another array. | |
void | CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const SizeT target_index) override |
Overwrites a value with a value retrieved from another array. | |
virtual const T & | GetValueN (const SizeT n)=0 |
Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). | |
virtual void | SetValueN (const SizeT n, const T &value)=0 |
Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). | |
vtkVariant | GetVariantValue (CoordinateT i) |
Returns the value stored in the array at the given coordinates. | |
vtkVariant | GetVariantValue (CoordinateT i, CoordinateT j) |
vtkVariant | GetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k) |
virtual vtkVariant | GetVariantValue (const vtkArrayCoordinates &coordinates)=0 |
Returns the value stored in the array at the given coordinates. | |
void | SetVariantValue (CoordinateT i, const vtkVariant &value) |
Overwrites the value stored in the array at the given coordinates. | |
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 |
Overwrites the value stored in the array at the given coordinates. | |
virtual const T & | GetValue (CoordinateT i)=0 |
Returns the value stored in the array at the given coordinates. | |
virtual const T & | GetValue (CoordinateT i, CoordinateT j)=0 |
Returns the value stored in the array at the given coordinates. | |
virtual const T & | GetValue (CoordinateT i, CoordinateT j, CoordinateT k)=0 |
Returns the value stored in the array at the given coordinates. | |
virtual const T & | GetValue (const vtkArrayCoordinates &coordinates)=0 |
Returns the value stored in the array at the given coordinates. | |
virtual void | SetValue (CoordinateT i, const T &value)=0 |
Overwrites the value stored in the array at the given coordinates. | |
virtual void | SetValue (CoordinateT i, CoordinateT j, const T &value)=0 |
Overwrites the value stored in the array at the given coordinates. | |
virtual void | SetValue (CoordinateT i, CoordinateT j, CoordinateT k, const T &value)=0 |
Overwrites the value stored in the array at the given coordinates. | |
virtual void | SetValue (const vtkArrayCoordinates &coordinates, const T &value)=0 |
Overwrites the value stored in the array at the given coordinates. | |
Public Member Functions inherited from vtkArray | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
vtkArray * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
virtual bool | IsDense ()=0 |
Returns true iff the underlying array storage is "dense", i.e. | |
vtkArrayRange | GetExtent (DimensionT dimension) |
Returns the extent (valid coordinate range) along the given dimension. | |
virtual const vtkArrayExtents & | GetExtents ()=0 |
Returns the extents (the number of dimensions and size along each dimension) of the array. | |
DimensionT | GetDimensions () |
Returns the number of dimensions stored in the array. | |
SizeT | GetSize () |
Returns the number of values stored in the array. | |
virtual SizeT | GetNonNullSize ()=0 |
Returns the number of non-null values stored in the array. | |
void | SetName (const vtkStdString &name) |
Sets the array name. | |
vtkStdString | GetName () |
Returns the array name. | |
void | SetDimensionLabel (DimensionT i, const vtkStdString &label) |
Sets the label for the i-th array dimension. | |
vtkStdString | GetDimensionLabel (DimensionT i) |
Returns the label for the i-th array dimension. | |
virtual void | GetCoordinatesN (const SizeT n, vtkArrayCoordinates &coordinates)=0 |
Returns the coordinates of the n-th value in the array, where n is in the range [0, GetNonNullSize()). | |
virtual vtkVariant | GetVariantValueN (const SizeT n)=0 |
Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). | |
virtual void | SetVariantValueN (const SizeT n, const vtkVariant &value)=0 |
Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). | |
virtual vtkArray * | DeepCopy ()=0 |
Returns a new array that is a deep copy of this array. | |
void | Resize (const CoordinateT i) |
Resizes the array to the given extents (number of dimensions and size of each dimension). | |
void | Resize (const CoordinateT i, const CoordinateT j) |
Resizes the array to the given extents (number of dimensions and size of each dimension). | |
void | 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). | |
void | Resize (const vtkArrayRange &i) |
Resizes the array to the given extents (number of dimensions and size of each dimension). | |
void | Resize (const vtkArrayRange &i, const vtkArrayRange &j) |
Resizes the array to the given extents (number of dimensions and size of each dimension). | |
void | 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). | |
void | Resize (const vtkArrayExtents &extents) |
Resizes the array to the given extents (number of dimensions and size of each dimension). | |
vtkVariant | GetVariantValue (CoordinateT i) |
Returns the value stored in the array at the given coordinates. | |
vtkVariant | GetVariantValue (CoordinateT i, CoordinateT j) |
Returns the value stored in the array at the given coordinates. | |
vtkVariant | GetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k) |
Returns the value stored in the array at the given coordinates. | |
void | SetVariantValue (CoordinateT i, const vtkVariant &value) |
Overwrites the value stored in the array at the given coordinates. | |
void | SetVariantValue (CoordinateT i, CoordinateT j, const vtkVariant &value) |
Overwrites the value stored in the array at the given coordinates. | |
void | SetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k, const vtkVariant &value) |
Overwrites the value stored in the array at the given coordinates. | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. | |
virtual void | DebugOff () |
Turn debugging output off. | |
bool | GetDebug () |
Get the value of the debug flag. | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. | |
virtual void | Modified () |
Update the modification time for this object. | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
virtual void | Delete () |
Delete a VTK object. | |
virtual void | FastDelete () |
Delete a reference to this object. | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). | |
int | GetReferenceCount () |
Return the current reference count of this object. | |
void | SetReferenceCount (int) |
Sets the reference count. | |
bool | GetIsInMemkind () const |
A local state flag that remembers whether this object lives in the normal or extended memory space. | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
Protected Member Functions | |
vtkTypedArray ()=default | |
~vtkTypedArray () override=default | |
Protected Member Functions inherited from vtkArray | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkArray () | |
~vtkArray () override | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
These methods allow a command to exclusively grab all events. | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Additional Inherited Members | |
Static Public Member Functions inherited from vtkArray | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkArray * | SafeDownCast (vtkObjectBase *o) |
static vtkArray * | CreateArray (int StorageType, int ValueType) |
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. | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. | |
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | SetMemkindDirectory (const char *directoryname) |
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
static bool | GetUsingMemkind () |
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Static Protected Member Functions inherited from vtkObjectBase | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Provides a type-specific interface to N-way arrays.
vtkTypedArray provides an interface for retrieving and updating data in an arbitrary-dimension array. It derives from vtkArray and is templated on the type of value stored in the array.
Methods are provided for retrieving and updating array values based either on their array coordinates, or on a 1-dimensional integer index. The latter approach can be used to iterate over the values in an array in arbitrary order, which is useful when writing filters that operate efficiently on sparse arrays and arrays that can have any number of dimensions.
Special overloaded methods provide simple access for arrays with one, two, or three dimensions.
Definition at line 55 of file vtkTypedArray.h.
typedef vtkArray::CoordinateT vtkTypedArray< T >::CoordinateT |
Definition at line 59 of file vtkTypedArray.h.
typedef vtkArray::SizeT vtkTypedArray< T >::SizeT |
Definition at line 60 of file vtkTypedArray.h.
|
protecteddefault |
|
overrideprotecteddefault |
vtkTypedArray< T >::vtkTemplateTypeMacro | ( | vtkTypedArray< T > | , |
vtkArray | |||
) |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
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 vtkArray.
|
inlineoverridevirtual |
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 vtkArray.
|
inlineoverridevirtual |
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 vtkArray.
|
inlineoverridevirtual |
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 vtkArray.
|
inlineoverridevirtual |
Overwrites a value with a value retrieved from another array.
Both arrays must store the same data types.
Implements vtkArray.
|
inlineoverridevirtual |
Overwrites a value with a value retrieved from another array.
Both arrays must store the same data types.
Implements vtkArray.
|
inlineoverridevirtual |
Overwrites a value with a value retrieved from another array.
Both arrays must store the same data types.
Implements vtkArray.
|
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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< 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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< T >.
|
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 vtkDenseArray< T >, and vtkSparseArray< 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 vtkDenseArray< T >, and vtkSparseArray< 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 190 of file vtkArray.h.
|
inline |
Definition at line 191 of file vtkArray.h.
|
inline |
Definition at line 192 of file vtkArray.h.
|
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 vtkArray.
|
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 211 of file vtkArray.h.
|
inline |
Definition at line 212 of file vtkArray.h.
|
inline |
Definition at line 213 of file vtkArray.h.
|
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 vtkArray.