From dfc04ac2e9e36d0e933be613d4a3e6c02a1a459b Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Mon, 18 Feb 2008 18:18:55 +0000 Subject: [PATCH] *** empty log message *** --- src/fgt/edit_quality/filter_quality.pro | 40 ----- .../filter_quality/filterqualitymapper.cpp | 5 +- src/fgt/edit_quality/filterqualitymapper.cpp | 154 ------------------ src/fgt/edit_quality/filterqualitymapper.h | 63 ------- 4 files changed, 4 insertions(+), 258 deletions(-) delete mode 100644 src/fgt/edit_quality/filter_quality.pro delete mode 100644 src/fgt/edit_quality/filterqualitymapper.cpp delete mode 100644 src/fgt/edit_quality/filterqualitymapper.h diff --git a/src/fgt/edit_quality/filter_quality.pro b/src/fgt/edit_quality/filter_quality.pro deleted file mode 100644 index 3f4212d48..000000000 --- a/src/fgt/edit_quality/filter_quality.pro +++ /dev/null @@ -1,40 +0,0 @@ -TEMPLATE = lib -CONFIG += plugin -CONFIG += stl -INCLUDEPATH += ../.. ../../../../sf ../../../../code/lib/glew/include -HEADERS = const_types.h \ - histogram.h \ - qualitymapper.h \ - qualitymapperdialog.h \ - transferfunction.h \ - util.h \ - handle.h \ - eqhandle.h \ - tfhandle.h - -SOURCES = qualitymapper.cpp\ - transferfunction.cpp\ - qualitymapperdialog.cpp\ - util.cpp handle.cpp\ - eqhandle.cpp \ - tfhandle.cpp - -TARGET = edit_quality -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 - -RESOURCES = qualitymapper.qrc - -FORMS = qualitymapperdialog.ui -CONFIG += debug_and_release - -contains(TEMPLATE,lib) { - CONFIG(debug, debug|release) { - unix:TARGET = $$member(TARGET, 0)_debug - else:TARGET = $$member(TARGET, 0)d - } -} -QT += opengl diff --git a/src/fgt/edit_quality/filter_quality/filterqualitymapper.cpp b/src/fgt/edit_quality/filter_quality/filterqualitymapper.cpp index dddae27a3..ee8b30291 100644 --- a/src/fgt/edit_quality/filter_quality/filterqualitymapper.cpp +++ b/src/fgt/edit_quality/filter_quality/filterqualitymapper.cpp @@ -23,6 +23,9 @@ /**************************************************************************** History $Log$ +Revision 1.2 2008/02/18 18:18:54 amaione +*** empty log message *** + Revision 1.1 2008/02/18 18:05:20 amaione UPDATED PERSONAL PROJECTS FILES AND @@ -110,7 +113,7 @@ void QualityMapperFilter::initParameterSet(QAction *action,MeshModel &m, FilterP { switch(ID(action)) { case FP_MOVE_VERTEX : - parlst.addString("nome", "valore di default", "descrizione", "tooltip"); +// parlst.addString("nome", "valore di default", "descrizione", "tooltip"); // parlst.addBool ("UpdateNormals", // true, // "Recompute normals", diff --git a/src/fgt/edit_quality/filterqualitymapper.cpp b/src/fgt/edit_quality/filterqualitymapper.cpp deleted file mode 100644 index dbc3164d4..000000000 --- a/src/fgt/edit_quality/filterqualitymapper.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -* MeshLab o o * -* A versatile mesh processing toolbox o o * -* _ O _ * -* Copyright(C) 2005 \/)\/ * -* Visual Computing Lab /\/| * -* ISTI - Italian National Research Council | * -* \ * -* All rights reserved. * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * -* for more details. * -* * -****************************************************************************/ -/**************************************************************************** - History -$Log$ -Revision 1.1 2008/02/18 17:14:40 amaione -ADDED SKELETON FILES FOR QUALITY MAPPER FILTER - -Revision 1.3 2006/11/29 00:59:20 cignoni -Cleaned plugins interface; changed useless help class into a plain string - -Revision 1.2 2006/11/27 06:57:21 cignoni -Wrong way of using the __DATE__ preprocessor symbol - -Revision 1.1 2006/09/25 09:24:39 e_cerisoli -add samplefilter - -****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "samplefilter.h" - -// Constructor usually performs only two simple tasks of filling the two lists -// - typeList: with all the possible id of the filtering actions -// - actionList with the corresponding actions. If you want to add icons to your filtering actions you can do here by construction the QActions accordingly - -ExtraSamplePlugin::ExtraSamplePlugin() -{ - typeList << FP_MOVE_VERTEX; - - foreach(FilterIDType tt , types()) - actionList << new QAction(filterName(tt), this); -} - -// ST() must return the very short string describing each filtering action -// (this string is used also to define the menu entry) -const QString ExtraSamplePlugin::filterName(FilterIDType filterId) -{ - switch(filterId) { - case FP_MOVE_VERTEX : return QString("Random Vertex Displacement"); - default : assert(0); - } -} - -// Info() must return the longer string describing each filtering action -// (this string is used in the About plugin dialog) -const QString ExtraSamplePlugin::filterInfo(FilterIDType filterId) -{ - switch(filterId) { - case FP_MOVE_VERTEX : return QString("Randomly move each vertex of the mesh of a small amount"); - default : assert(0); - } -} - -const PluginInfo &ExtraSamplePlugin::pluginInfo() -{ - static PluginInfo ai; - ai.Date=tr(__DATE__); - ai.Version = tr("1.0"); - ai.Author = ("Paolo Cignoni"); - return ai; - } - -// This function define the needed parameters for each filter. Return true if the filter has some parameters -// it is called every time, so you can set the default value of parameters according to the mesh -// For each parmeter you need to define, -// - the name of the parameter, -// - the string shown in the dialog -// - the default value -// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void ExtraSamplePlugin::initParameterSet(QAction *action,MeshModel &m, FilterParameterSet & parlst) -//void ExtraSamplePlugin::initParList(QAction *action, MeshModel &m, FilterParameterSet &parlst) -{ - switch(ID(action)) { - case FP_MOVE_VERTEX : - parlst.addBool ("UpdateNormals", - true, - "Recompute normals", - "Toggle the recomputation of the normals after the random displacement.\n\n" - "If disabled the face normals will remains unchanged resulting in a visually pleasant effect."); - parlst.addAbsPerc("Displacement", - m.cm.bbox.Diag()/100.0,0,m.cm.bbox.Diag(), - "Max displacement", - "The vertex are displaced of a vector whose norm is bounded by this value"); - break; - - default : assert(0); - } -} - -// The Real Core Function doing the actual mesh processing. -// Move Vertex of a random quantity -bool ExtraSamplePlugin::applyFilter(QAction *filter, MeshModel &m, FilterParameterSet & par, vcg::CallBackPos *cb) -{ - //MeshModel &m=*md->mm(); - srand(time(NULL)); - const float max_displacement =par.getAbsPerc("Displacement"); - - for(unsigned int i = 0; i< m.cm.vert.size(); i++){ - // Typical usage of the callback for showing a nice progress bar in the bottom. - // First parameter is a 0..100 number indicating percentage of completion, the second is an info string. - cb(100*i/m.cm.vert.size(), "Randomly Displacing..."); - - float rndax = (float(2.0f*rand())/RAND_MAX - 1.0f ) *max_displacement; - float rnday = (float(2.0f*rand())/RAND_MAX - 1.0f ) *max_displacement; - float rndaz = (float(2.0f*rand())/RAND_MAX - 1.0f ) *max_displacement; - m.cm.vert[i].P() += vcg::Point3f(rndax,rnday,rndaz); - } - - // Log function dump textual info in the lower part of the MeshLab screen. - Log(0,"Successfully displaced %i vertices",m.cm.vn); - - // to access to the parameters of the filter dialog simply use the getXXXX function of the FilterParameter Class - if(par.getBool("UpdateNormals")) - vcg::tri::UpdateNormals::PerVertexNormalizedPerFace(m.cm); - - vcg::tri::UpdateBounding::Box(m.cm); - - return true; -} - -Q_EXPORT_PLUGIN(ExtraSamplePlugin) diff --git a/src/fgt/edit_quality/filterqualitymapper.h b/src/fgt/edit_quality/filterqualitymapper.h deleted file mode 100644 index e7e2fae1e..000000000 --- a/src/fgt/edit_quality/filterqualitymapper.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -* MeshLab o o * -* A versatile mesh processing toolbox o o * -* _ O _ * -* Copyright(C) 2005 \/)\/ * -* Visual Computing Lab /\/| * -* ISTI - Italian National Research Council | * -* \ * -* All rights reserved. * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * -* for more details. * -* * -****************************************************************************/ -/**************************************************************************** - History -$Log$ -Revision 1.1 2008/02/18 17:14:41 amaione -ADDED SKELETON FILES FOR QUALITY MAPPER FILTER - -Revision 1.2 2006/11/29 00:59:21 cignoni -Cleaned plugins interface; changed useless help class into a plain string - -Revision 1.1 2006/09/25 09:24:39 e_cerisoli -add sampleplugins - -****************************************************************************/ - -#ifndef SAMPLEFILTERSPLUGIN_H -#define SAMPLEFILTERSPLUGIN_H - -#include - -#include -#include - -class ExtraSamplePlugin : public QObject, public MeshFilterInterface -{ - Q_OBJECT - Q_INTERFACES(MeshFilterInterface) - -public: - enum { FP_MOVE_VERTEX } ; - - ExtraSamplePlugin(); - - virtual const QString filterName(FilterIDType filter); - virtual const QString filterInfo(FilterIDType filter); - virtual const PluginInfo &pluginInfo(); - virtual bool autoDialog(QAction *) {return true;} - virtual void initParameterSet(QAction *,MeshModel &/*m*/, FilterParameterSet & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshModel &m, FilterParameterSet & /*parent*/, vcg::CallBackPos * cb) ; -}; - -#endif \ No newline at end of file