Commit 94384333 authored by Jan Möbius's avatar Jan Möbius
Browse files

Deleted catmull clark plugin, as it has been integrated into the subdivision plugin.



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14810 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8ad0e8e7
include (plugin)
openflipper_plugin ()
//=============================================================================
//
// CLASS CatmullClarkPlugin - IMPLEMENTATION
//
//=============================================================================
//== INCLUDES =================================================================
#include <Qt>
#include <QtGui>
#include <QSpacerItem>
#include "CatmullClarkPlugin.hh"
#include <iostream>
#include <ACG/Utils/StopWatch.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
// #include <PhySim/QtWidgets/QwtFunctionPlot.hh>
// #include <PhySim/Meshes/PrincipalCurvatureT.hh>
// #include <PhySim/Meshes/PrincipalCurvatureJetT.hh>
// #include <PhySim/Math/Algorithms.hh>
#undef min
#undef max
//== IMPLEMENTATION ==========================================================
void CatmullClarkPlugin::initializePlugin()
{
tool_ = new CatmullClarkToolbar();
QSize size(300,300);
tool_->resize(size);
// connect button press event to function slotCompute()
connect(tool_->compute_pb, SIGNAL( clicked() ), this, SLOT( slotCompute() ) );
emit addToolbox(tr("CatMullClark Subdivider"),tool_);
}
//-----------------------------------------------------------------------------
void CatmullClarkPlugin::pluginsInitialized()
{
// emit addPickMode("Separator");
}
//-----------------------------------------------------------------------------
void CatmullClarkPlugin::slotCompute()
{
// iterate over all target poly meshes
for ( PluginFunctions::ObjectIterator
o_it(PluginFunctions::TARGET_OBJECTS,DATA_POLY_MESH) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
{
// get pointer to mesh
PolyMesh* mesh = dynamic_cast< PolyMeshObject* >( *o_it )->mesh();
if ( mesh )
{
OpenMesh::Subdivider::Uniform::CatmullClarkT<PolyMesh> CC;
CC.attach(*mesh);
CC(tool_->iters_spinBox->value());
CC.detach();
emit updatedObject( o_it->id() );
// get feature line object and call compute function
// get_catmullclark_object( *o_it )->compute();
}
}
}
//-----------------------------------------------------------------------------
Q_EXPORT_PLUGIN2( catmullclarkplugin , CatmullClarkPlugin );
//=============================================================================
//
// CLASS CatmullClarkPlugin
//
//=============================================================================
#ifndef CATMULLCLARKPLUGIN_HH
#define CATMULLCLARKPLUGIN_HH
//== INCLUDES =================================================================
#include <QObject>
#include <QMenuBar>
#include <QSpinBox>
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
#include <OpenFlipper/BasePlugin/KeyInterface.hh>
#include <OpenFlipper/BasePlugin/MouseInterface.hh>
#include <OpenFlipper/BasePlugin/PickingInterface.hh>
#include <OpenFlipper/BasePlugin/ScriptInterface.hh>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include "CatmullClarkToolbar.hh"
//#include "CatmullClarkPerObjectDataT.hh"
#include "OpenMesh/Tools/Subdivider/Uniform/CatmullClarkT.hh"
//== CLASS DEFINITION =========================================================
class CatmullClarkPlugin : public QObject, BaseInterface, ToolboxInterface, KeyInterface, ScriptInterface, MouseInterface, PickingInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(ToolboxInterface)
Q_INTERFACES(KeyInterface)
Q_INTERFACES(ScriptInterface)
Q_INTERFACES(MouseInterface)
Q_INTERFACES(PickingInterface)
// typedef for easy access
//typedef ACG::CatmullClarkT<TriMesh> CatmullClark;
//typedef CatmullClarkPerObjectDataT<TriMesh> POD;
signals:
void updateView();
void updatedObject(int);
// ToolboxInterface
void addToolbox( QString _name , QWidget* _widget );
private slots:
// initialization functions
void initializePlugin();
void pluginsInitialized();
// compute
void slotCompute();
public :
~CatmullClarkPlugin() {};
QString name() { return (QString("CatmullClark")); };
QString description( ) { return (QString("Computes the CatmullClark of the the active Mesh")); };
private :
// return name of per object data
//const char * pod_name() { return "CATMULLCLARK_PER_OBJECT_DATA";}
// get CatmullClark object for a given object
//CatmullClark* get_catmullclark_object( BaseObjectData* _object );
private :
/// Widget for Toolbox
CatmullClarkToolbar* tool_;
};
//=============================================================================
#endif // CATMULLCLARKPLUGIN_HH defined
//=============================================================================
#include "ui_CatmullClarkToolbarBase.hh"
#include <QtGui>
class CatmullClarkToolbar : public QWidget, public Ui::CatmullClarkToolbarBase
{
Q_OBJECT
public:
CatmullClarkToolbar(QWidget * parent = 0)
: QWidget(parent)
{
setupUi(this);
}
};
<ui version="4.0" >
<class>CatmullClarkToolbarBase</class>
<widget class="QWidget" name="CatmullClarkToolbarBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>436</width>
<height>959</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Iterations:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="iters_spinBox" >
<property name="maximum" >
<number>999</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="compute_pb" >
<property name="text" >
<string>Compute</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>903</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Plugin()
#qwt()
#gmm()
#lapack()
#physim2()
#cgal()
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################
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