From c5fd77dd98bdb3ae182ffee560f4e3f6d26ad8d7 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Mon, 12 Dec 2016 19:33:06 +0100 Subject: [PATCH] [MeL] Update deprecated typeTemplate for vtk-7.1. --- MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h | 17 ++++++++++++++--- MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h | 19 +++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h b/MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h index 8373f6454e9..642b1ee8b1d 100644 --- a/MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h +++ b/MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h @@ -18,20 +18,31 @@ #include <vtkMappedDataArray.h> #include <vtkObjectFactory.h> // for vtkStandardNewMacro -#include <vtkTypeTemplate.h> // For templated vtkObject API #include <vtkVersion.h> +#if VTK_MAJOR_VERSION < 7 || VTK_MINOR_VERSION < 1 +#include <vtkTypeTemplate.h> // For templated vtkObject API +#endif + #include "MeshLib/Elements/Element.h" namespace MeshLib { - template <class Scalar> class VtkMappedPropertyVectorTemplate : +#if VTK_MAJOR_VERSION >= 7 && VTK_MINOR_VERSION >= 1 + public vtkMappedDataArray<Scalar> +#else public vtkTypeTemplate<VtkMappedPropertyVectorTemplate<Scalar>, - vtkMappedDataArray<Scalar> > + vtkMappedDataArray<Scalar>> +#endif // vtk version { public: +#if VTK_MAJOR_VERSION >= 7 && VTK_MINOR_VERSION >= 1 + vtkTemplateTypeMacro(VtkMappedPropertyVectorTemplate<Scalar>, + vtkMappedDataArray<Scalar>); +#else vtkMappedDataArrayNewInstanceMacro(VtkMappedPropertyVectorTemplate<Scalar>); +#endif // vtk version static VtkMappedPropertyVectorTemplate* New(); virtual void PrintSelf(std::ostream &os, vtkIndent indent) override; diff --git a/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h index 15bd4b72fb0..87333375af2 100644 --- a/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h +++ b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h @@ -18,9 +18,12 @@ #include <vtkMappedDataArray.h> #include <vtkObjectFactory.h> // for vtkStandardNewMacro -#include <vtkTypeTemplate.h> // For templated vtkObject API #include <vtkVersion.h> +#if VTK_MAJOR_VERSION < 7 || VTK_MINOR_VERSION < 1 +#include <vtkTypeTemplate.h> // For templated vtkObject API +#endif + namespace MeshLib { class Node; @@ -28,14 +31,22 @@ namespace MeshLib namespace MeshLib { - template <class Scalar> -class VtkMeshNodalCoordinatesTemplate: +class VtkMeshNodalCoordinatesTemplate : +#if VTK_MAJOR_VERSION >= 7 && VTK_MINOR_VERSION >= 1 + public vtkMappedDataArray<Scalar> +#else public vtkTypeTemplate<VtkMeshNodalCoordinatesTemplate<Scalar>, - vtkMappedDataArray<Scalar> > + vtkMappedDataArray<Scalar>> +#endif // vtk version { public: +#if VTK_MAJOR_VERSION >= 7 && VTK_MINOR_VERSION >= 1 + vtkTemplateTypeMacro(VtkMeshNodalCoordinatesTemplate<Scalar>, + vtkMappedDataArray<Scalar>); +#else vtkMappedDataArrayNewInstanceMacro(VtkMeshNodalCoordinatesTemplate<Scalar>); +#endif // vtk version static VtkMeshNodalCoordinatesTemplate *New(); virtual void PrintSelf(std::ostream &os, vtkIndent indent) override; -- GitLab