|
VTK
9.6.20260325
|
A utility structure serving as a backend for composite arrays: an array composed of multiple arrays concatenated together. More...
#include <vtkCompositeImplicitBackend.h>
Public Member Functions | |
| vtkCompositeImplicitBackend (const std::vector< vtkDataArray * > &arrays) | |
| Constructor for the backend. | |
| vtkCompositeImplicitBackend (vtkDataArrayCollection *arrays) | |
| ~vtkCompositeImplicitBackend () | |
| ValueType | operator() (vtkIdType idx) const |
Indexing operator for the composite of the two arrays respecting the vtkImplicitArray expectations. | |
| unsigned long | getMemorySize () const |
| Returns the smallest integer memory size in KiB needed to store the array. | |
| vtkIdType | GetNumberOfArrays () const |
| Get the number of original arrays composing this backend. | |
| vtkDataArray * | GetArray (vtkIdType idx) const |
| Get the original array at the given index. | |
| vtkIdType | GetOffset (vtkIdType idx) const |
| Get the tuple offset of the array at the given index. | |
Protected Attributes | |
| std::unique_ptr< Internals > | Internal |
A utility structure serving as a backend for composite arrays: an array composed of multiple arrays concatenated together.
This structure can be classified as a closure and can be called using syntax similar to a function call.
This class uses indirect addressing of cached arrays to provide an access compute complexity of O(log_2(number_of_arrays)) through its () operator.
At construction it takes an array arrays in order to represent their concatenation.
An example of potential usage in a vtkImplicitArray
WARNING: Arrays input to the backend are flattened upon use and are no longer sensitive to component information.
Definition at line 52 of file vtkCompositeImplicitBackend.h.
| vtkCompositeImplicitBackend< ValueType >::vtkCompositeImplicitBackend | ( | const std::vector< vtkDataArray * > & | arrays | ) |
Constructor for the backend.
| arrays | std::vector of arrays to composite together leftArr->GetNumberOfTuples() |
| vtkCompositeImplicitBackend< ValueType >::vtkCompositeImplicitBackend | ( | vtkDataArrayCollection * | arrays | ) |
| vtkCompositeImplicitBackend< ValueType >::~vtkCompositeImplicitBackend | ( | ) |
| ValueType vtkCompositeImplicitBackend< ValueType >::operator() | ( | vtkIdType | idx | ) | const |
Indexing operator for the composite of the two arrays respecting the vtkImplicitArray expectations.
Conceptually, the composite array uses a binary search algorithm through the use of std::upper_bounds to offer a compute complexity of O(log_2(n_arrays))
| unsigned long vtkCompositeImplicitBackend< ValueType >::getMemorySize | ( | ) | const |
Returns the smallest integer memory size in KiB needed to store the array.
The memory size of the composite array is calculated as the sum of the sizes of its components. Used to implement GetActualMemorySize on vtkCompositeArray.
| vtkIdType vtkCompositeImplicitBackend< ValueType >::GetNumberOfArrays | ( | ) | const |
Get the number of original arrays composing this backend.
| vtkDataArray * vtkCompositeImplicitBackend< ValueType >::GetArray | ( | vtkIdType | idx | ) | const |
Get the original array at the given index.
| vtkIdType vtkCompositeImplicitBackend< ValueType >::GetOffset | ( | vtkIdType | idx | ) | const |
Get the tuple offset of the array at the given index.
TupleOffset[i] = cumulative number of tuples in arrays 0..i-1.
|
protected |
Definition at line 98 of file vtkCompositeImplicitBackend.h.