Commit a7fb53f8 authored by Mike Kremer's avatar Mike Kremer

Updated simple smoother plugin so that it operates on vertex selections (if available).

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7321 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 24d261b2
......@@ -85,6 +85,8 @@ void SmootherPlugin::simpleLaplace() {
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
bool selectionExists = false;
if ( o_it->dataType( DATA_TRIANGLE_MESH ) ) {
// Get the mesh to work on
......@@ -102,11 +104,17 @@ void SmootherPlugin::simpleLaplace() {
TriMesh::VertexIter v_it, v_end=mesh->vertices_end();
for (v_it=mesh->vertices_begin(); v_it!=v_end; ++v_it) {
mesh->property( origPositions, v_it ) = mesh->point(v_it);
// See if at least one vertex has been selected
selectionExists |= mesh->status(v_it).selected();
}
// Do one smoothing step (For each point of the mesh ... )
for (v_it=mesh->vertices_begin(); v_it!=v_end; ++v_it) {
if(selectionExists && mesh->status(v_it).selected() == false) {
continue;
}
TriMesh::Point point = TriMesh::Point(0.0,0.0,0.0);
// Flag, to skip boundary vertices
......@@ -163,11 +171,17 @@ void SmootherPlugin::simpleLaplace() {
PolyMesh::VertexIter v_it, v_end=mesh->vertices_end();
for (v_it=mesh->vertices_begin(); v_it!=v_end; ++v_it) {
mesh->property( origPositions, v_it ) = mesh->point(v_it);
// See if at least one vertex has been selected
selectionExists |= mesh->status(v_it).selected();
}
// Do one smoothing step (For each point of the mesh ... )
for (v_it=mesh->vertices_begin(); v_it!=v_end; ++v_it) {
if(selectionExists && mesh->status(v_it).selected() == false) {
continue;
}
PolyMesh::Point point = PolyMesh::Point(0.0,0.0,0.0);
// Flag, to skip boundary vertices
......
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