Commit d32f1783 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'master' into restructure_ObjectTypes

parents ef6eb983 f1f6b7ad
......@@ -55,6 +55,7 @@
#include <OpenMesh/Tools/Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh>
#include <OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh>
#include <OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh>
#include <OpenMesh/Tools/Subdivider/Uniform/MidpointT.hh>
#include <OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh>
......@@ -137,6 +138,9 @@ void SubdividerPlugin::slotSubdivideUniformButton()
else if ( tool_->catmullClark_radioButton->isChecked() )
{
subdivide(ids[i],"catmullClark",tool_->subdivision_steps_spinBox->value(), tool_->updatePoints->isChecked());
} else if ( tool_->midpoint_radioButton->isChecked() )
{
subdivide(ids[i],"midpoint",tool_->subdivision_steps_spinBox->value(), tool_->updatePoints->isChecked());
}
// Create backup
......@@ -279,6 +283,13 @@ void SubdividerPlugin::subdivide(int _objectId, QString _algorithm , int _steps,
{
OpenMesh::Subdivider::Uniform::ModifiedButterflyT<TriMesh,double> subdivider;
subdivider.attach(*mesh);
subdivider(_steps,_update_points);
subdivider.detach();
} else if ( _algorithm.contains("midpoint",Qt::CaseInsensitive) )
{
OpenMesh::Subdivider::Uniform::MidpointT<TriMesh,double> subdivider;
subdivider.attach(*mesh);
subdivider(_steps,_update_points);
subdivider.detach();
......
......@@ -119,6 +119,16 @@ of SIGGRAPH 1996, ACM SIGGRAPH, 1996, pp. 189-192.</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="midpoint_radioButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Midpoint subdivision algorithm&lt;/p&gt;&lt;p&gt;With every step, the set of vertices is replaced with by the midpoints of all current edges. Then, two sets of faces are created to set up the new connectivity: From all midpoints of edges surrounding an original face, a new face is created. Also, for all midpoints of edges surrounding an original vertex, a new face is created&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note: This algorithm is best suited for closed meshes since boundaries tend to fragment into isolated faces after a few iterations!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Midpoint</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......
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