Fixed build with pcl > 1.11.1 (#641)

This commit is contained in:
matlabbe
2020-11-14 16:52:01 -05:00
parent f9abcf9e35
commit 54e2688a1d
17 changed files with 75 additions and 49 deletions

View File

@@ -562,12 +562,16 @@ public:
* \return true if the operation was successful (the handler is capable and
* the input cloud was given as a valid pointer), false otherwise
*/
virtual bool
getColor (vtkSmartPointer<vtkDataArray> &scalars) const
{
#if PCL_VERSION_COMPARE(>, 1, 11, 1)
virtual vtkSmartPointer<vtkDataArray> getColor () const {
vtkSmartPointer<vtkDataArray> scalars;
if (!capable_ || !cloud_)
return scalars;
#else
virtual bool getColor (vtkSmartPointer<vtkDataArray> &scalars) const {
if (!capable_ || !cloud_)
return (false);
#endif
if (!scalars)
scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
scalars->SetNumberOfComponents (3);
@@ -645,7 +649,11 @@ public:
reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetNumberOfTuples (0);
//delete [] colors;
delete [] intensities;
#if PCL_VERSION_COMPARE(>, 1, 11, 1)
return scalars;
#else
return (true);
#endif
}
protected: