VTK  9.6.20260505
vtkIndexedImplicitBackend.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3// Funded by CEA, DAM, DIF, F-91297 Arpajon, France
4#ifndef vtkIndexedImplicitBackend_h
5#define vtkIndexedImplicitBackend_h
6
44
45#include "vtkCommonCoreModule.h"
46
47#include "vtkType.h"
48
49#include <memory>
50
51VTK_ABI_NAMESPACE_BEGIN
52class vtkDataArray;
53class vtkIdList;
54template <typename ValueType>
55class VTKCOMMONCORE_EXPORT vtkIndexedImplicitBackend final
56{
57public:
59
66 vtkIndexedImplicitBackend(vtkIdList* indexes, vtkDataArray* array, bool mapTuples = false);
67 vtkIndexedImplicitBackend(vtkDataArray* indexes, vtkDataArray* array, bool mapTuples = false);
70
75 ValueType operator()(vtkIdType idx) const;
76
81 unsigned long getMemorySize() const;
82
87
92
96 bool GetMapTuples() const;
97
98private:
99 struct Internals;
100 std::unique_ptr<Internals> Internal;
101};
102VTK_ABI_NAMESPACE_END
103
104#endif // vtkIndexedImplicitBackend_h
105
106#if defined(VTK_INDEXED_BACKEND_INSTANTIATING)
107
108#define VTK_INSTANTIATE_INDEXED_BACKEND(ValueType) \
109 VTK_ABI_NAMESPACE_BEGIN \
110 template class VTKCOMMONCORE_EXPORT vtkIndexedImplicitBackend<ValueType>; \
111 VTK_ABI_NAMESPACE_END
112
113#elif defined(VTK_USE_EXTERN_TEMPLATE)
114
115#ifndef VTK_INDEXED_BACKEND_TEMPLATE_EXTERN
116#define VTK_INDEXED_BACKEND_TEMPLATE_EXTERN
117#ifdef _MSC_VER
118#pragma warning(push)
119#pragma warning(disable : 4910) // extern and dllexport incompatible
120#endif
121VTK_ABI_NAMESPACE_BEGIN
122vtkExternTemplateMacro(extern template class VTKCOMMONCORE_EXPORT vtkIndexedImplicitBackend);
123VTK_ABI_NAMESPACE_END
124#ifdef _MSC_VER
125#pragma warning(pop)
126#endif
127#endif // VTK_INDEXED_IMPLICIT_BACKEND_TEMPLATE_EXTERN
128
129#endif
list of point or cell ids
Definition vtkIdList.h:135
A backend for the vtkImplicitArray framework allowing one to use a subset of a given data array,...
vtkDataArray * GetIndexArray() const
Get the original index array used for indirection.
unsigned long getMemorySize() const
Returns the smallest integer memory size in KiB needed to store the array.
bool GetMapTuples() const
Get if the indexed array is mapping tuples or values.
ValueType operator()(vtkIdType idx) const
Indexing operation for the indexed array respecting the backend expectations of vtkImplicitArray
vtkIndexedImplicitBackend(vtkDataArray *indexes, vtkDataArray *array, bool mapTuples=false)
Constructor.
vtkDataArray * GetBaseArray() const
Get the original base array used for value lookup.
vtkIndexedImplicitBackend(vtkIdList *indexes, vtkDataArray *array, bool mapTuples=false)
Constructor.
#define vtkDataArray
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:458
int vtkIdType
Definition vtkType.h:363