Commit dfc4cb09 authored by Jan Möbius's avatar Jan Möbius
Browse files

Removed compiler warning in Decimater widget where behaviour could be undefined

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@414 fdac6126-5c0c-442c-9429-916003d36597
parent 8996906c
......@@ -72,23 +72,25 @@ void DecimaterViewerWidget::keyPressEvent(QKeyEvent* _event)
int rc;
if ( (rc=decimater_->decimate(steps_)) )
{
decimater_->mesh().garbage_collection();
std::cout << rc << " vertices removed!\n";
updateGL();
decimater_->mesh().garbage_collection();
std::cout << rc << " vertices removed!\n";
updateGL();
}
else
std::cout << "Decimation failed\n";
std::cout << "Decimation failed\n";
break;
}
case Key_Plus:
steps_ = std::min( ++steps_, (size_t)(mesh_.n_vertices() * 0.1) );
++steps_;
steps_ = std::min( steps_ , (size_t)( mesh_.n_vertices() / 10 ) );
updateGL();
std::cout << "# decimating steps increased to " << steps_ << std::endl;
break;
case Key_Minus:
steps_ = std::max( --steps_, size_t(1) );
--steps_;
steps_ = std::max( steps_ , size_t(1) );
updateGL();
std::cout << "# decimating steps increased to " << steps_ << std::endl;
break;
......@@ -100,7 +102,7 @@ void DecimaterViewerWidget::keyPressEvent(QKeyEvent* _event)
opt += OpenMesh::IO::Options::Binary;
if (OpenMesh::IO::write_mesh( mesh(), "result.off", opt ))
std::cout << "mesh saved in 'result.off'\n";
std::cout << "mesh saved in 'result.off'\n";
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment