18 #ifndef vtkVariantArray_h
19 #define vtkVariantArray_h
23 #include "vtkCommonCoreModule.h"
30 namespace serialization
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkVariantArrayLookup;
43 friend class boost::serialization::access;
53 using ArrayTypeTag = std::integral_constant<int, vtkArrayTypes::VTK_VARIANT_ARRAY>;
216 this->SetArray(static_cast<ValueType*>(array), size, save);
220 this->SetArray(static_cast<ValueType*>(array), size, save, deleteMethod);
249 ValueType GetTypedComponent(
vtkIdType tupleIdx,
int comp) const
250 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + comp < GetNumberOfValues())
251 VTK_EXPECTS(0 <= comp && comp < GetNumberOfComponents());
257 void SetTypedComponent(
vtkIdType tupleIdx,
int comp, ValueType
value)
258 VTK_EXPECTS(0 <= tupleIdx && GetNumberOfComponents() * tupleIdx + comp < GetNumberOfValues())
259 VTK_EXPECTS(0 <= comp && comp < GetNumberOfComponents());
266 void GetTypedTuple(
vtkIdType tupleIdx, ValueType* tuple) const
267 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples());
274 void SetTypedTuple(
vtkIdType tupleIdx, const ValueType* tuple)
275 VTK_EXPECTS(0 <= tupleIdx && tupleIdx < GetNumberOfTuples());
288 VTK_EXPECTS(0 <=
id &&
id < this->GetNumberOfValues());
332 #endif // __VTK_WRAP__
337 void SetArray(ValueType* arr,
vtkIdType size,
int save,
int deleteMethod = VTK_DATA_ARRAY_DELETE);
371 virtual
void DataElementChanged(
vtkIdType id);
378 void ClearLookup() override;
393 bool ReallocateTuples(
vtkIdType numTuples);
398 bool EnsureAccessToTuple(
vtkIdType tupleIdx);
409 return this->Buffer->GetBuffer();
416 vtkVariantArrayLookup* Lookup;
423 VTK_ABI_NAMESPACE_END
vtkBuffer< ValueType > * GetBuffer()
Return the underlying buffer object.
virtual void InsertTuplesStartingAt(vtkIdType dstStart, vtkIdList *srcIds, vtkAbstractArray *source)=0
Copy the tuples indexed in srcIds from the source array to the tuple locations starting at index dstS...
Forward declaration required for Boost serialization.
virtual void DataChanged()=0
Tell the array explicitly that the data has changed.
virtual void DeepCopy(vtkAbstractArray *da)
Deep copy of data.
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
An array holding vtkVariants.
Abstract superclass for all arrays.
virtual vtkIdType LookupValue(vtkVariant value)=0
Return the value indices where a specific value appears.
void SetVoidArray(void *array, vtkIdType size, int save, int deleteMethod) override
This method lets the user specify data to be held by the array.
virtual int IsNumeric() const =0
This method is here to make backward compatibility easier.
virtual int GetElementComponentSize() const =0
Return the size, in bytes, of the lowest-level element of an array.
virtual bool CopyComponent(int dstComponent, vtkAbstractArray *src, int srcComponent)=0
Copy a component from one array into a component on this array.
virtual vtkTypeBool ReserveTuples(vtkIdType numTuples)=0
Reserve the array to the requested number of tuples and preserve data.
virtual void InterpolateTuple(vtkIdType dstTupleIdx, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights)=0
Set the tuple at dstTupleIdx in this array to the interpolated tuple value, given the ptIndices in th...
void SetVoidArray(void *array, vtkIdType size, int save) override
This method lets the user specify data to be held by the array.
A type representing the union of many types.
virtual int GetDataTypeSize() const =0
Return the size of the underlying data type.
int GetArrayType() const override
Return the array type.
#define VTK_MARSHALMANUAL
virtual unsigned long GetActualMemorySize() const =0
Return the memory in kibibytes (1024 bytes) consumed by this data array.
a simple class to control print indentation
void save(Archiver &ar, const std::string &str, const unsigned int version)
list of point or cell ids
vtkArrayDownCast_FastCastMacro(vtkVariantArray)
Abstract superclass to iterate over elements in an vtkAbstractArray.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual void InsertTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Insert the tuple at srcTupleIdx in the source array into this array at dstTupleIdx.
std::integral_constant< int, VTK_OPAQUE > DataTypeTag
virtual vtkIdType InsertNextTuple(vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Insert the tuple from srcTupleIdx in the source array at the end of this array.
virtual void SetArrayFreeFunction(void(*callback)(void *))=0
This method allows the user to specify a custom free function to be called when the array is dealloca...
Abstract base class for vtkBuffer providing buffer protocol support.
virtual void SetTuple(vtkIdType dstTupleIdx, vtkIdType srcTupleIdx, vtkAbstractArray *source)=0
Set the tuple at dstTupleIdx in this array to the tuple at srcTupleIdx in the source array...
std::integral_constant< int, vtkArrayTypes::VTK_ABSTRACT_ARRAY > ArrayTypeTag
virtual int GetDataType() const
Return the underlying data type.
virtual void Squeeze()=0
Free any unnecessary memory.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void ShallowCopy(vtkAbstractArray *src)
This method will copy the data from the source array to this array.
#define VTK_DEPRECATED_IN_9_7_0(reason)
virtual void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source)=0
Copy the tuples indexed in srcIds from the source array to the tuple locations indexed by dstIds in t...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.