71#ifndef vtkSparseArray_h
72#define vtkSparseArray_h
79VTK_ABI_NAMESPACE_BEGIN
241 std::vector<
std::
string> DimensionLabels;
252 std::vector<T> Values;
264#include "vtkSparseArray.txx"
Stores coordinate into an N-way array.
Stores the number of dimensions and valid coordinate ranges along each dimension for vtkArray.
Controls sorting of sparse array coordinates.
Abstract interface for N-dimensional arrays.
vtkArrayExtents::SizeT SizeT
vtkArrayExtents::DimensionT DimensionT
vtkArrayExtents::CoordinateT CoordinateT
a simple class to control print indentation
Sparse, independent coordinate storage for N-way arrays.
void SetExtents(const vtkArrayExtents &extents)
Specify arbitrary array extents, without altering the contents of the array.
std::vector< CoordinateT > GetUniqueCoordinates(DimensionT dimension)
Returns the set of unique coordinates along the given dimension.
const vtkArrayExtents & GetExtents() VTK_FUTURE_CONST override
Returns the extents (the number of dimensions and size along each dimension) of the array.
void ReserveStorage(SizeT value_count)
Reserve storage for a specific number of values.
void SetValue(CoordinateT i, const T &value) override
Overwrites the value stored in the array at the given coordinates.
void AddValue(CoordinateT i, const T &value)
Adds a new non-null element to the array.
void GetCoordinatesN(SizeT n, vtkArrayCoordinates &coordinates) VTK_FUTURE_CONST override
Returns the coordinates of the n-th value in the array, where n is in the range [0,...
static vtkSparseArray< T > * New()
bool Validate()
Validate the contents of the array, returning false if there are any problems.
void Sort(const vtkArraySort &sort)
Sorts array values so that their coordinates appear in some well-defined order.
void SetNullValue(const T &value)
Set the value that will be returned by GetValue() for nullptr areas of the array.
void SetExtentsFromContents()
Update the array extents to match its contents, so that the extent along each dimension matches the m...
const T * GetValueStorage() const
Return a read-only reference to the underlying value storage.
vtkArray::DimensionT DimensionT
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()).
vtkArray * DeepCopy() override
Returns a new array that is a deep copy of this array.
void Clear()
Remove all non-null elements from the array, leaving the number of dimensions, the extent of each dim...
bool IsDense() VTK_FUTURE_CONST override
Returns true iff the underlying array storage is "dense", i.e.
const T & GetNullValue()
Returns the value that will be returned by GetValue() for nullptr areas of the array.
const CoordinateT * GetCoordinateStorage(DimensionT dimension) const
Return a read-only reference to the underlying coordinate storage.
vtkTemplateTypeMacro(vtkSparseArray< T >, vtkTypedArray< T >)
SizeT GetNonNullSize() VTK_FUTURE_CONST override
Returns the number of non-null values stored in the array.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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()).
vtkArray::CoordinateT CoordinateT
Wrapper around std::string to keep symbols short.
Provides a type-specific interface to N-way arrays.