Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VTK 9 API changes that were causing compilation errors #126

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading