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