@@ -171,4 +171,78 @@ class vtkAoSDataArrayTemplate :
171
171
};
172
172
173
173
#include " vtkAoSDataArrayTemplate.txx"
174
+
175
+ // Ported over from vtkDataArrayTemplate:
176
+
177
+ #if !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
178
+ # define VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE (T ) \
179
+ template class VTKCOMMONCORE_EXPORT vtkAoSDataArrayTemplate< T >
180
+ #else
181
+ // TODO Not sure what this does, need to dig some:
182
+ // # include "vtkDataArrayTemplateImplicit.txx"
183
+ // # define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T)
174
184
#endif
185
+
186
+ #endif // header guard
187
+
188
+ // TODO clean this up, more or less copy/pasted from vtkDataArrayTemplate.h:
189
+
190
+ // This portion must be OUTSIDE the include blockers. Each
191
+ // vtkDataArray subclass uses this to give its instantiation of this
192
+ // template a DLL interface.
193
+ #if defined(VTK_DATA_ARRAY_TEMPLATE_TYPE) && !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
194
+ # if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER)
195
+ # pragma warning (push)
196
+ # pragma warning (disable: 4091) // warning C4091: 'extern ' :
197
+ // ignored on left of 'int' when no variable is declared
198
+ # pragma warning (disable: 4231) // Compiler-specific extension warning.
199
+
200
+ // We need to disable warning 4910 and do an extern dllexport
201
+ // anyway. When deriving vtkCharArray and other types from an
202
+ // instantiation of this template the compiler does an explicit
203
+ // instantiation of the base class. From outside the vtkCommon
204
+ // library we block this using an extern dllimport instantiation.
205
+ // For classes inside vtkCommon we should be able to just do an
206
+ // extern instantiation, but VS 2008 complains about missing
207
+ // definitions. We cannot do an extern dllimport inside vtkCommon
208
+ // since the symbols are local to the dll. An extern dllexport
209
+ // seems to be the only way to convince VS 2008 to do the right
210
+ // thing, so we just disable the warning.
211
+ # pragma warning (disable: 4910) // extern and dllexport incompatible
212
+
213
+ // Use an "extern explicit instantiation" to give the class a DLL
214
+ // interface. This is a compiler-specific extension.
215
+ extern VTK_AOS_DATA_ARRAY_TEMPLATE_INSTANTIATE (VTK_DATA_ARRAY_TEMPLATE_TYPE);
216
+ # pragma warning (pop)
217
+ # endif
218
+ # undef VTK_DATA_ARRAY_TEMPLATE_TYPE
219
+ #endif
220
+
221
+ // This macro is used by the subclasses to create dummy
222
+ // declarations for these functions such that the wrapper
223
+ // can see them. The wrappers ignore vtkDataArrayTemplate.
224
+ #define vtkCreateWrappedArrayInterface (T ) \
225
+ int GetDataType (); \
226
+ void GetTupleValue (vtkIdType i, T* tuple); \
227
+ void SetTupleValue (vtkIdType i, const T* tuple); \
228
+ void InsertTupleValue (vtkIdType i, const T* tuple); \
229
+ vtkIdType InsertNextTupleValue (const T* tuple); \
230
+ T GetValue (vtkIdType id); \
231
+ void SetValue (vtkIdType id, T value); \
232
+ void SetNumberOfValues (vtkIdType number); \
233
+ void InsertValue (vtkIdType id, T f); \
234
+ vtkIdType InsertNextValue (T f); \
235
+ T *GetValueRange (int comp); \
236
+ T *GetValueRange (); \
237
+ T* WritePointer (vtkIdType id, vtkIdType number); \
238
+ T* GetPointer (vtkIdType id)/* ; \
239
+
240
+ * These methods are not wrapped to avoid wrappers exposing these
241
+ * easy-to-get-wrong methods because passing in the wrong value for 'save' is
242
+ * guaranteed to cause a memory issue down the line. Either the wrappers
243
+ * didn't use malloc to allocate the memory or the memory isn't actually
244
+ * persisted because a temporary array is used that doesn't persist like this
245
+ * method expects.
246
+
247
+ void SetArray(T* array, vtkIdType size, int save); \
248
+ void SetArray(T* array, vtkIdType size, int save, int deleteMethod) */
0 commit comments