69 #ifndef vtkGenericDataArray_h 70 #define vtkGenericDataArray_h 79 template<
class DerivedT,
class ValueTypeT>
106 return static_cast<const DerivedT*
>(
this)->
GetValue(valueIdx);
133 static_cast<const DerivedT*
>(
this)->
GetTypedTuple(tupleIdx, tuple);
147 static_cast<DerivedT*
>(
this)->
SetTypedTuple(tupleIdx, tuple);
269 { this->Superclass::SetTuple(tupleIdx, tuple); }
271 { this->Superclass::SetTuple(tupleIdx, tuple); }
279 { this->Superclass::InsertTuples(dstStart, n, srcStart, source); }
286 double value)
override;
299 double* weights)
override;
356 #include "vtkGenericDataArray.txx" 364 #define vtkAOSArrayNewInstanceMacro(thisClass) \ 366 vtkObjectBase *NewInstanceInternal() const override \ 368 if (vtkDataArray *da = \ 369 vtkDataArray::CreateDataArray(thisClass::VTK_DATA_TYPE)) \ 373 return thisClass::New(); \ void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
bool HasStandardMemoryLayout() override
Returns true if this array uses the standard memory layout defined in the VTK user guide...
void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
Set the tuple at dstTupleIdx in this array to the tuple at srcTupleIdx in the source array...
void FillComponent(int compIdx, double value) override
Fill a component of a data array with a specified value.
vtkIdType InsertNextTypedTuple(const ValueType *t)
Insert (memory allocation performed) the tuple onto the end of the array.
void Squeeze() override
Free any unnecessary memory.
void InsertValue(vtkIdType valueIdx, ValueType value)
Insert data at a specified position in the array.
vtkIdType GetNumberOfTuples()
Get the number of complete tuples (a component group) in the array.
vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source) override
Insert the tuple from srcTupleIdx in the source array at the end of this array.
internal class used by vtkGenericDataArray to support LookupValue.
Abstract superclass for all arrays.
ValueType * GetPointer(vtkIdType valueIdx)
Default implementation raises a runtime error.
vtkGenericDataArrayLookupHelper< SelfType > Lookup
void SetVariantValue(vtkIdType valueIdx, vtkVariant value) override
Set a value in the array from a variant.
vtkTemplateTypeMacro(SelfType, vtkDataArray) enum
Compile time access to the VTK type identifier.
void SetArrayFreeFunction(void(*callback)(void *)) override
Default implementation raises a runtime error.
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override
Allocate memory for this array.
void SetComponent(vtkIdType tupleIdx, int compIdx, double value) override
Set the data component at the location specified by tupleIdx and compIdx to value.
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
Copy the tuple at tupleIdx into tuple.
void Initialize() override
Release storage and reset array to initial state.
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
Set component compIdx of the tuple at tupleIdx to value.
Base interface for all typed vtkDataArray subclasses.
int GetNumberOfComponents()
Set/Get the dimension (n) of the components.
void SetVoidArray(void *, vtkIdType, int) override
Default implementation raises a runtime error.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
void SetTuple(vtkIdType tupleIdx, const float *tuple) override
Set the data tuple at tupleIdx.
A atomic type representing the union of many types.
void SetTuple(vtkIdType tupleIdx, const double *tuple) override
Set the data tuple at tupleIdx.
vtkIdType GetNumberOfValues() const
Get the total number of values in the array.
ValueType GetValue(vtkIdType valueIdx) const
Get the value at valueIdx.
void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source) override
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
void InsertVariantValue(vtkIdType valueIdx, vtkVariant value) override
Insert a value into the array from a variant.
double * GetTuple(vtkIdType tupleIdx) override
Get the data tuple at tupleIdx.
vtkIdType Capacity()
Return the capacity in typeof T units of the current array.
ValueType * GetValueRange()
Get the range of array values for the 0th component in the native data type.
vtkIdType InsertNextValue(ValueType value)
Insert data at the end of the array.
list of point or cell ids
vtkVariant GetVariantValue(vtkIdType valueIdx) override
Retrieve value from the array as a variant.
bool AllocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
abstract superclass for arrays of numeric data
void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override
Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in t...
int GetDataTypeSize() override
Return the size of the underlying data type.
virtual void FillValue(ValueType value)
Set all the values in array to value.
void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override
Default implementation raises a runtime error.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
Default implementation raises a runtime error.
Abstract superclass to iterate over elements in an vtkAbstractArray.
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
#define VTK_SIZEHINT(...)
void GetTuples(vtkIdList *tupleIds, vtkAbstractArray *output) override
Given a list of tuple ids, return an array of tuples.
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
void RemoveTuple(vtkIdType tupleIdx) override
Removes a tuple at the given index.
void GetValueRange(ValueType range[2])
~vtkGenericDataArray() override
void DataChanged() override
Tell the array explicitly that the data has changed.
void * GetVoidPointer(vtkIdType valueIdx) override
Default implementation raises a runtime error.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
Set this array's tuple at tupleIdx to the values in tuple.
std::vector< ValueType > LegacyValueRange
double GetComponent(vtkIdType tupleIdx, int compIdx) override
Return the data component at the location specified by tupleIdx and compIdx.
vtkIdType LookupValue(vtkVariant value) override
Return the value indices where a specific value appears.
std::vector< double > LegacyTuple
virtual void FillTypedComponent(int compIdx, ValueType value)
Set component comp of all tuples to value.
void InsertTypedTuple(vtkIdType tupleIdx, const ValueType *t)
Insert (memory allocation performed) the tuple t at tupleIdx.
void InsertComponent(vtkIdType tupleIdx, int compIdx, double value) override
Insert value at the location specified by tupleIdx and compIdx.
bool ReallocateTuples(vtkIdType numTuples)
Allocate space for numTuples.
void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
virtual vtkIdType LookupTypedValue(ValueType value)
void SetNumberOfComponents(int num) override
Set/Get the dimension (n) of the components.
vtkTypeBool Resize(vtkIdType numTuples) override
Resize the array to the requested number of tuples and preserve data.
int GetDataType() override
Return the underlying data type.
void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override
Copy n consecutive tuples starting at srcStart from the source array to this array, starting at the dstStart location.
Template defining traits of native types used by VTK.
bool EnsureAccessToTuple(vtkIdType tupleIdx)
void InsertTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType val)
Insert (memory allocation performed) the value at the specified tuple and component location...
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
Get component compIdx of the tuple at tupleIdx.