72 #ifndef vtkSparseArray_h
73 #define vtkSparseArray_h
100 const T&
GetValue(CoordinateT i) VTK_OVERRIDE;
101 const T&
GetValue(CoordinateT i, CoordinateT j) VTK_OVERRIDE;
102 const T&
GetValue(CoordinateT i, CoordinateT j, CoordinateT k) VTK_OVERRIDE;
104 const T&
GetValueN(const SizeT n) VTK_OVERRIDE;
106 void SetValue(CoordinateT i, CoordinateT j, const T&
value) VTK_OVERRIDE;
107 void SetValue(CoordinateT i, CoordinateT j, CoordinateT k, const T&
value) VTK_OVERRIDE;
202 inline
void AddValue(CoordinateT i, const T& value);
203 inline
void AddValue(CoordinateT i, CoordinateT j, const T& value);
204 inline
void AddValue(CoordinateT i, CoordinateT j, CoordinateT k, const T& value);
221 ~vtkSparseArray() VTK_OVERRIDE;
224 vtkSparseArray(const vtkSparseArray&) VTK_DELETE_FUNCTION;
225 void operator=(const vtkSparseArray&) VTK_DELETE_FUNCTION;
228 void InternalSetDimensionLabel(DimensionT i, const
vtkStdString& label) VTK_OVERRIDE;
229 vtkStdString InternalGetDimensionLabel(DimensionT i) VTK_OVERRIDE;
231 typedef vtkSparseArray<T>
ThisT;
263 #include "vtkSparseArray.txx"
Controls sorting of sparse array coordinates.
Stores coordinate into an N-way array.
Wrapper around std::string to keep symbols short.
Stores the number of dimensions and valid coordinate ranges along each dimension for vtkArray...
Sparse, independent coordinate storage for N-way arrays.
Abstract interface for N-dimensional arrays.
void SetExtents(const vtkArrayExtents &extents)
Specify arbitrary array extents, without altering the contents of the array.
vtkArray::DimensionT DimensionT
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetNullValue(const T &value)
Set the value that will be returned by GetValue() for NULL areas of the array.
void Sort(const vtkArraySort &sort)
Sorts array values so that their coordinates appear in some well-defined order.
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 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()).
const T & GetNullValue()
Returns the value that will be returned by GetValue() for NULL areas of the array.
vtkArrayExtents::DimensionT DimensionT
vtkTemplateTypeMacro(vtkSparseArray< T >, vtkTypedArray< T >) static vtkSparseArray< T > *New()
a simple class to control print indentation
bool IsDense() override
Returns true iff the underlying array storage is "dense", i.e.
const T * GetValueStorage() const
Return a read-only reference to the underlying value storage.
vtkArrayExtents::SizeT SizeT
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, GetNonNullSize()).
std::vector< CoordinateT > GetUniqueCoordinates(DimensionT dimension)
Returns the set of unique coordinates along the given dimension.
const CoordinateT * GetCoordinateStorage(DimensionT dimension) const
Return a read-only reference to the underlying coordinate storage.
void Clear()
Remove all non-null elements from the array, leaving the number of dimensions, the extent of each dim...
void SetExtentsFromContents()
Update the array extents to match its contents, so that the extent along each dimension matches the m...
vtkArray::CoordinateT CoordinateT
const vtkArrayExtents & GetExtents() override
Returns the extents (the number of dimensions and size along each dimension) of the 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.
SizeT GetNonNullSize() override
Returns the number of non-null values stored in the array.
void ReserveStorage(const SizeT value_count)
Reserve storage for a specific number of values.
vtkArray * DeepCopy() override
Returns a new array that is a deep copy of this array.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
bool Validate()
Validate the contents of the array, returning false if there are any problems.
vtkArrayExtents::CoordinateT CoordinateT
void SetValue(CoordinateT i, const T &value) override
Overwrites the value stored in the array at the given coordinates.
const T & GetValue(CoordinateT i) override
Returns the value stored in the array at the given coordinates.