Commit 63e91ab5 authored by Jan Möbius's avatar Jan Möbius

Interface implementation for subdivider extension of update points

refs #266



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13458 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fc9d19a2
......@@ -85,7 +85,7 @@ void SubdividerPlugin::pluginsInitialized()
{
emit setSlotDescription("subdivide(int,QString,int)", "Smooth a triangular mesh",
QString("object_id,algorithm,iterations").split(","),
QString("id of an object, algorithm to use (loop | sqrt3 | interpolating_sqrt3 | modifiedButterfly ), number of iterations").split(","));
QString("id of an object, algorithm to use (linear | loop | sqrt3 | interpolating_sqrt3 | modifiedButterfly ), number of iterations").split(","));
}
//-----------------------------------------------------------------------------
......@@ -97,7 +97,6 @@ void SubdividerPlugin::slotSubdivideUniform()
{
for (unsigned int i = 0; i < ids.size(); ++i)
{
if(tool_->loop_radioButton->isChecked())
{
subdivide(ids[i],"loop",tool_->subdivision_steps_spinBox->value());
......@@ -129,12 +128,13 @@ void SubdividerPlugin::subdivide(int _objectId, QString _algorithm , int _steps)
TriMesh* mesh = PluginFunctions::triMesh(object);
if(_algorithm.contains("loop",Qt::CaseInsensitive))
{
OpenMesh::Subdivider::Uniform::LoopT<TriMesh,double> subdivider;
subdivider.attach(*mesh);
subdivider(_steps);
subdivider(*mesh,_steps,tool_->updatePoints->isChecked());
subdivider.detach();
}
else if ( _algorithm.contains("sqrt3",Qt::CaseInsensitive) )
......@@ -142,7 +142,7 @@ void SubdividerPlugin::subdivide(int _objectId, QString _algorithm , int _steps)
OpenMesh::Subdivider::Uniform::Sqrt3T<TriMesh,double> subdivider;
subdivider.attach(*mesh);
subdivider(_steps);
subdivider(_steps,tool_->updatePoints->isChecked());
subdivider.detach();
}
else if ( _algorithm.contains("interpolating_sqrt(3)",Qt::CaseInsensitive) )
......@@ -150,7 +150,7 @@ void SubdividerPlugin::subdivide(int _objectId, QString _algorithm , int _steps)
OpenMesh::Subdivider::Uniform::InterpolatingSqrt3LGT<TriMesh,double> subdivider;
subdivider.attach(*mesh);
subdivider(_steps);
subdivider(_steps,tool_->updatePoints->isChecked());
subdivider.detach();
}
else if ( _algorithm.contains("modifiedButterfly",Qt::CaseInsensitive) )
......@@ -158,7 +158,7 @@ void SubdividerPlugin::subdivide(int _objectId, QString _algorithm , int _steps)
OpenMesh::Subdivider::Uniform::ModifiedButterflyT<TriMesh,double> subdivider;
subdivider.attach(*mesh);
subdivider(_steps);
subdivider(_steps,tool_->updatePoints->isChecked());
subdivider.detach();
}
......
......@@ -13,7 +13,7 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
......@@ -37,7 +37,7 @@
<property name="title">
<string>Uniform Subdivision</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
......@@ -103,6 +103,25 @@ of SIGGRAPH 1996, ACM SIGGRAPH, 1996, pp. 189-192.</string>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="updatePoints">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Update Points</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
......
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