VTK  9.3.20240420
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
45#include "vtkCommonCoreModule.h"
46
47#include <memory>
48
49VTK_ABI_NAMESPACE_BEGIN
50class vtkDataArray;
51class vtkIdList;
52template <typename ValueType>
53class VTKCOMMONCORE_EXPORT vtkIndexedImplicitBackend final
54{
55public:
57
66
71 ValueType operator()(int idx) const;
72
77 unsigned long getMemorySize() const;
78
79private:
80 struct Internals;
81 std::unique_ptr<Internals> Internal;
82};
83VTK_ABI_NAMESPACE_END
84
85#endif // vtkIndexedImplicitBackend_h
86
87#if defined(VTK_INDEXED_BACKEND_INSTANTIATING)
88
89#define VTK_INSTANTIATE_INDEXED_BACKEND(ValueType) \
90 VTK_ABI_NAMESPACE_BEGIN \
91 template class VTKCOMMONCORE_EXPORT vtkIndexedImplicitBackend<ValueType>; \
92 VTK_ABI_NAMESPACE_END
93
94#elif defined(VTK_USE_EXTERN_TEMPLATE)
95
96#ifndef VTK_INDEXED_BACKEND_TEMPLATE_EXTERN
97#define VTK_INDEXED_BACKEND_TEMPLATE_EXTERN
98#ifdef _MSC_VER
99#pragma warning(push)
100#pragma warning(disable : 4910) // extern and dllexport incompatible
101#endif
102VTK_ABI_NAMESPACE_BEGIN
103vtkExternTemplateMacro(extern template class VTKCOMMONCORE_EXPORT vtkIndexedImplicitBackend);
104VTK_ABI_NAMESPACE_END
105#ifdef _MSC_VER
106#pragma warning(pop)
107#endif
108#endif // VTK_INDEXED_IMPLICIT_BACKEND_TEMPLATE_EXTERN
109
110#endif
abstract superclass for arrays of numeric data
list of point or cell ids
Definition vtkIdList.h:133
A backend for the vtkImplicitArray framework allowing one to use a subset of a given data array,...
unsigned long getMemorySize() const
Returns the smallest integer memory size in KiB needed to store the array.
vtkIndexedImplicitBackend(vtkDataArray *indexes, vtkDataArray *array)
Constructor.
ValueType operator()(int idx) const
Indexing operation for the indexed array respecting the backend expectations of vtkImplicitArray
vtkIndexedImplicitBackend(vtkIdList *indexes, vtkDataArray *array)
Constructor.
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:410