diff --git a/Code/FlowSolvers/ThreeDSolver/svPre/cmd.h b/Code/FlowSolvers/ThreeDSolver/svPre/cmd.h index f38f67e..a5b5da2 100644 --- a/Code/FlowSolvers/ThreeDSolver/svPre/cmd.h +++ b/Code/FlowSolvers/ThreeDSolver/svPre/cmd.h @@ -57,6 +57,17 @@ #include "vtkPolyData.h" #include "vtkDoubleArray.h" +// Set directive to use vtkIdType const *pts if +// VTK version is 9 or large. +// +#include + +#ifdef VTK_VERSION_NUMBER +#if VTK_VERSION_NUMBER >= 90020210809ULL +#define VTK_USE_NEW_ID_TYPE +#endif +#endif + #ifdef WIN32 #define CALLTYPE __cdecl #else diff --git a/Code/FlowSolvers/ThreeDSolver/svPre/helpers.cxx b/Code/FlowSolvers/ThreeDSolver/svPre/helpers.cxx index 75f14ff..820a3af 100644 --- a/Code/FlowSolvers/ThreeDSolver/svPre/helpers.cxx +++ b/Code/FlowSolvers/ThreeDSolver/svPre/helpers.cxx @@ -1915,7 +1915,13 @@ int VtkUtils_GetAllPolys( vtkPolyData *pd, int *numPgns, vtkIdType **pgns ) { vtkCellArray *pdPgns; int size, i; - vtkIdType npts, *pts; + vtkIdType npts; + + #ifdef VTK_USE_NEW_ID_TYPE + vtkIdType const *pts; + #else + vtkIdType *pts; + #endif int pos = 0; (*numPgns) = pd->GetNumberOfPolys(); diff --git a/Code/FlowSolvers/ThreeDSolver/svPre/presolver-vtk-cmds.cxx b/Code/FlowSolvers/ThreeDSolver/svPre/presolver-vtk-cmds.cxx index c727d28..dc19ba6 100644 --- a/Code/FlowSolvers/ThreeDSolver/svPre/presolver-vtk-cmds.cxx +++ b/Code/FlowSolvers/ThreeDSolver/svPre/presolver-vtk-cmds.cxx @@ -680,8 +680,14 @@ int cmd_mesh_and_adjncy_vtu(char *cmd) { vtkIdType cellId; vtkIdType meshCellId; vtkIdType p1, p2, p3; + + #ifdef VTK_USE_NEW_ID_TYPE + vtkIdType const *pts; + #else + vtkIdType *pts; + #endif + vtkIdType npts = 0; - vtkIdType *pts = 0; vtkSmartPointer < vtkIdList > ptIds = vtkSmartPointer < vtkIdList > ::New(); vtkSmartPointer < vtkIdList > cellIds = vtkSmartPointer < vtkIdList > ::New();