From b51fd79d0bfdcdad6da7a41dcb3cf3d17448eaaf Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Mon, 19 Dec 2005 15:11:50 +0000 Subject: [PATCH] added decimator dialog --- src/meshlabplugins/meshfilter/meshfilter.cpp | 12 ++++++++++-- src/meshlabplugins/meshfilter/meshfilter.h | 3 +++ src/meshlabplugins/meshfilter/meshfilter.pro | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/meshlabplugins/meshfilter/meshfilter.cpp b/src/meshlabplugins/meshfilter/meshfilter.cpp index 2b46474dc..550e8c8f2 100644 --- a/src/meshlabplugins/meshfilter/meshfilter.cpp +++ b/src/meshlabplugins/meshfilter/meshfilter.cpp @@ -23,6 +23,9 @@ /**************************************************************************** History $Log$ +Revision 1.23 2005/12/19 15:11:49 mariolatronico +added decimator dialog + Revision 1.22 2005/12/18 15:01:05 mariolatronico - added slot for threshold refine and "refine only selected vertices" @@ -90,6 +93,8 @@ ExtraMeshFilterPlugin::ExtraMeshFilterPlugin() { //////////// refineDialog = new RefineDialog(); refineDialog->hide(); + decimatorDialog = new DecimatorDialog(); + decimatorDialog->hide(); } ExtraMeshFilterPlugin::~ExtraMeshFilterPlugin() { @@ -197,7 +202,6 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, QWidget * return false; // don't continue, user pressed Cancel double threshold = refineDialog->getThreshold(); bool selected = refineDialog->isSelected(); - vcg::Refine >(m.cm,vcg::MidPointButterfly(),threshold, selected, cb); vcg::tri::UpdateNormals::PerVertexNormalizedPerFace(m.cm); } @@ -227,8 +231,12 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, QWidget * if(filter->text() == tr("Decimator")) { + int continueValue = decimatorDialog->exec(); + if (continueValue == QDialog::Rejected) + return false; // don't continue, user pressed Cancel + int step = decimatorDialog->getStep(); vcg::tri::UpdateTopology::FaceFace(m.cm); - Decimator(m.cm,10); + Decimator(m.cm,step); } return true; diff --git a/src/meshlabplugins/meshfilter/meshfilter.h b/src/meshlabplugins/meshfilter/meshfilter.h index 9beae71dc..2a6a28abb 100644 --- a/src/meshlabplugins/meshfilter/meshfilter.h +++ b/src/meshlabplugins/meshfilter/meshfilter.h @@ -29,6 +29,8 @@ #include #include #include "refinedialog.h" +#include "decimatordialog.h" + class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface { @@ -47,6 +49,7 @@ class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface protected: QList actionList; RefineDialog *refineDialog; + DecimatorDialog *decimatorDialog; }; #endif diff --git a/src/meshlabplugins/meshfilter/meshfilter.pro b/src/meshlabplugins/meshfilter/meshfilter.pro index f3cfb560a..79df4cf0c 100644 --- a/src/meshlabplugins/meshfilter/meshfilter.pro +++ b/src/meshlabplugins/meshfilter/meshfilter.pro @@ -1,14 +1,14 @@ TEMPLATE = lib CONFIG += plugin INCLUDEPATH += ../.. ../../../../sf ../../../../code/lib/glew/include -HEADERS = meshfilter.h refine_loop.h refinedialog.h +HEADERS = meshfilter.h refine_loop.h refinedialog.h decimatordialog.h SOURCES = meshfilter.cpp TARGET = meshfilter DESTDIR = ../../meshlab/plugins # the following line is needed to avoid mismatch between # the awful min/max macros of windows and the limits max win32:DEFINES += NOMINMAX -FORMS = refine.ui +FORMS = refine.ui decimator.ui unix{ QMAKE_CC = gcc-3.3 QMAKE_CXX = g++-3.3