Skip to content

Commit

Permalink
Merge pull request #2900 from taketwo/fix-setshaperenderingprops
Browse files Browse the repository at this point in the history
Fix a bug in `PCLVisualizer::setShapeRenderingProperties`
  • Loading branch information
SergioRAgostinho committed Mar 10, 2019
2 parents 604af83 + 15a9a8a commit dd90516
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1866,13 +1866,14 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties (
table->SetRange (range[0], range[1]);
actor->GetMapper ()->SetLookupTable (table);
style_->updateLookUpTableDisplay (false);
break;
}
case PCL_VISUALIZER_LUT_RANGE:
{
// Check if the mapper has scalars
if (!actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ())
break;

// Check that scalars are not unisgned char (i.e. check if a LUT is used to colormap scalars assuming vtk ColorMode is Default)
if (actor->GetMapper ()->GetInput ()->GetPointData ()->GetScalars ()->IsA ("vtkUnsignedCharArray"))
break;
Expand All @@ -1888,7 +1889,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties (
break;
}
break;
}
}
default:
{
pcl::console::print_error ("[setShapeRenderingProperties] Unknown property (%d) specified!\n", property);
Expand Down

0 comments on commit dd90516

Please sign in to comment.