Skip to content

Commit

Permalink
Merge pull request #126 from ktbolt/vtk-9-changes_118
Browse files Browse the repository at this point in the history
Fix VTK 9 API changes that were causing compilation errors
  • Loading branch information
ktbolt committed Jan 26, 2024
2 parents aa91387 + 5fc15d4 commit cf1e3b3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Code/FlowSolvers/ThreeDSolver/svPre/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <vtkVersion.h>

#ifdef VTK_VERSION_NUMBER
#if VTK_VERSION_NUMBER >= 90020210809ULL
#define VTK_USE_NEW_ID_TYPE
#endif
#endif

#ifdef WIN32
#define CALLTYPE __cdecl
#else
Expand Down
8 changes: 7 additions & 1 deletion Code/FlowSolvers/ThreeDSolver/svPre/helpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 7 additions & 1 deletion Code/FlowSolvers/ThreeDSolver/svPre/presolver-vtk-cmds.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cf1e3b3

Please sign in to comment.