32 #ifndef vtkDenseArray_h
33 #define vtkDenseArray_h
39 VTK_ABI_NAMESPACE_BEGIN
60 const T&
GetValue(CoordinateT i)
override;
61 const T&
GetValue(CoordinateT i, CoordinateT j)
override;
62 const T&
GetValue(CoordinateT i, CoordinateT j, CoordinateT k)
override;
66 void SetValue(CoordinateT i, CoordinateT j,
const T&
value)
override;
67 void SetValue(CoordinateT i, CoordinateT j, CoordinateT k,
const T&
value)
override;
172 void InternalSetDimensionLabel(DimensionT i,
const vtkStdString& label)
override;
173 vtkStdString InternalGetDimensionLabel(DimensionT i)
override;
174 inline vtkIdType MapCoordinates(CoordinateT i);
175 inline vtkIdType MapCoordinates(CoordinateT i, CoordinateT j);
176 inline vtkIdType MapCoordinates(CoordinateT i, CoordinateT j, CoordinateT k);
191 std::vector<std::string> DimensionLabels;
210 std::vector<vtkIdType> Offsets;
215 std::vector<vtkIdType> Strides;
219 VTK_ABI_NAMESPACE_END
220 #include "vtkDenseArray.txx"
Stores coordinate into an N-way array.
Wrapper around std::string to keep symbols short.
vtkDenseArray()
Stores the current array extents (its size along each dimension)
MemoryBlock implementation that manages internally-allocated memory using new[] and delete[]...
Stores the number of dimensions and valid coordinate ranges along each dimension for vtkArray...
~vtkDenseArray() override
Stores the current array extents (its size along each dimension)
const T * GetStorage() const
Returns a read-only reference to the underlying storage.
HeapMemoryBlock(const vtkArrayExtents &extents)
void ExternalStorage(const vtkArrayExtents &extents, MemoryBlock *storage)
Initializes the array to use an externally-allocated memory block.
Abstract interface for N-dimensional arrays.
virtual T * GetAddress()=0
Returns a pointer to the block of memory to be used for storage.
~HeapMemoryBlock() override
void SetValue(CoordinateT i, const T &value) override
Overwrites the value stored in the array at the given coordinates.
Strategy object that contains a block of memory to be used by vtkDenseArray for value storage...
vtkArray * DeepCopy() override
Returns a new array that is a deep copy of this array.
SizeT GetNonNullSize() override
Returns the number of non-null values stored in the array.
StaticMemoryBlock(T *storage)
const vtkArrayExtents & GetExtents() override
Returns the extents (the number of dimensions and size along each dimension) of the array...
void Fill(const T &value)
Fills every element in the array with the given value.
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()).
vtkArrayExtents::DimensionT DimensionT
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
T * GetAddress() override
Returns a pointer to the block of memory to be used for storage.
a simple class to control print indentation
bool IsDense() override
Returns true iff the underlying array storage is "dense", i.e.
const T & GetValue(CoordinateT i) override
Returns the value stored in the array at the given coordinates.
const T & GetValueN(SizeT n) override
Returns the n-th value stored in the array, where n is in the range [0, GetNonNullSize()).
vtkArrayExtents::SizeT SizeT
static vtkDenseArray< T > * New()
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()).
vtkTemplateTypeMacro(vtkDenseArray< T >, vtkTypedArray< T >)
Contiguous storage for N-way arrays.
Provides a type-specific interface to N-way arrays.
vtkArray::CoordinateT CoordinateT
vtkArrayExtents::CoordinateT CoordinateT
vtkArray::DimensionT DimensionT
T * GetAddress() override
Returns a pointer to the block of memory to be used for storage.
T & operator[](const vtkArrayCoordinates &coordinates)
Returns a value by-reference, which is useful for performance and code-clarity.
MemoryBlock implementation that manages a static (will not be freed) memory block.