Go to the documentation of this file.
39 #ifndef vtkTypedDataArray_h
40 #define vtkTypedDataArray_h
44 #include "vtkCommonCoreModule.h"
49 template <
class Scalar>
57 typedef typename Superclass::ValueType
ValueType;
194 #include "vtkTypedDataArrayIterator.h" // For iterator
196 template <
class Scalar>
inline
199 return Iterator(
this, 0);
202 template <
class Scalar>
inline
205 return Iterator(
this, this->
MaxId + 1);
208 #include "vtkTypedDataArray.txx"
210 #endif //vtkTypedDataArray_h
virtual vtkIdType InsertNextTypedTuple(const ValueType *t)=0
Insert (memory allocation performed) the tuple onto the end of the array.
virtual bool ReallocateTuples(vtkIdType numTuples)
Needed for vtkGenericDataArray API, but just aborts.
Template defining traits of native types used by VTK.
static vtkTypedDataArray< Scalar > * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkTypedDataArray.
virtual void GetTypedTuple(vtkIdType idx, ValueType *t) const =0
Copy the tuple value into a user-provided array.
int GetDataType() override
Return the VTK data type held by this array.
int GetDataTypeSize() override
Return the size of the element type in bytes.
virtual vtkIdType InsertNextValue(ValueType v)=0
Insert data at the end of the array.
Extend vtkDataArray with abstract type-specific API.
~vtkTypedDataArray() override
Base interface for all typed vtkDataArray subclasses.
virtual void InsertValue(vtkIdType idx, ValueType v)=0
Insert data at a specified position in the array.
int GetArrayType() override
Method for type-checking in FastDownCast implementations.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType v)
virtual void InsertTypedTuple(vtkIdType i, const ValueType *t)=0
Insert (memory allocation performed) the tuple into the ith location in the array.
virtual bool AllocateTuples(vtkIdType numTuples)
Needed for vtkGenericDataArray API, but just aborts.
virtual ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const
virtual ValueType & GetValueReference(vtkIdType idx)=0
Get a reference to the scalar value at a particular index.
vtkTemplateTypeMacro(SelfType, vtkDataArray) enum
Compile time access to the VTK type identifier.
vtkTypeBool Resize(vtkIdType numTuples) override=0
Resize the array to the requested number of tuples and preserve data.
Iterator Begin()
Return an iterator initialized to the first element of the data.
Iterator End()
Return an iterator initialized to first element past the end of the data.
Abstract superclass for all arrays.
vtkTemplateTypeMacro(vtkTypedDataArray< Scalar >, GenericDataArrayType) typedef typename Superclass typedef vtkTypedDataArrayIterator< ValueType > Iterator
Typedef to a suitable iterator class.
vtkArrayDownCast_TemplateFastCastMacro(vtkTypedDataArray) template< class Scalar > inline typename vtkTypedDataArray< Scalar >
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override=0
Allocate memory for this array.
virtual ValueType GetValue(vtkIdType idx) const =0
Get the data at a particular index.
STL-style random access iterator for vtkTypedDataArrays.
virtual void SetTypedTuple(vtkIdType i, const ValueType *t)=0
Set the tuple value at the ith location in the array.
virtual void SetValue(vtkIdType idx, ValueType value)=0
Set the data at a particular index.
void SetNumberOfValues(vtkIdType num) override
Specify the number of values for this object to hold.