VTK  9.5.20251115
vtkCompositeArray.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 vtkCompositeArray_h
5#define vtkCompositeArray_h
6
7#ifdef VTK_COMPOSITE_ARRAY_INSTANTIATING
8#define VTK_IMPLICIT_VALUERANGE_INSTANTIATING
9#include "vtkDataArrayPrivate.txx"
10#endif
11
12#include "vtkCommonCoreModule.h" // for export macro
13#include "vtkCompositeImplicitBackend.h" // for the array backend
14#include "vtkImplicitArray.h"
15
16#ifdef VTK_COMPOSITE_ARRAY_INSTANTIATING
17#undef VTK_IMPLICIT_VALUERANGE_INSTANTIATING
18#endif
19
20#include <vector>
21
50VTK_ABI_NAMESPACE_BEGIN
51class vtkDataArray;
52template <typename T>
55VTK_ABI_NAMESPACE_END
56
57namespace vtk
58{
59VTK_ABI_NAMESPACE_BEGIN
60template <typename T>
70 const std::vector<vtkDataArray*>& arrays);
71VTK_ABI_NAMESPACE_END
72}
73
74#endif // vtkCompositeArray_h
75
76#ifdef VTK_COMPOSITE_ARRAY_INSTANTIATING
77// The instantiation is separated in two functions because the .txx includes vtkArrayDispatch.h
78// which when Dispatching is enabled, it instantiates a class with a value type, before exporting it
79#define VTK_INSTANTIATE_COMPOSITE_ARRAY(ValueType) \
80 VTK_ABI_NAMESPACE_BEGIN \
81 template class VTKCOMMONCORE_EXPORT \
82 vtkImplicitArray<vtkCompositeImplicitBackend<ValueType>, vtkArrayTypes::VTK_COMPOSITE_ARRAY>; \
83 VTK_ABI_NAMESPACE_END \
84 namespace vtkDataArrayPrivate \
85 { \
86 VTK_ABI_NAMESPACE_BEGIN \
87 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE( \
88 VTK_WRAP_TEMPLATE(vtkImplicitArray<vtkCompositeImplicitBackend<ValueType>, \
89 vtkArrayTypes::VTK_COMPOSITE_ARRAY>), \
90 double) \
91 VTK_ABI_NAMESPACE_END \
92 }
93#define VTK_INSTANTIATE_COMPOSITE_ARRAY_FUNCTIONS(ValueType) \
94 namespace vtk \
95 { \
96 VTK_ABI_NAMESPACE_BEGIN \
97 template VTKCOMMONCORE_EXPORT vtkSmartPointer< \
98 vtkImplicitArray<vtkCompositeImplicitBackend<ValueType>, vtkArrayTypes::VTK_COMPOSITE_ARRAY>> \
99 ConcatenateDataArrays(const std::vector<vtkDataArray*>& arrays); \
100 VTK_ABI_NAMESPACE_END \
101 }
102
103#elif defined(VTK_USE_EXTERN_TEMPLATE)
104#ifndef VTK_COMPOSITE_ARRAY_TEMPLATE_EXTERN
105#define VTK_COMPOSITE_ARRAY_TEMPLATE_EXTERN
106#ifdef _MSC_VER
107#pragma warning(push)
108// The following is needed when the vtkCompositeArray is declared
109// dllexport and is used from another class in vtkCommonCore
110#pragma warning(disable : 4910) // extern and dllexport incompatible
111#endif
112VTK_ABI_NAMESPACE_BEGIN
114 extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkCompositeImplicitBackend,
116#ifdef _MSC_VER
117#pragma warning(pop)
118#endif
119VTK_ABI_NAMESPACE_END
120#endif // VTK_COMPOSITE_ARRAY_TEMPLATE_EXTERN
121// The following clause is only for MSVC 2008 and 2010
122#elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
123#pragma warning(push)
124// C4091: 'extern ' : ignored on left of 'int' when no variable is declared
125#pragma warning(disable : 4091)
126
127// Compiler-specific extension warning.
128#pragma warning(disable : 4231)
129
130// We need to disable warning 4910 and do an extern dllexport
131// anyway. When deriving new arrays from an
132// instantiation of this template the compiler does an explicit
133// instantiation of the base class. From outside the vtkCommon
134// library we block this using an extern dllimport instantiation.
135// For classes inside vtkCommon we should be able to just do an
136// extern instantiation, but VS 2008 complains about missing
137// definitions. We cannot do an extern dllimport inside vtkCommon
138// since the symbols are local to the dll. An extern dllexport
139// seems to be the only way to convince VS 2008 to do the right
140// thing, so we just disable the warning.
141#pragma warning(disable : 4910) // extern and dllexport incompatible
142
143// Use an "extern explicit instantiation" to give the class a DLL
144// interface. This is a compiler-specific extension.
145VTK_ABI_NAMESPACE_BEGIN
147 extern template class VTKCOMMONCORE_EXPORT vtkImplicitArray, vtkCompositeImplicitBackend,
149
150#pragma warning(pop)
151
152VTK_ABI_NAMESPACE_END
153#endif
A utility structure serving as a backend for composite arrays: an array composed of multiple arrays c...
abstract superclass for arrays of numeric data
A read only array class that wraps an implicit function from integers to any value type supported by ...
Hold a reference to a vtkObjectBase instance.
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
vtkSmartPointer< vtkCompositeArray< T > > ConcatenateDataArrays(const std::vector< vtkDataArray * > &arrays)
#define vtkInstantiateSecondOrderWithParameterTemplateMacro(decl0, decl1, par)
Definition vtkType.h:445
@ VTK_COMPOSITE_ARRAY
Definition vtkType.h:92
#define vtkExternSecondOrderWithParameterTemplateMacro(decl0, decl1, par)
Definition vtkType.h:495