VTK  9.4.20250102
vtkAffineImplicitBackend.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 vtkAffineImplicitBackend_h
5#define vtkAffineImplicitBackend_h
6
7#include "vtkCommonCoreModule.h"
8
9#include "vtkType.h"
10
35VTK_ABI_NAMESPACE_BEGIN
36template <typename ValueType>
37struct VTKCOMMONCORE_EXPORT vtkAffineImplicitBackend final
38{
45 vtkAffineImplicitBackend(ValueType slope, ValueType intercept);
46
53 ValueType operator()(vtkIdType index) const;
54
58 ValueType Slope;
62 ValueType Intercept;
63};
64VTK_ABI_NAMESPACE_END
65
66#if defined(VTK_AFFINE_BACKEND_INSTANTIATING)
67
68#define VTK_INSTANTIATE_AFFINE_BACKEND(ValueType) \
69 VTK_ABI_NAMESPACE_BEGIN \
70 template struct VTKCOMMONCORE_EXPORT vtkAffineImplicitBackend<ValueType>; \
71 VTK_ABI_NAMESPACE_END
72
73#elif defined(VTK_USE_EXTERN_TEMPLATE)
74
75#ifndef VTK_AFFINE_BACKEND_TEMPLATE_EXTERN
76#define VTK_AFFINE_BACKEND_TEMPLATE_EXTERN
77#ifdef _MSC_VER
78#pragma warning(push)
79#pragma warning(disable : 4910) // extern and dllexport incompatible
80#endif
81VTK_ABI_NAMESPACE_BEGIN
82vtkExternTemplateMacro(extern template struct VTKCOMMONCORE_EXPORT vtkAffineImplicitBackend);
83VTK_ABI_NAMESPACE_END
84#ifdef _MSC_VER
85#pragma warning(pop)
86#endif
87#endif // VTK_AFFINE_IMPLICIT_BACKEND_TEMPLATE_EXTERN
88
89#endif
90#endif // vtkAffineImplicitBackend_h
A utility structure serving as a backend for affine (as a function of the index) implicit arrays.
vtkAffineImplicitBackend(ValueType slope, ValueType intercept)
A non-trivially constructible constructor.
ValueType Intercept
The value of the affine function at index 0.
ValueType Slope
The slope of the affine function on the indices.
ValueType operator()(vtkIdType index) const
The main call method for the backend.
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
Definition vtkType.h:410
int vtkIdType
Definition vtkType.h:315