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

Added toolboxes for adaptive subdivision

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10246 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8baf5193
...@@ -23,23 +23,19 @@ void SubdividerPlugin::initializePlugin() ...@@ -23,23 +23,19 @@ void SubdividerPlugin::initializePlugin()
QSize size(300, 300); QSize size(300, 300);
tool_->resize(size); tool_->resize(size);
connect(tool_->subdivide_toolButton, SIGNAL( clicked() ), this, SLOT( slot_subdivide() ) ); connect(tool_->subdivide_uniform_toolButton, SIGNAL( clicked() ), this, SLOT( slotSubdivideUniform() ) );
emit addToolbox( tr("Subdivider") , tool_ ); emit addToolbox( tr("Subdivider") , tool_ );
} }
} }
void SubdividerPlugin::slotPickModeChanged( const std::string& /*_mode*/)
{
}
void SubdividerPlugin::pluginsInitialized() void SubdividerPlugin::pluginsInitialized()
{ {
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void SubdividerPlugin::slot_subdivide() void SubdividerPlugin::slotSubdivideUniform()
{ {
std::vector< int > ids; std::vector< int > ids;
if ( PluginFunctions::getTargetIdentifiers( ids ) ) if ( PluginFunctions::getTargetIdentifiers( ids ) )
...@@ -117,22 +113,4 @@ bool SubdividerPlugin::test_trimesh_object(int _identifier, BaseObjectData*& _ob ...@@ -117,22 +113,4 @@ bool SubdividerPlugin::test_trimesh_object(int _identifier, BaseObjectData*& _ob
return true; return true;
} }
//-----------------------------------------------------------------------------
void SubdividerPlugin::slotMouseEvent( QMouseEvent* /*_event*/ )
{
}
//-----------------------------------------------------------------------------
void SubdividerPlugin::slotKeyEvent( QKeyEvent* _event )
{
switch (_event->key())
{
default:
break;
}
} // END slotKeyEvent
Q_EXPORT_PLUGIN2( subdividerplugin , SubdividerPlugin ); Q_EXPORT_PLUGIN2( subdividerplugin , SubdividerPlugin );
...@@ -9,11 +9,8 @@ ...@@ -9,11 +9,8 @@
#include <OpenFlipper/BasePlugin/BaseInterface.hh> #include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh> #include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/BasePlugin/ToolboxInterface.hh> #include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
#include <OpenFlipper/BasePlugin/KeyInterface.hh>
#include <OpenFlipper/BasePlugin/BackupInterface.hh> #include <OpenFlipper/BasePlugin/BackupInterface.hh>
#include <OpenFlipper/BasePlugin/MouseInterface.hh>
#include <OpenFlipper/BasePlugin/ScriptInterface.hh> #include <OpenFlipper/BasePlugin/ScriptInterface.hh>
#include <OpenFlipper/BasePlugin/PickingInterface.hh>
#include <OpenFlipper/BasePlugin/LoadSaveInterface.hh> #include <OpenFlipper/BasePlugin/LoadSaveInterface.hh>
#include <OpenFlipper/BasePlugin/BackupInterface.hh> #include <OpenFlipper/BasePlugin/BackupInterface.hh>
#include <OpenFlipper/common/Types.hh> #include <OpenFlipper/common/Types.hh>
...@@ -25,16 +22,13 @@ ...@@ -25,16 +22,13 @@
//typename OpenMesh::Subdivider::Uniform:LoopT<TriMesh> LoopT; //typename OpenMesh::Subdivider::Uniform:LoopT<TriMesh> LoopT;
//typename OpenMesh::Subdivider::Uniform:Sqrt3T<TriMesh> Sqrt3T; //typename OpenMesh::Subdivider::Uniform:Sqrt3T<TriMesh> Sqrt3T;
class SubdividerPlugin : public QObject, BaseInterface , ToolboxInterface, LoggingInterface, PickingInterface, MouseInterface, LoadSaveInterface, KeyInterface, ScriptInterface, BackupInterface class SubdividerPlugin : public QObject, BaseInterface , ToolboxInterface, LoggingInterface, LoadSaveInterface, ScriptInterface, BackupInterface
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(BaseInterface) Q_INTERFACES(BaseInterface)
Q_INTERFACES(ToolboxInterface) Q_INTERFACES(ToolboxInterface)
Q_INTERFACES(LoggingInterface) Q_INTERFACES(LoggingInterface)
Q_INTERFACES(MouseInterface)
Q_INTERFACES(PickingInterface)
Q_INTERFACES(LoadSaveInterface) Q_INTERFACES(LoadSaveInterface)
Q_INTERFACES(KeyInterface)
Q_INTERFACES(ScriptInterface) Q_INTERFACES(ScriptInterface)
Q_INTERFACES(BackupInterface) Q_INTERFACES(BackupInterface)
...@@ -53,8 +47,6 @@ signals: ...@@ -53,8 +47,6 @@ signals:
void scriptInfo( QString _functionName ); void scriptInfo( QString _functionName );
void registerKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse = false);
// ToolboxInterface // ToolboxInterface
void addToolbox( QString _name , QWidget* _widget ); void addToolbox( QString _name , QWidget* _widget );
...@@ -63,14 +55,6 @@ signals: ...@@ -63,14 +55,6 @@ signals:
private slots: private slots:
void slotMouseEvent( QMouseEvent* _event );
void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/){};
void slotPickModeChanged( const std::string& _mode);
void slotKeyEvent( QKeyEvent* _event );
void initializePlugin(); void initializePlugin();
void pluginsInitialized(); void pluginsInitialized();
...@@ -80,7 +64,7 @@ private slots: ...@@ -80,7 +64,7 @@ private slots:
public slots: public slots:
void slot_subdivide(); void slotSubdivideUniform();
public : public :
~SubdividerPlugin() {}; ~SubdividerPlugin() {};
......
...@@ -33,75 +33,160 @@ ...@@ -33,75 +33,160 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <widget class="QGroupBox" name="groupBox">
<item> <property name="title">
<widget class="QLabel" name="label_2"> <string>Uniform Subdivision</string>
<property name="text"> </property>
<string>Method:</string> <layout class="QVBoxLayout" name="verticalLayout_3">
</property> <item>
</widget> <layout class="QHBoxLayout" name="horizontalLayout_2">
</item> <item>
<item> <widget class="QLabel" name="label_2">
<layout class="QVBoxLayout" name="verticalLayout"> <property name="text">
<item> <string>Method:</string>
<layout class="QHBoxLayout" name="horizontalLayout"> </property>
<item> </widget>
<widget class="QRadioButton" name="loop_radioButton"> </item>
<property name="toolTip"> <item>
<string>C. T. Loop, &quot;Smooth Subdivision Surfaces Based on Triangles&quot;, <layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="loop_radioButton">
<property name="toolTip">
<string>C. T. Loop, &quot;Smooth Subdivision Surfaces Based on Triangles&quot;,
M.S. Thesis, Department of Mathematics, University of Utah, August 1987.</string> M.S. Thesis, Department of Mathematics, University of Utah, August 1987.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Loop</string> <string>Loop</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="sqrt3_radioButton"> <widget class="QRadioButton" name="sqrt3_radioButton">
<property name="toolTip"> <property name="toolTip">
<string>L. Kobbelt, &lt;a href=&quot;http://www-i8.informatik.rwth-aachen.de/publications/downloads/sqrt3.pdf&quot;&gt;&quot;Sqrt(3) subdivision&quot;&lt;/a&gt;, Proceedings of SIGGRAPH 2000.</string> <string>L. Kobbelt, &lt;a href=&quot;http://www-i8.informatik.rwth-aachen.de/publications/downloads/sqrt3.pdf&quot;&gt;&quot;Sqrt(3) subdivision&quot;&lt;/a&gt;, Proceedings of SIGGRAPH 2000.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Sqrt3</string> <string>Sqrt3</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="LabsikGreiner_radioButton"> <widget class="QRadioButton" name="LabsikGreiner_radioButton">
<property name="toolTip"> <property name="toolTip">
<string>Interpolating Labsik Greiner Subdivider as described in &quot;interpolating sqrt(3) subdivision&quot; Labsik &amp; Greiner, 2000</string> <string>Interpolating Labsik Greiner Subdivider as described in &quot;interpolating sqrt(3) subdivision&quot; Labsik &amp; Greiner, 2000</string>
</property> </property>
<property name="text"> <property name="text">
<string>Interpolating Sqrt3</string> <string>Interpolating Sqrt3</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="modifiedButterfly_radioButton"> <widget class="QRadioButton" name="modifiedButterfly_radioButton">
<property name="toolTip"> <property name="toolTip">
<string>The modified butterfly scheme of Denis Zorin, Peter Schröder and Wim Sweldens, <string>The modified butterfly scheme of Denis Zorin, Peter Schröder and Wim Sweldens,
``Interpolating subdivision for meshes with arbitrary topology,'' in Proceedings ``Interpolating subdivision for meshes with arbitrary topology,'' in Proceedings
of SIGGRAPH 1996, ACM SIGGRAPH, 1996, pp. 189-192.</string> of SIGGRAPH 1996, ACM SIGGRAPH, 1996, pp. 189-192.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Modified Butterfly</string> <string>Modified Butterfly</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="subdivide_uniform_toolButton">
<property name="text">
<string>Subdivide</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="subdivide_toolButton"> <widget class="QGroupBox" name="groupBox_2">
<property name="text"> <property name="title">
<string>Subdivide</string> <string>Adaptive Subdivision</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="subdivide__adaptive_toolButton">
<property name="text">
<string>Subdivide</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <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