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

Cleanup subdivider:

- Sripting slots don't use ui anymore ( Thanks to  Vladimir Chalupecky for the patch)
- Added more user output to inform on errors or unsupported algorithms.
- Fixed slot descriptions ( the subdivider is not a smoother ;-) )
- Updated Vsi xmls

closes  #2040



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18298 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cb4bb7b9
This diff is collapsed.
......@@ -106,17 +106,46 @@ private slots:
/// Make plugin available in no-GUI mode
void noguiSupported( ) {} ;
void slotSubdivideUniform();
void slotSubdivideUniformButton();
void slotSimpleSubdivide();
void slotSimpleSubdivideButton();
public slots:
/// Scripting slot for subdivision
void subdivide(int _objectId, QString _algorithm , int _steps);
/** \brief Scripting slot for subdivision
*
* Supported algorithm are:
*
* Polymeshes:
* - catmullClark
*
* Triangle Meshes:
* - loop
* - sqrt3
* - interpolating_sqrt3
* - modifiedButterfly
*
* @param _objectId Object to work on
* @param _algorithm String describing the algorithm to use
* @param _steps Number of iterations
* @param _update_points Update original point locations
*/
void subdivide(int _objectId, QString _algorithm , int _steps, bool _update_points = true);
/// Scripting slot for the simple subdivision algorithms
void simpleSubdivide(int _objectId, QString _algorithm , int _steps, double _parameter);
/** \brief Scripting slot for the simple subdivision algorithms
*
* Supported algorithm are:
*
* Triangle meshes:
* - longest (Split all edges in descending order until all edges are shorter than given maximal edge length)
*
* @param _objectId Object to work on
* @param _algorithm String describing the algorithm to use
* @param _steps Number of iterations
* @param _parameter Additional parameter depending on the algorithm (usually the maximal edge length in the final mesh)
* @param _update_points Update original point locations
*/
void simpleSubdivide(int _objectId, QString _algorithm , int _steps, double _parameter, bool _update_points = true);
public :
......
......@@ -17,9 +17,14 @@
<max>1000</max>
<precision>1</precision>
</input>
<input name="update" type="Bool" external="false">
<short>Update original points</short>
<long>Update original points</long>
<default>true</default>
</input>
</inputs>
<code>
subdivider.subdivide([input="obj"],"loop",[input="steps"]);
subdivider.subdivide([input="obj"],"loop",[input="steps"],[input="update"]);
</code>
</element>
<element name="sqrt3_subdivider">
......@@ -40,9 +45,14 @@
<max>1000</max>
<precision>1</precision>
</input>
<input name="update" type="Bool" external="false">
<short>Update original points</short>
<long>Update original points</long>
<default>true</default>
</input>
</inputs>
<code>
subdivider.subdivide([input="obj"],"sqrt3",[input="steps"]);
subdivider.subdivide([input="obj"],"sqrt3",[input="steps"],[input="update"]);
</code>
</element>
<element name="interpolating_sqrt3_subdivider">
......@@ -63,9 +73,14 @@
<max>1000</max>
<precision>1</precision>
</input>
<input name="update" type="Bool" external="false">
<short>Update original points</short>
<long>Update original points</long>
<default>true</default>
</input>
</inputs>
<code>
subdivider.subdivide([input="obj"],"interpolating_sqrt3",[input="steps"]);
subdivider.subdivide([input="obj"],"interpolating_sqrt3",[input="steps"],[input="update"]);
</code>
</element>
<element name="modifiedButterfly_subdivider">
......@@ -86,9 +101,47 @@
<max>1000</max>
<precision>1</precision>
</input>
<input name="update" type="Bool" external="false">
<short>Update original points</short>
<long>Update original points</long>
<default>true</default>
</input>
</inputs>
<code>
subdivider.subdivide([input="obj"],"modifiedButterfly",[input="steps"]);
subdivider.subdivide([input="obj"],"modifiedButterfly",[input="steps"],[input="update"]);
</code>
</element>
</element>
<element name="longestEdgeSplit_subdivider">
<category>Algorithms</category>
<short>Subdivider(Longest edge split)</short>
<long>Very simple algorithm splitting all edges longer than the given length, starting at the longest one.</long>
<dataflow>true</dataflow>
<inputs>
<input name="obj" type="ObjectId">
<short>ID of an Object</short>
<long>ID of an Object</long>
</input>
<input name="steps" type="Number" external="false">
<short>Number of iterations</short>
<long>Desired number of subdivision steps</long>
<default>1</default>
<min>1</min>
<max>1000</max>
<precision>1</precision>
</input>
<input name="max_length" type="Number">
<short>Maximal edge length</short>
<long>Maximal edge length in the final mesh</long>
<default>1.0</default>
</input>
<input name="update" type="Bool" external="false">
<short>Update original points</short>
<long>Update original points</long>
<default>true</default>
</input>
</inputs>
<code>
subdivider.simpleSubdivide([input="obj"],"longest",[input="steps"],[input="max_length"],[input="update"]);
</code>
</element>
</OpenFlipper>
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