Skip to content

Commit 0360bc3

Browse files
committed
compile-time support for VTK7.1
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.
1 parent 491cc0f commit 0360bc3

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

io/include/pcl/io/impl/vtk_lib_io.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
#include <vtkStructuredGrid.h>
6262
#include <vtkVertexGlyphFilter.h>
6363

64+
#ifdef vtkGenericDataArray_h
65+
#define SetTupleValue SetTypedTuple
66+
#define InsertNextTupleValue InsertNextTypedTuple
67+
#define GetTupleValue GetTypedTuple
68+
#endif
69+
6470
///////////////////////////////////////////////////////////////////////////////////////////
6571
template <typename PointT> void
6672
pcl::io::vtkPolyDataToPointCloud (vtkPolyData* const polydata, pcl::PointCloud<PointT>& cloud)
@@ -503,5 +509,11 @@ pcl::io::pointCloudTovtkStructuredGrid (const pcl::PointCloud<PointT>& cloud, vt
503509
}
504510
}
505511

512+
#ifdef vtkGenericDataArray_h
513+
#undef SetTupleValue
514+
#undef InsertNextTupleValue
515+
#undef GetTupleValue
516+
#endif
517+
506518
#endif //#ifndef PCL_IO_VTK_IO_H_
507519

io/src/vtk_lib_io.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
#include <vtkImageShiftScale.h>
4747
#include <vtkPNGWriter.h>
4848

49+
#ifdef vtkGenericDataArray_h
50+
#define SetTupleValue SetTypedTuple
51+
#define InsertNextTupleValue InsertNextTypedTuple
52+
#define GetTupleValue GetTypedTuple
53+
#endif
54+
4955
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5056
int
5157
pcl::io::loadPolygonFile (const std::string &file_name, pcl::PolygonMesh& mesh)

surface/src/vtk_smoothing/vtk_utils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
#include <vtkPointData.h>
5050
#include <vtkFloatArray.h>
5151

52+
#ifdef vtkGenericDataArray_h
53+
#define SetTupleValue SetTypedTuple
54+
#define InsertNextTupleValue InsertNextTypedTuple
55+
#define GetTupleValue GetTypedTuple
56+
#endif
5257

5358
//////////////////////////////////////////////////////////////////////////////////////////////
5459
int

visualization/include/pcl/visualization/impl/pcl_visualizer.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464

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

67+
#ifdef vtkGenericDataArray_h
68+
#define SetTupleValue SetTypedTuple
69+
#define InsertNextTupleValue InsertNextTypedTuple
70+
#define GetTupleValue GetTypedTuple
71+
#endif
72+
6773
//////////////////////////////////////////////////////////////////////////////////////////////
6874
template <typename PointT> bool
6975
pcl::visualization::PCLVisualizer::addPointCloud (
@@ -1843,4 +1849,10 @@ pcl::visualization::PCLVisualizer::updatePolygonMesh (
18431849
return (true);
18441850
}
18451851

1852+
#ifdef vtkGenericDataArray_h
1853+
#undef SetTupleValue
1854+
#undef InsertNextTupleValue
1855+
#undef GetTupleValue
1856+
#endif
1857+
18461858
#endif

visualization/src/pcl_visualizer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@
104104
#include <boost/filesystem.hpp>
105105
#include <pcl/console/parse.h>
106106

107+
#ifdef vtkGenericDataArray_h
108+
#define SetTupleValue SetTypedTuple
109+
#define InsertNextTupleValue InsertNextTypedTuple
110+
#define GetTupleValue GetTypedTuple
111+
#endif
112+
107113
#if defined(_WIN32)
108114
// Remove macros defined in Windows.h
109115
#undef near

0 commit comments

Comments
 (0)