Skip to content

Commit

Permalink
compile-time support for VTK7.1
Browse files Browse the repository at this point in the history
The *TupleValue function family got removed in favor of the *TypedTuple functions.

To preserve backward compatibility with older VTK versions,
this introduces local macro-overloads for the used functions.
  • Loading branch information
v4hn committed Jan 5, 2017
1 parent 491cc0f commit 7884dbd
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
13 changes: 13 additions & 0 deletions io/include/pcl/io/impl/vtk_lib_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
#include <vtkStructuredGrid.h>
#include <vtkVertexGlyphFilter.h>

// Support for VTK 7.1 upwards
#ifdef vtkGenericDataArray_h
#define SetTupleValue SetTypedTuple
#define InsertNextTupleValue InsertNextTypedTuple
#define GetTupleValue GetTypedTuple
#endif

///////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT> void
pcl::io::vtkPolyDataToPointCloud (vtkPolyData* const polydata, pcl::PointCloud<PointT>& cloud)
Expand Down Expand Up @@ -503,5 +510,11 @@ pcl::io::pointCloudTovtkStructuredGrid (const pcl::PointCloud<PointT>& cloud, vt
}
}

#ifdef vtkGenericDataArray_h
#undef SetTupleValue
#undef InsertNextTupleValue
#undef GetTupleValue
#endif

#endif //#ifndef PCL_IO_VTK_IO_H_

7 changes: 7 additions & 0 deletions io/src/vtk_lib_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
#include <vtkImageShiftScale.h>
#include <vtkPNGWriter.h>

// Support for VTK 7.1 upwards
#ifdef vtkGenericDataArray_h
#define SetTupleValue SetTypedTuple
#define InsertNextTupleValue InsertNextTypedTuple
#define GetTupleValue GetTypedTuple
#endif

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int
pcl::io::loadPolygonFile (const std::string &file_name, pcl::PolygonMesh& mesh)
Expand Down
6 changes: 6 additions & 0 deletions surface/src/vtk_smoothing/vtk_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
#include <vtkPointData.h>
#include <vtkFloatArray.h>

// Support for VTK 7.1 upwards
#ifdef vtkGenericDataArray_h
#define SetTupleValue SetTypedTuple
#define InsertNextTupleValue InsertNextTypedTuple
#define GetTupleValue GetTypedTuple
#endif

//////////////////////////////////////////////////////////////////////////////////////////////
int
Expand Down
13 changes: 13 additions & 0 deletions visualization/include/pcl/visualization/impl/pcl_visualizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@

#include <pcl/visualization/common/shapes.h>

// Support for VTK 7.1 upwards
#ifdef vtkGenericDataArray_h
#define SetTupleValue SetTypedTuple
#define InsertNextTupleValue InsertNextTypedTuple
#define GetTupleValue GetTypedTuple
#endif

//////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointT> bool
pcl::visualization::PCLVisualizer::addPointCloud (
Expand Down Expand Up @@ -1843,4 +1850,10 @@ pcl::visualization::PCLVisualizer::updatePolygonMesh (
return (true);
}

#ifdef vtkGenericDataArray_h
#undef SetTupleValue
#undef InsertNextTupleValue
#undef GetTupleValue
#endif

#endif
7 changes: 7 additions & 0 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@
#include <boost/filesystem.hpp>
#include <pcl/console/parse.h>

// Support for VTK 7.1 upwards
#ifdef vtkGenericDataArray_h
#define SetTupleValue SetTypedTuple
#define InsertNextTupleValue InsertNextTypedTuple
#define GetTupleValue GetTypedTuple
#endif

#if defined(_WIN32)
// Remove macros defined in Windows.h
#undef near
Expand Down

0 comments on commit 7884dbd

Please sign in to comment.