Skip to content

Commit

Permalink
Merge pull request #1770 from v4hn/vtk71-support
Browse files Browse the repository at this point in the history
compile-time support for VTK7.1
  • Loading branch information
jspricke committed Jan 5, 2017
2 parents a2648ba + 7884dbd commit ad67293
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
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
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
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
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
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 ad67293

Please sign in to comment.