VTK
Public Types | Public Member Functions | Protected Member Functions | List of all members
vtkTypedArray< T > Class Template Referenceabstract

Provides a type-specific interface to N-way arrays. More...

#include <vtkTypedArray.h>

Inheritance diagram for vtkTypedArray< T >:
[legend]
Collaboration diagram for vtkTypedArray< T >:
[legend]

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. More...
 
vtkVariant GetVariantValue (const vtkArrayCoordinates &coordinates) override
 
vtkVariant GetVariantValueN (const SizeT n) override
 Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). More...
 
void SetVariantValue (const vtkArrayCoordinates &coordinates, const vtkVariant &value) override
 
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()). More...
 
void CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const vtkArrayCoordinates &target_coordinates) override
 Overwrites a value with a value retrieved from another array. More...
 
void CopyValue (vtkArray *source, const SizeT source_index, const vtkArrayCoordinates &target_coordinates) override
 
void CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, const SizeT target_index) override
 
virtual const T & GetValue (CoordinateT i)=0
 Returns the value stored in the array at the given coordinates. More...
 
virtual const T & GetValue (CoordinateT i, CoordinateT j)=0
 
virtual const T & GetValue (CoordinateT i, CoordinateT j, CoordinateT k)=0
 
virtual const T & GetValue (const vtkArrayCoordinates &coordinates)=0
 
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()). More...
 
virtual void SetValue (CoordinateT i, const T &value)=0
 Overwrites the value stored in the array at the given coordinates. More...
 
virtual void SetValue (CoordinateT i, CoordinateT j, const T &value)=0
 
virtual void SetValue (CoordinateT i, CoordinateT j, CoordinateT k, const T &value)=0
 
virtual void SetValue (const vtkArrayCoordinates &coordinates, const T &value)=0
 
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()). More...
 
vtkVariant GetVariantValue (CoordinateT i)
 Returns the value stored in the array at the given coordinates. More...
 
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)
 Overwrites the value stored in the array at the given coordinates. More...
 
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
 
- 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. More...
 
vtkArrayNewInstance () const
 
virtual bool IsDense ()=0
 Returns true iff the underlying array storage is "dense", i.e. More...
 
void Resize (const CoordinateT i)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
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)
 
vtkArrayRange GetExtent (DimensionT dimension)
 Returns the extent (valid coordinate range) along the given dimension. More...
 
virtual const vtkArrayExtentsGetExtents ()=0
 Returns the extents (the number of dimensions and size along each dimension) of the array. More...
 
DimensionT GetDimensions ()
 Returns the number of dimensions stored in the array. More...
 
SizeT GetSize ()
 Returns the number of values stored in the array. More...
 
virtual SizeT GetNonNullSize ()=0
 Returns the number of non-null values stored in the array. More...
 
void SetName (const vtkStdString &name)
 Sets the array name. More...
 
vtkStdString GetName ()
 Returns the array name. More...
 
void SetDimensionLabel (DimensionT i, const vtkStdString &label)
 Sets the label for the i-th array dimension. More...
 
vtkStdString GetDimensionLabel (DimensionT i)
 Returns the label for the i-th array dimension. More...
 
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()). More...
 
vtkVariant GetVariantValue (CoordinateT i)
 Returns the value stored in the array at the given coordinates. More...
 
vtkVariant GetVariantValue (CoordinateT i, CoordinateT j)
 
vtkVariant GetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k)
 
void SetVariantValue (CoordinateT i, const vtkVariant &value)
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetVariantValue (CoordinateT i, CoordinateT j, const vtkVariant &value)
 
void SetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k, const vtkVariant &value)
 
virtual vtkArrayDeepCopy ()=0
 Returns a new array that is a deep copy of this array. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 
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)
 
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. More...
 
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)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
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
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 

Protected Member Functions

 vtkTypedArray ()
 
 ~vtkTypedArray () override
 
- Protected Member Functions inherited from vtkArray
virtual vtkObjectBaseNewInstanceInternal () 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. More...
 
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 &)
 

Additional Inherited Members

- Static Public Member Functions inherited from vtkArray
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkArraySafeDownCast (vtkObjectBase *o)
 
static vtkArrayCreateArray (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. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- 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. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

template<typename T>
class vtkTypedArray< T >

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.

See also
vtkArray, vtkDenseArray, vtkSparseArray
Thanks:
Developed by Timothy M. Shead (tshea.nosp@m.d@sa.nosp@m.ndia..nosp@m.gov) at Sandia National Laboratories.

Definition at line 55 of file vtkTypedArray.h.

Member Typedef Documentation

◆ CoordinateT

template<typename T>
typedef vtkArray::CoordinateT vtkTypedArray< T >::CoordinateT

Definition at line 59 of file vtkTypedArray.h.

◆ SizeT

template<typename T>
typedef vtkArray::SizeT vtkTypedArray< T >::SizeT

Definition at line 60 of file vtkTypedArray.h.

Constructor & Destructor Documentation

◆ vtkTypedArray()

template<typename T>
vtkTypedArray< T >::vtkTypedArray ( )
inlineprotected

Definition at line 122 of file vtkTypedArray.h.

◆ ~vtkTypedArray()

template<typename T>
vtkTypedArray< T >::~vtkTypedArray ( )
inlineoverrideprotected

Definition at line 123 of file vtkTypedArray.h.

Member Function Documentation

◆ vtkTemplateTypeMacro()

template<typename T>
vtkTypedArray< T >::vtkTemplateTypeMacro ( vtkTypedArray< T >  ,
vtkArray   
)

◆ PrintSelf()

template<typename T>
void vtkTypedArray< T >::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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

◆ GetVariantValue() [1/5]

template<typename T>
vtkVariant vtkTypedArray< T >::GetVariantValue ( const vtkArrayCoordinates coordinates)
overridevirtual

Implements vtkArray.

◆ GetVariantValueN()

template<typename T>
vtkVariant vtkTypedArray< T >::GetVariantValueN ( const SizeT  n)
overridevirtual

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.

◆ SetVariantValue() [1/5]

template<typename T>
void vtkTypedArray< T >::SetVariantValue ( const vtkArrayCoordinates coordinates,
const vtkVariant value 
)
overridevirtual

Implements vtkArray.

◆ SetVariantValueN()

template<typename T>
void vtkTypedArray< T >::SetVariantValueN ( const SizeT  n,
const vtkVariant value 
)
overridevirtual

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.

◆ CopyValue() [1/3]

template<typename T>
void vtkTypedArray< T >::CopyValue ( vtkArray source,
const vtkArrayCoordinates source_coordinates,
const vtkArrayCoordinates target_coordinates 
)
overridevirtual

Overwrites a value with a value retrieved from another array.

Both arrays must store the same data types.

Implements vtkArray.

◆ CopyValue() [2/3]

template<typename T>
void vtkTypedArray< T >::CopyValue ( vtkArray source,
const SizeT  source_index,
const vtkArrayCoordinates target_coordinates 
)
overridevirtual

Implements vtkArray.

◆ CopyValue() [3/3]

template<typename T>
void vtkTypedArray< T >::CopyValue ( vtkArray source,
const vtkArrayCoordinates source_coordinates,
const SizeT  target_index 
)
overridevirtual

Implements vtkArray.

◆ GetValue() [1/4]

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( CoordinateT  i)
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 vtkSparseArray< T >, and vtkDenseArray< T >.

◆ GetValue() [2/4]

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( CoordinateT  i,
CoordinateT  j 
)
pure virtual

◆ GetValue() [3/4]

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k 
)
pure virtual

◆ GetValue() [4/4]

template<typename T>
virtual const T& vtkTypedArray< T >::GetValue ( const vtkArrayCoordinates coordinates)
pure virtual

◆ GetValueN()

template<typename T>
virtual const T& vtkTypedArray< T >::GetValueN ( const SizeT  n)
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 vtkSparseArray< T >, and vtkDenseArray< T >.

◆ SetValue() [1/4]

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( CoordinateT  i,
const T &  value 
)
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 vtkSparseArray< T >, and vtkDenseArray< T >.

◆ SetValue() [2/4]

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( CoordinateT  i,
CoordinateT  j,
const T &  value 
)
pure virtual

◆ SetValue() [3/4]

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k,
const T &  value 
)
pure virtual

◆ SetValue() [4/4]

template<typename T>
virtual void vtkTypedArray< T >::SetValue ( const vtkArrayCoordinates coordinates,
const T &  value 
)
pure virtual

◆ SetValueN()

template<typename T>
virtual void vtkTypedArray< T >::SetValueN ( const SizeT  n,
const T &  value 
)
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 vtkSparseArray< T >, and vtkDenseArray< T >.

◆ GetVariantValue() [2/5]

template<typename T>
vtkVariant vtkArray::GetVariantValue
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 276 of file vtkArray.h.

◆ GetVariantValue() [3/5]

template<typename T>
vtkVariant vtkArray::GetVariantValue
inline

Definition at line 281 of file vtkArray.h.

◆ GetVariantValue() [4/5]

template<typename T>
vtkVariant vtkArray::GetVariantValue
inline

Definition at line 286 of file vtkArray.h.

◆ GetVariantValue() [5/5]

template<typename T>
virtual vtkVariant vtkArray::GetVariantValue

◆ SetVariantValue() [2/5]

template<typename T>
void vtkArray::SetVariantValue
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 291 of file vtkArray.h.

◆ SetVariantValue() [3/5]

template<typename T>
void vtkArray::SetVariantValue
inline

Definition at line 296 of file vtkArray.h.

◆ SetVariantValue() [4/5]

template<typename T>
void vtkArray::SetVariantValue
inline

Definition at line 301 of file vtkArray.h.

◆ SetVariantValue() [5/5]

template<typename T>
virtual void vtkArray::SetVariantValue

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