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

Fixed some cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18748 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 73d7a7f2
......@@ -230,7 +230,6 @@ void GlutViewer::keyboard(int key, int /* x */ , int /* y */ )
switch (key) {
case 27: {
exit(0);
break;
}
case GLUT_KEY_F12: {
......
......@@ -482,8 +482,6 @@ void CoreWidget::showAboutWidget( ) {
openGLQtVersion += tr("3.1") ;
else if (flags.testFlag(QGLFormat::OpenGL_Version_3_0))
openGLQtVersion += tr("3.0") ;
else if (flags.testFlag(QGLFormat::OpenGL_Version_3_0))
openGLQtVersion += tr("3.0") ;
else if (flags.testFlag(QGLFormat::OpenGL_Version_2_1))
openGLQtVersion += tr("2.1" );
else if (flags.testFlag(QGLFormat::OpenGL_Version_2_0))
......
......@@ -148,6 +148,11 @@ slot_smooth()
// Get triangle mesh
TriMesh* mesh = PluginFunctions::triMesh(*o_it);
if ( mesh == NULL ) {
emit log(LOGERR, "Unable to get mesh from object( Only Triangle Meshes supported)");
return;
}
if (data == 0){
data = new SmootherObject();
o_it->setObjectData(SMOOTHER, data);
......@@ -219,9 +224,7 @@ slot_smooth()
jobDescription += ") " + QString::number(tool_->sB_iter->value()) + " iterations";
if (mesh != 0)
// mesh->garbage_collection();
mesh->update_normals();
mesh->update_normals();
emit updatedObject( o_it->id(), UPDATE_GEOMETRY );
emit createBackup(o_it->id(), "Smoothing", UPDATE_GEOMETRY );
......@@ -266,6 +269,11 @@ void SmootherPlugin::smooth(int _objectId , int _iterations , QString _direction
// Get triangle mesh
TriMesh* mesh = PluginFunctions::triMesh(object);
if ( mesh == NULL ) {
emit log(LOGERR, "Unable to get mesh from object( Only Triangle Meshes supported)");
return;
}
if (data == 0){
data = new SmootherObject();
object->setObjectData(SMOOTHER, data);
......@@ -325,10 +333,7 @@ void SmootherPlugin::smooth(int _objectId , int _iterations , QString _direction
jobDescription += ") " + QString::number(_iterations) + " iterations";
if (mesh != 0) {
mesh->garbage_collection();
mesh->update_normals();
}
mesh->update_normals();
emit updatedObject( object->id(), UPDATE_GEOMETRY );
......
......@@ -499,10 +499,10 @@ void TopologyPlugin::split_face(QMouseEvent* _event) {
TriMesh& m = *PluginFunctions::triMesh(object);
TriMesh::FaceHandle fh = m.face_handle(target_idx);
emit( log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") );
emit log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") ;
TriMesh::VertexHandle vh = m.add_vertex(hit_point);
m.split(fh,vh);
......@@ -518,10 +518,10 @@ void TopologyPlugin::split_face(QMouseEvent* _event) {
PolyMesh& m = *PluginFunctions::polyMesh(object);
PolyMesh::FaceHandle fh = m.face_handle(target_idx);
emit( log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") );
emit log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") ;
PolyMesh::VertexHandle vh = m.add_vertex(hit_point);
m.split(fh,vh);
......@@ -557,10 +557,10 @@ void TopologyPlugin::delete_face(QMouseEvent* _event) {
if ( object->picked(node_idx) && object->dataType(DATA_TRIANGLE_MESH) ) {
TriMesh& m = *PluginFunctions::triMesh(object);
TriMesh::FaceHandle fh = m.face_handle(target_idx);
emit( log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") );
emit log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") ;
m.delete_face(fh);
m.garbage_collection();
......@@ -569,10 +569,10 @@ void TopologyPlugin::delete_face(QMouseEvent* _event) {
if ( object->picked(node_idx) && object->dataType(DATA_POLY_MESH) ) {
PolyMesh& m = *PluginFunctions::polyMesh(object);
PolyMesh::FaceHandle fh = m.face_handle(target_idx);
emit( log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") );
emit log(LOGOUT,"Picked Face " + QString::number(fh.idx()) + ", normal (" +
QString::number(m.normal(fh)[0]) + "," +
QString::number(m.normal(fh)[1]) + "," +
QString::number(m.normal(fh)[2]) + ") ") ;
m.delete_face(fh);
m.garbage_collection();
......@@ -804,7 +804,7 @@ void TopologyPlugin::split_edge(QMouseEvent* _event) {
m.split(closest_edge,hit_point);
emit log(LOGOUT,"Picked Edge " + QString::number(closest_edge.idx()));
emit log(LOGOUT,"Picked Edge " + QString::number(closest_edge.idx() ));
emit updatedObject(object->id(), UPDATE_TOPOLOGY);
emit updateView();
......@@ -839,7 +839,7 @@ void TopologyPlugin::split_edge(QMouseEvent* _event) {
m.split(closest_edge,hit_point);
emit log(LOGOUT,"Picked Edge " + QString::number(closest_edge.idx()));
emit log(LOGOUT,"Picked Edge " + QString::number(closest_edge.idx()) );
emit updatedObject(object->id(), UPDATE_TOPOLOGY);
emit updateView();
......
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