*** empty log message ***

This commit is contained in:
Paolo Cignoni cignoni 2008-02-18 18:18:55 +00:00
parent 45bc748e03
commit dfc04ac2e9
4 changed files with 4 additions and 258 deletions

View File

@ -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

View File

@ -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",

View File

@ -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 <QtGui>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <meshlab/meshmodel.h>
#include <meshlab/interfaces.h>
#include <vcg/complex/trimesh/clean.h>
#include <vcg/complex/trimesh/update/normal.h>
#include <vcg/complex/trimesh/update/bounding.h>
#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<CMeshO>::PerVertexNormalizedPerFace(m.cm);
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm);
return true;
}
Q_EXPORT_PLUGIN(ExtraSamplePlugin)

View File

@ -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 <QObject>
#include <meshlab/meshmodel.h>
#include <meshlab/interfaces.h>
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