Skip to content

Commit

Permalink
Fix a bug in PCLVisualizer::setShapeRenderingProperties
Browse files Browse the repository at this point in the history
Prevents fall-through in switch from PCL_VISUALIZER_LUT to PCL_VISUALIZER_LUT_RANGE case.
  • Loading branch information
taketwo committed Mar 10, 2019
1 parent 213da11 commit 15a9a8a
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 15a9a8a

Please sign in to comment.