Go to the documentation of this file.
34 #ifndef vtkVariantArray_h
35 #define vtkVariantArray_h
37 #include "vtkCommonCoreModule.h"
41 class vtkVariantArrayLookup;
44 namespace boost {
namespace serialization {
class access; } }
50 friend class boost::serialization::access;
206 int deleteM)
override;
349 void (*DeleteFunction)(
void*);
355 vtkVariantArrayLookup* Lookup;
@ VTK_DATA_ARRAY_ALIGNED_FREE
vtkVariant * GetPointer(vtkIdType id)
Return a pointer to the location in the internal array at the specified index.
void SetNumberOfValues(vtkIdType number) override
Specify the number of values for this object to hold.
void DeepCopy(vtkAbstractArray *da) override
Deep copy of data.
void * GetVoidPointer(vtkIdType id) override
Return a void pointer.
vtkVariant & GetValue(vtkIdType id) const
Get the data at a particular index.
void Initialize() override
Release storage and reset array to initial state.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
void DataChanged() override
Tell the array explicitly that the data has changed.
vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source) override
Insert the jth tuple in the source array, at the end in this array.
Forward declaration required for Boost serialization.
An array holding vtkVariants.
vtkVariant * ResizeAndExtend(vtkIdType sz)
vtkIdType GetNumberOfValues()
Return the number of values in the array.
void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1, vtkIdType id2, vtkAbstractArray *source2, double t) override
Insert the ith tuple in this array as interpolated from the two values, p1 and p2,...
void SetVariantValue(vtkIdType idx, vtkVariant value) override
Insert a value into the array from a variant.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
int GetDataType() override
Return the underlying data type.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext=1000) override
Allocate memory for this array.
vtkIdType LookupValue(vtkVariant value) override
Return the indices where a specific value appears.
~vtkVariantArray() override
This destructor is public to work around a bug in version 1.36.0 of the Boost.Serialization library.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
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,...
vtkIdType GetNumberOfValues() const
Get the total number of values in the array.
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...
void SetVoidArray(void *arr, vtkIdType size, int save) override
This method lets the user specify data to be held by the array.
void InsertValue(vtkIdType id, vtkVariant value)
If id < GetNumberOfValues(), overwrite the array at that index.
void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices, vtkAbstractArray *source, double *weights) override
Set the ith tuple in this array as the interpolated tuple value, given the ptIndices in the source ar...
void Squeeze() override
Free any unnecessary memory.
void SetArrayFreeFunction(void(*callback)(void *)) override
This method allows the user to specify a custom free function to be called when the array is dealloca...
void SetValue(vtkIdType id, vtkVariant value)
Set the data at a particular index.
@ VTK_DATA_ARRAY_USER_DEFINED
a simple class to control print indentation
void SetArray(vtkVariant *arr, vtkIdType size, int save, int deleteMethod=VTK_DATA_ARRAY_DELETE)
Set the internal array used by this object.
void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
Insert the jth tuple in the source array, at ith location in this array.
A atomic type representing the union of many types.
list of point or cell ids
int IsNumeric() override
Since each item can be of a different type, we say that a variant array is not numeric.
vtkTypeBool Resize(vtkIdType numTuples) override
Resize the array while conserving the data.
void LookupValue(vtkVariant value, vtkIdList *ids) override
int GetDataTypeSize() override
Return the size of the underlying data type.
static vtkVariantArray * New()
vtkIdType InsertNextValue(vtkVariant value)
Expand the array by one and set the value at that location.
void InsertVariantValue(vtkIdType idx, vtkVariant value) override
Safely insert a value into the array from a variant.
int GetElementComponentSize() override
Return the size, in bytes, of the lowest-level element of an array.
Abstract superclass for all arrays.
virtual void DataElementChanged(vtkIdType id)
Tell the array explicitly that a single data element has changed.
void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source) override
Set the tuple at the ith location using the jth tuple in the source array.
Abstract superclass to iterate over elements in an vtkAbstractArray.
vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
void ClearLookup() override
Delete the associated fast lookup data structure on this array, if it exists.
unsigned long GetActualMemorySize() override
Return the memory in kibibytes (1024 bytes) consumed by this data array.
void SetVoidArray(void *arr, vtkIdType size, int save, int deleteM) override