Skip to content

Commit

Permalink
Fix compile error C2440 of pcl_visualization on MSVC
Browse files Browse the repository at this point in the history
The pcl_visualization occur compile error C2440 on MSVC.
This error occurs because that can not directly cast to enum type from
double type in MSVC.
It must explicitly cast to int type from double type before cast to enum
type.
  • Loading branch information
UnaNancyOwen committed Jun 16, 2016
1 parent 757e28a commit 8710ee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties (
actor->GetMapper ()->ScalarVisibilityOn ();
actor->GetMapper ()->SetScalarRange (range[0], range[1]);
vtkSmartPointer<vtkLookupTable> table;
if (!pcl::visualization::getColormapLUT (static_cast<LookUpTableRepresentationProperties>(value), table))
if (!pcl::visualization::getColormapLUT (static_cast<LookUpTableRepresentationProperties>(static_cast<int>(value)), table))
break;
table->SetRange (range[0], range[1]);
actor->GetMapper ()->SetLookupTable (table);
Expand Down Expand Up @@ -1738,7 +1738,7 @@ pcl::visualization::PCLVisualizer::setShapeRenderingProperties (
actor->GetMapper ()->ScalarVisibilityOn ();
actor->GetMapper ()->SetScalarRange (range[0], range[1]);
vtkSmartPointer<vtkLookupTable> table = vtkSmartPointer<vtkLookupTable>::New ();
getColormapLUT (static_cast<LookUpTableRepresentationProperties>(value), table);
getColormapLUT (static_cast<LookUpTableRepresentationProperties>(static_cast<int>(value)), table);
table->SetRange (range[0], range[1]);
actor->GetMapper ()->SetLookupTable (table);
style_->updateLookUpTableDisplay (false);
Expand Down

0 comments on commit 8710ee9

Please sign in to comment.