mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-18 02:24:38 +00:00
added decimator dialog
This commit is contained in:
parent
45bdebc868
commit
b51fd79d0b
@ -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<CMeshO,MidPointButterfly<CMeshO> >(m.cm,vcg::MidPointButterfly<CMeshO>(),threshold, selected, cb);
|
||||
vcg::tri::UpdateNormals<CMeshO>::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<CMeshO>::FaceFace(m.cm);
|
||||
Decimator<CMeshO>(m.cm,10);
|
||||
Decimator<CMeshO>(m.cm,step);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
#include <meshlab/meshmodel.h>
|
||||
#include <meshlab/interfaces.h>
|
||||
#include "refinedialog.h"
|
||||
#include "decimatordialog.h"
|
||||
|
||||
|
||||
class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface
|
||||
{
|
||||
@ -47,6 +49,7 @@ class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface
|
||||
protected:
|
||||
QList <QAction *> actionList;
|
||||
RefineDialog *refineDialog;
|
||||
DecimatorDialog *decimatorDialog;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user