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 Dec 3, 2016
1 parent 491cc0f commit 0360bc3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
12 changes: 12 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,12 @@
#include <vtkStructuredGrid.h>
#include <vtkVertexGlyphFilter.h>

#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 +509,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_

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

#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
5 changes: 5 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,11 @@
#include <vtkPointData.h>
#include <vtkFloatArray.h>

#ifdef vtkGenericDataArray_h
#define SetTupleValue SetTypedTuple
#define InsertNextTupleValue InsertNextTypedTuple
#define GetTupleValue GetTypedTuple
#endif

//////////////////////////////////////////////////////////////////////////////////////////////
int
Expand Down
12 changes: 12 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,12 @@

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

#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 +1849,10 @@ pcl::visualization::PCLVisualizer::updatePolygonMesh (
return (true);
}

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

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

#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 0360bc3

Please sign in to comment.