11template <
typename ValueT>
30 this->Buffer->GetBuffer() + valueIdx + this->NumberOfComponents, tuple);
35 std::copy(tuple, tuple + this->NumberOfComponents, this->
Buffer->
GetBuffer() + valueIdx);
52 if (this->Buffer->Allocate(numValues))
54 this->
Size = this->Buffer->GetSize();
61 if (this->Buffer->Reallocate(numTuples * this->GetNumberOfComponents()))
63 this->
Size = this->Buffer->GetSize();
This class is used in some unit tests to setup a mock data array which derives vtkGenericDataArray.
vtkTemplateTypeMacro(MockDataArray< ValueT >, GenericDataArrayType)
void * GetVoidPointer(vtkIdType idx) override
Return a void pointer.
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
vtkNew< vtkBuffer< ValueT > > Buffer
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
ValueType GetValue(vtkIdType valueIdx) const
void SetValue(vtkIdType valueIdx, ValueType value)
bool ReallocateTuples(vtkIdType numTuples)
typename Superclass::ValueType ValueType
bool AllocateTuples(vtkIdType numTuples)
static MockDataArray * New()
int GetNumberOfComponents() const
Set/Get the dimension (n) of the components.
ScalarType * GetBuffer()
Access the buffer as a scalar pointer.
Base interface for all typed vtkDataArray subclasses.
Allocate and hold a VTK object.
#define VTK_STANDARD_NEW_BODY(thisClass)