VTK  9.3.20240425
Macros | Typedefs | Functions
vtkIndexedArray.h File Reference
#include "vtkCommonCoreModule.h"
#include "vtkImplicitArray.h"
#include "vtkIndexedImplicitBackend.h"
#include <vector>
Include dependency graph for vtkIndexedArray.h:

Go to the source code of this file.

Macros

#define VTK_INDEXED_ARRAY_TEMPLATE_EXTERN
 

Typedefs

template<typename T >
using vtkIndexedArray = vtkImplicitArray< vtkIndexedImplicitBackend< T > >
 A utility alias for creating a wrapper array around an existing array and reindexing its components.
 

Functions

 vtkExternSecondOrderTemplateMacro (extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkIndexedImplicitBackend)
 

Macro Definition Documentation

◆ VTK_INDEXED_ARRAY_TEMPLATE_EXTERN

#define VTK_INDEXED_ARRAY_TEMPLATE_EXTERN

Definition at line 79 of file vtkIndexedArray.h.

Typedef Documentation

◆ vtkIndexedArray

template<typename T >
vtkIndexedArray

A utility alias for creating a wrapper array around an existing array and reindexing its components.

In order to be usefully included in the dispatchers, these arrays need to be instantiated at the vtk library compile time.

An example of potential usage:

baseArray->SetNumberOfComponents(1);
baseArray->SetNumberOfTuples(100);
auto range = vtk::DataArrayValueRange<1>(baseArray);
std::iota(range.begin(), range.end(), 0);
handles->SetNumberOfIds(100);
for (vtkIdType idx = 0; idx < 100; idx++)
{
handles->SetId(idx, 99-idx);
}
indexedArr->SetBackend(std::make_shared<vtkIndexedImplicitBackend<int>>(handles, baseArray));
indexedArr->SetNumberOfComponents(1);
indexedArr->SetNumberOfTuples(100);
CHECK(indexedArr->GetValue(57) == 42); // always true
A backend for the vtkImplicitArray framework allowing one to use a subset of a given data array,...
Allocate and hold a VTK object.
Definition vtkNew.h:160
int vtkIdType
Definition vtkType.h:315
See also
vtkImplicitArray vtkIndexedImplicitBackend

Definition at line 58 of file vtkIndexedArray.h.

Function Documentation

◆ vtkExternSecondOrderTemplateMacro()

vtkExternSecondOrderTemplateMacro ( extern template class VTKCOMMONCORE_EXPORT  vtkImplicitArray,
vtkIndexedImplicitBackend   
)