VTK  9.3.20240318
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
vtkDenseArray< T > Class Template Reference

Contiguous storage for N-way arrays. More...

#include <vtkDenseArray.h>

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

Classes

class  HeapMemoryBlock
 MemoryBlock implementation that manages internally-allocated memory using new[] and delete[]. More...
 
class  MemoryBlock
 Strategy object that contains a block of memory to be used by vtkDenseArray for value storage. More...
 
class  StaticMemoryBlock
 MemoryBlock implementation that manages a static (will not be freed) memory block. More...
 

Public Types

typedef vtkArray::CoordinateT CoordinateT
 
typedef vtkArray::DimensionT DimensionT
 
typedef vtkArray::SizeT SizeT
 
- Public Types inherited from vtkTypedArray< T >
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 (vtkDenseArray< T >, vtkTypedArray< T >)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
bool IsDense () override
 Returns true iff the underlying array storage is "dense", i.e. More...
 
const vtkArrayExtentsGetExtents () override
 Returns the extents (the number of dimensions and size along each dimension) of the array. More...
 
SizeT GetNonNullSize () override
 Returns the number of non-null values stored in the array. More...
 
void GetCoordinatesN (SizeT n, vtkArrayCoordinates &coordinates) override
 Returns the coordinates of the n-th value in the array, where n is in the range [0, GetNonNullSize()). More...
 
vtkArrayDeepCopy () override
 Returns a new array that is a deep copy of this array. More...
 
const T & GetValue (CoordinateT i) override
 Returns the value stored in the array at the given coordinates. More...
 
const T & GetValue (CoordinateT i, CoordinateT j) override
 Returns the value stored in the array at the given coordinates. More...
 
const T & GetValue (CoordinateT i, CoordinateT j, CoordinateT k) override
 Returns the value stored in the array at the given coordinates. More...
 
const T & GetValue (const vtkArrayCoordinates &coordinates) override
 Returns the value stored in the array at the given coordinates. More...
 
const T & GetValueN (SizeT n) override
 Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). More...
 
void SetValue (CoordinateT i, const T &value) override
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetValue (CoordinateT i, CoordinateT j, const T &value) override
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetValue (CoordinateT i, CoordinateT j, CoordinateT k, const T &value) override
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetValue (const vtkArrayCoordinates &coordinates, const T &value) override
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetValueN (SizeT n, const T &value) override
 Overwrites the n-th value stored in the array, where n is in the range [0, GetNonNullSize()). More...
 
- Public Member Functions inherited from vtkTypedArray< T >
 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
 Returns the value stored in the array at the given coordinates. More...
 
vtkVariant GetVariantValueN (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
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetVariantValueN (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, SizeT source_index, const vtkArrayCoordinates &target_coordinates) override
 Overwrites a value with a value retrieved from another array. More...
 
void CopyValue (vtkArray *source, const vtkArrayCoordinates &source_coordinates, SizeT target_index) override
 Overwrites a value with a value retrieved from another array. 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
 
vtkArrayRange GetExtent (DimensionT dimension)
 Returns the extent (valid coordinate range) along the given dimension. 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...
 
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...
 
void Resize (CoordinateT i)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
void Resize (CoordinateT i, CoordinateT j)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
void Resize (CoordinateT i, CoordinateT j, CoordinateT k)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
void Resize (const vtkArrayRange &i)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
void Resize (const vtkArrayRange &i, const vtkArrayRange &j)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
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). More...
 
void Resize (const vtkArrayExtents &extents)
 Resizes the array to the given extents (number of dimensions and size of each dimension). More...
 
vtkVariant GetVariantValue (CoordinateT i)
 Returns the value stored in the array at the given coordinates. More...
 
vtkVariant GetVariantValue (CoordinateT i, CoordinateT j)
 Returns the value stored in the array at the given coordinates. More...
 
vtkVariant GetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k)
 Returns the value stored in the array at the given coordinates. More...
 
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)
 Overwrites the value stored in the array at the given coordinates. More...
 
void SetVariantValue (CoordinateT i, CoordinateT j, CoordinateT k, const vtkVariant &value)
 Overwrites the value stored in the array at the given coordinates. 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...
 
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)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output. 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)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
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)
 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, 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...
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes. More...
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
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). 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...
 
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...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not. More...
 

Static Public Member Functions

static vtkDenseArray< T > * New ()
 
- 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 (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- 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 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). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
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. More...
 
void ExternalStorage (const vtkArrayExtents &extents, MemoryBlock *storage)
 Initializes the array to use an externally-allocated memory block. More...
 
void Fill (const T &value)
 Fills every element in the array with the given value. More...
 
T & operator[] (const vtkArrayCoordinates &coordinates)
 Returns a value by-reference, which is useful for performance and code-clarity. More...
 
const T * GetStorage () const
 Returns a read-only reference to the underlying storage. More...
 
T * GetStorage ()
 Returns a mutable reference to the underlying storage. More...
 
 vtkDenseArray ()
 Stores the current array extents (its size along each dimension) More...
 
 ~vtkDenseArray () override
 Stores the current array extents (its size along each dimension) More...
 

Additional Inherited Members

- Protected Member Functions inherited from vtkTypedArray< T >
 vtkTypedArray ()=default
 
 ~vtkTypedArray () override=default
 
- 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 ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 
- 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
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

template<typename T>
class vtkDenseArray< T >

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.

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

Tests:
vtkDenseArray (Tests)

Definition at line 120 of file vtkDenseArray.h.

Member Typedef Documentation

◆ CoordinateT

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

Definition at line 127 of file vtkDenseArray.h.

◆ DimensionT

template<typename T >
typedef vtkArray::DimensionT vtkDenseArray< T >::DimensionT

Definition at line 128 of file vtkDenseArray.h.

◆ SizeT

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

Definition at line 129 of file vtkDenseArray.h.

Constructor & Destructor Documentation

◆ vtkDenseArray()

template<typename T >
vtkDenseArray< T >::vtkDenseArray ( )
protected

Stores the current array extents (its size along each dimension)

◆ ~vtkDenseArray()

template<typename T >
vtkDenseArray< T >::~vtkDenseArray ( )
overrideprotected

Stores the current array extents (its size along each dimension)

Member Function Documentation

◆ New()

template<typename T >
static vtkDenseArray<T>* vtkDenseArray< T >::New ( )
static

◆ vtkTemplateTypeMacro()

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

◆ PrintSelf()

template<typename T >
void vtkDenseArray< 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.

◆ IsDense()

template<typename T >
bool vtkDenseArray< T >::IsDense ( )
overridevirtual

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.

◆ GetExtents()

template<typename T >
const vtkArrayExtents& vtkDenseArray< T >::GetExtents ( )
overridevirtual

Returns the extents (the number of dimensions and size along each dimension) of the array.

Implements vtkArray.

◆ GetNonNullSize()

template<typename T >
SizeT vtkDenseArray< T >::GetNonNullSize ( )
overridevirtual

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.

Implements vtkArray.

◆ GetCoordinatesN()

template<typename T >
void vtkDenseArray< T >::GetCoordinatesN ( SizeT  n,
vtkArrayCoordinates coordinates 
)
overridevirtual

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.

◆ DeepCopy()

template<typename T >
vtkArray* vtkDenseArray< T >::DeepCopy ( )
overridevirtual

Returns a new array that is a deep copy of this array.

Implements vtkArray.

◆ GetValue() [1/4]

template<typename T >
const T& vtkDenseArray< T >::GetValue ( CoordinateT  i)
overridevirtual

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

◆ GetValue() [2/4]

template<typename T >
const T& vtkDenseArray< T >::GetValue ( CoordinateT  i,
CoordinateT  j 
)
overridevirtual

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

◆ GetValue() [3/4]

template<typename T >
const T& vtkDenseArray< T >::GetValue ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k 
)
overridevirtual

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

◆ GetValue() [4/4]

template<typename T >
const T& vtkDenseArray< T >::GetValue ( const vtkArrayCoordinates coordinates)
overridevirtual

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

◆ GetValueN()

template<typename T >
const T& vtkDenseArray< T >::GetValueN ( 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 vtkTypedArray< T >.

◆ SetValue() [1/4]

template<typename T >
void vtkDenseArray< T >::SetValue ( CoordinateT  i,
const T &  value 
)
overridevirtual

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

◆ SetValue() [2/4]

template<typename T >
void vtkDenseArray< T >::SetValue ( CoordinateT  i,
CoordinateT  j,
const T &  value 
)
overridevirtual

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

◆ SetValue() [3/4]

template<typename T >
void vtkDenseArray< T >::SetValue ( CoordinateT  i,
CoordinateT  j,
CoordinateT  k,
const T &  value 
)
overridevirtual

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

◆ SetValue() [4/4]

template<typename T >
void vtkDenseArray< T >::SetValue ( const vtkArrayCoordinates coordinates,
const T &  value 
)
overridevirtual

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

◆ SetValueN()

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

◆ ExternalStorage()

template<typename 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.

◆ Fill()

template<typename T >
void vtkDenseArray< T >::Fill ( const T &  value)

Fills every element in the array with the given value.

◆ operator[]()

template<typename T >
T& vtkDenseArray< T >::operator[] ( const vtkArrayCoordinates coordinates)

Returns a value by-reference, which is useful for performance and code-clarity.

◆ GetStorage() [1/2]

template<typename T >
const T* vtkDenseArray< T >::GetStorage ( ) const

Returns a read-only reference to the underlying storage.

Values are stored contiguously with fortran ordering.

◆ GetStorage() [2/2]

template<typename T >
T* vtkDenseArray< T >::GetStorage ( )

Returns a mutable reference to the underlying storage.

Values are stored contiguously with fortran ordering. Use at your own risk!


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