Commit 3a23b636 authored by Jan Möbius's avatar Jan Möbius

Fixed some cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18748 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d5b68457
...@@ -148,6 +148,11 @@ slot_smooth() ...@@ -148,6 +148,11 @@ slot_smooth()
// Get triangle mesh // Get triangle mesh
TriMesh* mesh = PluginFunctions::triMesh(*o_it); 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){ if (data == 0){
data = new SmootherObject(); data = new SmootherObject();
o_it->setObjectData(SMOOTHER, data); o_it->setObjectData(SMOOTHER, data);
...@@ -219,8 +224,6 @@ slot_smooth() ...@@ -219,8 +224,6 @@ slot_smooth()
jobDescription += ") " + QString::number(tool_->sB_iter->value()) + " iterations"; 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 updatedObject( o_it->id(), UPDATE_GEOMETRY );
...@@ -266,6 +269,11 @@ void SmootherPlugin::smooth(int _objectId , int _iterations , QString _direction ...@@ -266,6 +269,11 @@ void SmootherPlugin::smooth(int _objectId , int _iterations , QString _direction
// Get triangle mesh // Get triangle mesh
TriMesh* mesh = PluginFunctions::triMesh(object); 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){ if (data == 0){
data = new SmootherObject(); data = new SmootherObject();
object->setObjectData(SMOOTHER, data); object->setObjectData(SMOOTHER, data);
...@@ -325,10 +333,7 @@ void SmootherPlugin::smooth(int _objectId , int _iterations , QString _direction ...@@ -325,10 +333,7 @@ void SmootherPlugin::smooth(int _objectId , int _iterations , QString _direction
jobDescription += ") " + QString::number(_iterations) + " iterations"; jobDescription += ") " + QString::number(_iterations) + " iterations";
if (mesh != 0) {
mesh->garbage_collection();
mesh->update_normals(); mesh->update_normals();
}
emit updatedObject( object->id(), UPDATE_GEOMETRY ); emit updatedObject( object->id(), UPDATE_GEOMETRY );
......
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