Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
larshg committed Aug 24, 2020
1 parent b087c37 commit 29c6f61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions gpu/kinfu/tools/kinfu_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ namespace pcl
* \return true if the operation was successful (the handler is capable and
* the input cloud was given as a valid pointer), false otherwise
*/
bool
getColor (vtkSmartPointer<vtkDataArray> &scalars) const override
vtkSmartPointer<vtkDataArray>
getColor () const override
{
if (!capable_ || !cloud_)
return (false);
return nullptr;

if (!scalars)
scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
auto scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();

scalars->SetNumberOfComponents (3);

vtkIdType nr_points = vtkIdType (cloud_->size ());
Expand All @@ -157,7 +157,7 @@ namespace pcl
colors[idx + 1] = (*rgb_)[cp].g;
colors[idx + 2] = (*rgb_)[cp].b;
}
return (true);
return scalars;
}

private:
Expand Down
11 changes: 5 additions & 6 deletions gpu/kinfu_large_scale/tools/color_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ namespace pcl
capable_ = true;
}

bool
getColor (vtkSmartPointer<vtkDataArray> &scalars) const override
vtkSmartPointer<vtkDataArray>
getColor () const override
{
if (!capable_)
return (false);
return nullptr;

if (!scalars)
scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
auto scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
scalars->SetNumberOfComponents (3);

vtkIdType nr_points = static_cast<vtkIdType>(cloud_->size ());
Expand All @@ -88,7 +87,7 @@ namespace pcl
colors[idx + 1] = (*rgb_)[cp].g;
colors[idx + 2] = (*rgb_)[cp].b;
}
return (true);
return scalars;
}

private:
Expand Down

0 comments on commit 29c6f61

Please sign in to comment.