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
This commit is contained in:
@@ -72,23 +72,25 @@ void DecimaterViewerWidget::keyPressEvent(QKeyEvent* _event)
|
|||||||
int rc;
|
int rc;
|
||||||
if ( (rc=decimater_->decimate(steps_)) )
|
if ( (rc=decimater_->decimate(steps_)) )
|
||||||
{
|
{
|
||||||
decimater_->mesh().garbage_collection();
|
decimater_->mesh().garbage_collection();
|
||||||
std::cout << rc << " vertices removed!\n";
|
std::cout << rc << " vertices removed!\n";
|
||||||
updateGL();
|
updateGL();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cout << "Decimation failed\n";
|
std::cout << "Decimation failed\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Key_Plus:
|
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();
|
updateGL();
|
||||||
std::cout << "# decimating steps increased to " << steps_ << std::endl;
|
std::cout << "# decimating steps increased to " << steps_ << std::endl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key_Minus:
|
case Key_Minus:
|
||||||
steps_ = std::max( --steps_, size_t(1) );
|
--steps_;
|
||||||
|
steps_ = std::max( steps_ , size_t(1) );
|
||||||
updateGL();
|
updateGL();
|
||||||
std::cout << "# decimating steps increased to " << steps_ << std::endl;
|
std::cout << "# decimating steps increased to " << steps_ << std::endl;
|
||||||
break;
|
break;
|
||||||
@@ -100,7 +102,7 @@ void DecimaterViewerWidget::keyPressEvent(QKeyEvent* _event)
|
|||||||
opt += OpenMesh::IO::Options::Binary;
|
opt += OpenMesh::IO::Options::Binary;
|
||||||
|
|
||||||
if (OpenMesh::IO::write_mesh( mesh(), "result.off", opt ))
|
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;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user