Skip to content

Commit

Permalink
Merge pull request #762 from VictorLamoine/master
Browse files Browse the repository at this point in the history
Prevent undefined behaviour when drawing axis
  • Loading branch information
jspricke committed Jun 23, 2014
2 parents c9c6147 + 720d507 commit b46a149
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ pcl::visualization::PCLVisualizer::removeCoordinateSystem (int viewport)
void
pcl::visualization::PCLVisualizer::addCoordinateSystem (double scale, const std::string &id, int viewport)
{
if (scale <= 0.0)
scale = 1.0;
vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New ();
axes->SetOrigin (0, 0, 0);
axes->SetScaleFactor (scale);
Expand Down Expand Up @@ -622,6 +624,8 @@ pcl::visualization::PCLVisualizer::addCoordinateSystem (double scale, const std:
void
pcl::visualization::PCLVisualizer::addCoordinateSystem (double scale, float x, float y, float z, const std::string& id, int viewport)
{
if (scale <= 0.0)
scale = 1.0;
vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New ();
axes->SetOrigin (0, 0, 0);
axes->SetScaleFactor (scale);
Expand Down Expand Up @@ -700,6 +704,8 @@ double q[4];
void
pcl::visualization::PCLVisualizer::addCoordinateSystem (double scale, const Eigen::Affine3f& t, const std::string& id, int viewport)
{
if (scale <= 0.0)
scale = 1.0;
vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New ();
axes->SetOrigin (0, 0, 0);
axes->SetScaleFactor (scale);
Expand Down

0 comments on commit b46a149

Please sign in to comment.