|
VTK
9.1.0
|
Struct-Of-Arrays implementation of vtkGenericDataArray. More...
#include <vtkSOADataArrayTemplate.h>
Public Types | |
| enum | DeleteMethod { VTK_DATA_ARRAY_FREE = vtkAbstractArray::VTK_DATA_ARRAY_FREE, VTK_DATA_ARRAY_DELETE = vtkAbstractArray::VTK_DATA_ARRAY_DELETE, VTK_DATA_ARRAY_ALIGNED_FREE = vtkAbstractArray::VTK_DATA_ARRAY_ALIGNED_FREE, VTK_DATA_ARRAY_USER_DEFINED = vtkAbstractArray::VTK_DATA_ARRAY_USER_DEFINED } |
| typedef vtkSOADataArrayTemplate< ValueTypeT > | SelfType |
| typedef Superclass::ValueType | ValueType |
Public Member Functions | |
| vtkTemplateTypeMacro (SelfType, GenericDataArrayType) | |
| void | GetTypedTuple (vtkIdType tupleIdx, ValueType *tuple) const |
| Copy the tuple at tupleIdx into tuple. More... | |
| void | SetTypedTuple (vtkIdType tupleIdx, const ValueType *tuple) |
| Set this array's tuple at tupleIdx to the values in tuple. More... | |
| ValueType | GetTypedComponent (vtkIdType tupleIdx, int comp) const |
| Get component comp of the tuple at tupleIdx. More... | |
| void | SetTypedComponent (vtkIdType tupleIdx, int comp, ValueType value) |
| Set component comp of the tuple at tupleIdx to value. More... | |
| void | FillTypedComponent (int compIdx, ValueType value) override |
| Set component comp of all tuples to value. More... | |
| void | SetArray (int comp, ValueType *array, vtkIdType size, bool updateMaxId=false, bool save=false, int deleteMethod=VTK_DATA_ARRAY_FREE) |
| Use this API to pass externally allocated memory to this instance. More... | |
| void | SetArrayFreeFunction (void(*callback)(void *)) override |
| This method allows the user to specify a custom free function to be called when the array is deallocated. More... | |
| void | SetArrayFreeFunction (int comp, void(*callback)(void *)) |
| This method allows the user to specify a custom free function to be called when the array is deallocated. More... | |
| ValueType * | GetComponentArrayPointer (int comp) |
| Return a pointer to a contiguous block of memory containing all values for a particular components (ie. More... | |
| void * | GetVoidPointer (vtkIdType valueIdx) override |
| Use of this method is discouraged, it creates a deep copy of the data into a contiguous AoS-ordered buffer and prints a warning. More... | |
| void | ExportToVoidPointer (void *ptr) override |
| Export a copy of the data in AoS ordering to the preallocated memory buffer. More... | |
| int | GetArrayType () const override |
| vtkArrayIterator * | NewIterator () override |
| void | SetNumberOfComponents (int numComps) override |
| void | ShallowCopy (vtkDataArray *other) override |
| void | InsertTuples (vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source) override |
| void | InsertTuples (vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source) override |
| ValueType | GetValue (vtkIdType valueIdx) const |
| Get the value at valueIdx. More... | |
| void | SetValue (vtkIdType valueIdx, ValueType value) |
| Set the value at valueIdx to value. More... | |
Static Public Member Functions | |
| static vtkSOADataArrayTemplate * | New () |
| static vtkSOADataArrayTemplate< ValueType > * | FastDownCast (vtkAbstractArray *source) |
| Perform a fast, safe cast from a vtkAbstractArray to a vtkDataArray. More... | |
Protected Member Functions | |
| vtkSOADataArrayTemplate () | |
| ~vtkSOADataArrayTemplate () override | |
| bool | AllocateTuples (vtkIdType numTuples) |
| Allocate space for numTuples. More... | |
| bool | ReallocateTuples (vtkIdType numTuples) |
| Allocate space for numTuples. More... | |
Protected Attributes | |
| std::vector< vtkBuffer< ValueType > * > | Data |
| vtkBuffer< ValueType > * | AoSCopy |
Friends | |
| class | vtkGenericDataArray< vtkSOADataArrayTemplate< ValueTypeT >, ValueTypeT > |
Struct-Of-Arrays implementation of vtkGenericDataArray.
vtkSOADataArrayTemplate is the counterpart of vtkAOSDataArrayTemplate. Each component is stored in a separate array.
Definition at line 39 of file vtkSOADataArrayTemplate.h.
| typedef vtkSOADataArrayTemplate<ValueTypeT> vtkSOADataArrayTemplate< ValueTypeT >::SelfType |
Definition at line 45 of file vtkSOADataArrayTemplate.h.
| typedef Superclass::ValueType vtkSOADataArrayTemplate< ValueTypeT >::ValueType |
Definition at line 47 of file vtkSOADataArrayTemplate.h.
| enum vtkSOADataArrayTemplate::DeleteMethod |
| Enumerator | |
|---|---|
| VTK_DATA_ARRAY_FREE | |
| VTK_DATA_ARRAY_DELETE | |
| VTK_DATA_ARRAY_ALIGNED_FREE | |
| VTK_DATA_ARRAY_USER_DEFINED | |
Definition at line 49 of file vtkSOADataArrayTemplate.h.
|
protected |
|
overrideprotected |
| vtkSOADataArrayTemplate< ValueTypeT >::vtkTemplateTypeMacro | ( | SelfType | , |
| GenericDataArrayType | |||
| ) |
|
static |
|
inline |
Get the value at valueIdx.
valueIdx assumes AOS ordering.
Definition at line 63 of file vtkSOADataArrayTemplate.h.
|
inline |
Set the value at valueIdx to value.
valueIdx assumes AOS ordering.
Definition at line 76 of file vtkSOADataArrayTemplate.h.
|
inline |
Copy the tuple at tupleIdx into tuple.
Definition at line 88 of file vtkSOADataArrayTemplate.h.
|
inline |
Set this array's tuple at tupleIdx to the values in tuple.
Definition at line 99 of file vtkSOADataArrayTemplate.h.
|
inline |
Get component comp of the tuple at tupleIdx.
Definition at line 110 of file vtkSOADataArrayTemplate.h.
|
inline |
Set component comp of the tuple at tupleIdx to value.
Definition at line 118 of file vtkSOADataArrayTemplate.h.
|
override |
Set component comp of all tuples to value.
| void vtkSOADataArrayTemplate< ValueTypeT >::SetArray | ( | int | comp, |
| ValueType * | array, | ||
| vtkIdType | size, | ||
| bool | updateMaxId = false, |
||
| bool | save = false, |
||
| int | deleteMethod = VTK_DATA_ARRAY_FREE |
||
| ) |
Use this API to pass externally allocated memory to this instance.
Since vtkSOADataArrayTemplate uses separate contiguous regions for each component, use this API to add arrays for each of the component. save: When set to true, vtkSOADataArrayTemplate will not release or realloc the memory even when the AllocatorType is set to RESIZABLE. If needed it will simply allow new memory buffers and "forget" the supplied pointers. When save is set to false, this will be the deleteMethod specified to release the array. If updateMaxId is true, the array's MaxId will be updated, and assumes that size is the number of tuples in the array. size is specified in number of elements of ScalarType.
|
override |
This method allows the user to specify a custom free function to be called when the array is deallocated.
Calling this method will implicitly mean that the given free function will be called when the class cleans up or reallocates memory. This custom free function will be used for all components.
| void vtkSOADataArrayTemplate< ValueTypeT >::SetArrayFreeFunction | ( | int | comp, |
| void(*)(void *) | callback | ||
| ) |
This method allows the user to specify a custom free function to be called when the array is deallocated.
Calling this method will implicitly mean that the given free function will be called when the class cleans up or reallocates memory.
| ValueType* vtkSOADataArrayTemplate< ValueTypeT >::GetComponentArrayPointer | ( | int | comp | ) |
Return a pointer to a contiguous block of memory containing all values for a particular components (ie.
a single array of the struct-of-arrays).
|
override |
Use of this method is discouraged, it creates a deep copy of the data into a contiguous AoS-ordered buffer and prints a warning.
|
override |
Export a copy of the data in AoS ordering to the preallocated memory buffer.
|
static |
Perform a fast, safe cast from a vtkAbstractArray to a vtkDataArray.
This method checks if source->GetArrayType() returns DataArray or a more derived type, and performs a static_cast to return source as a vtkDataArray pointer. Otherwise, nullptr is returned.
|
inlineoverride |
Definition at line 191 of file vtkSOADataArrayTemplate.h.
|
override |
|
override |
|
override |
|
override |
|
inlineoverride |
Definition at line 201 of file vtkSOADataArrayTemplate.h.
|
protected |
Allocate space for numTuples.
Old data is not preserved. If numTuples == 0, all data is freed.
|
protected |
Allocate space for numTuples.
Old data is preserved. If numTuples == 0, all data is freed.
|
friend |
Definition at line 229 of file vtkSOADataArrayTemplate.h.
|
protected |
Definition at line 222 of file vtkSOADataArrayTemplate.h.
|
protected |
Definition at line 223 of file vtkSOADataArrayTemplate.h.