mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-14 08:34:37 +00:00
filter_plugin_interface.h
This commit is contained in:
parent
7ca8d10a77
commit
233b3e9f54
@ -15,6 +15,7 @@ set(SOURCES
|
||||
filter_parameter/rich_parameter_list.cpp
|
||||
filter_parameter/value.cpp
|
||||
interfaces/plugin_interface.cpp
|
||||
interfaces/filter_plugin_interface.cpp
|
||||
GLExtensionsManager.cpp
|
||||
GLLogStream.cpp
|
||||
filterscript.cpp
|
||||
@ -35,6 +36,7 @@ set(HEADERS
|
||||
filter_parameter/value.h
|
||||
interfaces/mainwindow_interface.h
|
||||
interfaces/plugin_interface.h
|
||||
interfaces/filter_plugin_interface.h
|
||||
interfaces/io_plugin_interface.h
|
||||
GLExtensionsManager.h
|
||||
GLLogStream.h
|
||||
|
||||
@ -48,6 +48,7 @@ HEADERS += \
|
||||
filterscript.h \
|
||||
GLLogStream.h \
|
||||
interfaces.h \
|
||||
interfaces/filter_plugin_interface.h \
|
||||
interfaces/io_plugin_interface.h \
|
||||
interfaces/mainwindow_interface.h \
|
||||
interfaces/plugin_interface.h \
|
||||
@ -69,6 +70,7 @@ SOURCES += \
|
||||
interfaces.cpp \
|
||||
filterscript.cpp \
|
||||
GLLogStream.cpp \
|
||||
interfaces/filter_plugin_interface.cpp \
|
||||
interfaces/plugin_interface.cpp \
|
||||
meshmodel.cpp \
|
||||
pluginmanager.cpp \
|
||||
|
||||
@ -1,71 +1,3 @@
|
||||
#include "interfaces.h"
|
||||
|
||||
bool MeshFilterInterface::isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const
|
||||
{
|
||||
int preMask = getPreConditions(act);
|
||||
MissingItems.clear();
|
||||
|
||||
if (preMask == MeshModel::MM_NONE) // no precondition specified.
|
||||
return true;
|
||||
|
||||
if (preMask & MeshModel::MM_VERTCOLOR && !m.hasDataMask(MeshModel::MM_VERTCOLOR))
|
||||
MissingItems.push_back("Vertex Color");
|
||||
|
||||
if (preMask & MeshModel::MM_FACECOLOR && !m.hasDataMask(MeshModel::MM_FACECOLOR))
|
||||
MissingItems.push_back("Face Color");
|
||||
|
||||
if (preMask & MeshModel::MM_VERTQUALITY && !m.hasDataMask(MeshModel::MM_VERTQUALITY))
|
||||
MissingItems.push_back("Vertex Quality");
|
||||
|
||||
if (preMask & MeshModel::MM_FACEQUALITY && !m.hasDataMask(MeshModel::MM_FACEQUALITY))
|
||||
MissingItems.push_back("Face Quality");
|
||||
|
||||
if (preMask & MeshModel::MM_WEDGTEXCOORD && !m.hasDataMask(MeshModel::MM_WEDGTEXCOORD))
|
||||
MissingItems.push_back("Per Wedge Texture Coords");
|
||||
|
||||
if (preMask & MeshModel::MM_VERTTEXCOORD && !m.hasDataMask(MeshModel::MM_VERTTEXCOORD))
|
||||
MissingItems.push_back("Per Vertex Texture Coords");
|
||||
|
||||
if (preMask & MeshModel::MM_VERTRADIUS && !m.hasDataMask(MeshModel::MM_VERTRADIUS))
|
||||
MissingItems.push_back("Vertex Radius");
|
||||
|
||||
if (preMask & MeshModel::MM_CAMERA && !m.hasDataMask(MeshModel::MM_CAMERA))
|
||||
MissingItems.push_back("Camera");
|
||||
|
||||
if (preMask & MeshModel::MM_FACENUMBER && (m.cm.fn==0))
|
||||
MissingItems.push_back("Any Faces");
|
||||
|
||||
|
||||
return MissingItems.isEmpty();
|
||||
}
|
||||
|
||||
int MeshFilterInterface::previewOnCreatedAttributes(const QAction* act, const MeshModel& mm ) const
|
||||
{
|
||||
int changedIfCalled = postCondition(act);
|
||||
int createdIfCalled = MeshModel::MM_NONE;
|
||||
if ((changedIfCalled & MeshModel::MM_VERTCOLOR) && !mm.hasDataMask(MeshModel::MM_VERTCOLOR))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOLOR;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_FACECOLOR) && !mm.hasDataMask(MeshModel::MM_FACECOLOR))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_FACECOLOR;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_VERTQUALITY) && !mm.hasDataMask(MeshModel::MM_VERTQUALITY))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTQUALITY;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_FACEQUALITY) && !mm.hasDataMask(MeshModel::MM_FACEQUALITY))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_FACEQUALITY;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_WEDGTEXCOORD) && !mm.hasDataMask(MeshModel::MM_WEDGTEXCOORD))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_WEDGTEXCOORD;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_VERTTEXCOORD) && !mm.hasDataMask(MeshModel::MM_VERTTEXCOORD))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTTEXCOORD;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_VERTRADIUS) && !mm.hasDataMask(MeshModel::MM_VERTRADIUS))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTRADIUS;
|
||||
|
||||
if ((getClass(act) == MeshFilterInterface::MeshCreation) && (mm.cm.vn == 0))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOORD;
|
||||
|
||||
return createdIfCalled;
|
||||
}
|
||||
|
||||
@ -52,211 +52,6 @@ class GLAreaReg;
|
||||
|
||||
class MeshModel;
|
||||
|
||||
|
||||
/**
|
||||
\brief The MeshFilterInterface class provide the interface of the filter plugins.
|
||||
|
||||
*/
|
||||
class MeshFilterInterface : public PluginInterface
|
||||
{
|
||||
public:
|
||||
/** The FilterClass enum represents the set of keywords that must be used to categorize a filter.
|
||||
Each filter can belong to one or more filtering class, or-ed together.
|
||||
*/
|
||||
enum FilterClass
|
||||
{
|
||||
Generic = 0x00000, /*!< Should be avoided if possible. */ //
|
||||
Selection = 0x00001, /*!< select or de-select something, basic operation on selections (like deleting)*/
|
||||
Cleaning = 0x00002, /*!< Filters that can be used to clean meshes (duplicated vertices etc)*/
|
||||
Remeshing = 0x00004, /*!< Simplification, Refinement, Reconstruction and mesh optimization*/
|
||||
FaceColoring = 0x00008,
|
||||
VertexColoring = 0x00010,
|
||||
MeshColoring = 0x00020,
|
||||
MeshCreation = 0x00040,
|
||||
Smoothing = 0x00080, /*!< Stuff that does not change the topology, but just the vertex positions*/
|
||||
Quality = 0x00100,
|
||||
Layer = 0x00200, /*!< Layers, attributes */
|
||||
RasterLayer = 0x00400, /*!< Raster Layers, attributes */
|
||||
Normal = 0x00800, /*!< Normal, Curvature, orientation (rotations and transformations fall here)*/
|
||||
Sampling = 0x01000,
|
||||
Texture = 0x02000,
|
||||
RangeMap = 0x04000, /*!< filters specific for range map processing*/
|
||||
PointSet = 0x08000,
|
||||
Measure = 0x10000, /*!< Filters that compute measures and information on meshes.*/
|
||||
Polygonal = 0x20000, /*!< Filters that works on polygonal and quad meshes.*/
|
||||
Camera = 0x40000 /*!< Filters that works on shot of mesh and raster.*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
MeshFilterInterface() : PluginInterface(), glContext(NULL)
|
||||
{
|
||||
}
|
||||
virtual ~MeshFilterInterface() {}
|
||||
|
||||
|
||||
/** The very short string (a few words) describing each filtering action
|
||||
// This string is used also to define the menu entry
|
||||
*/
|
||||
virtual QString filterName(FilterIDType) const = 0;
|
||||
|
||||
/** The long, formatted string describing each filtering action.
|
||||
// This string is printed in the top of the parameter window
|
||||
// so it should be at least one or two paragraphs long. The more the better.
|
||||
// you can use simple html formatting tags (like "<br>" "<b>" and "<i>") to improve readability.
|
||||
// This string is used in the 'About plugin' dialog and by meshlabserver to create the filter list wiki page and the doxygen documentation of the filters.
|
||||
// Here is the place where you should put you bibliographic references in a form like this:
|
||||
<br>
|
||||
See: <br />
|
||||
<i>Luiz Velho, Denis Zorin </i><br/>
|
||||
<b>"4-8 Subdivision"</b><br/>
|
||||
CAGD, volume 18, Issue 5, Pages 397-427.<br/>
|
||||
<br>
|
||||
e.g. italic for authors, bold for title (quoted) and plain for bib ref.
|
||||
*/
|
||||
virtual QString filterInfo(FilterIDType filter) const = 0;
|
||||
|
||||
/** The FilterClass describes in which generic class of filters it fits.
|
||||
// This choice affect the submenu in which each filter will be placed
|
||||
// For example filters that perform an action only on the selection will be placed in the Selection Class
|
||||
*/
|
||||
virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::Generic; }
|
||||
|
||||
/**
|
||||
The filters can have some additional requirements on the mesh capabiliteis.
|
||||
// For example if a filters requires Face-Face Adjacency you should re-implement
|
||||
// this function making it returns MeshModel::MM_FACEFACETOPO.
|
||||
// The framework will ensure that the mesh has the requirements satisfied before invoking the applyFilter function
|
||||
//
|
||||
// Furthermore, requirements are checked just before the invocation of a filter. If your filter
|
||||
// outputs a never used before mesh property (e.g. face colors), it will be allocated by a call
|
||||
// to MeshModel::updateDataMask(...)
|
||||
*/
|
||||
virtual int getRequirements(const QAction *) { return MeshModel::MM_NONE; }
|
||||
|
||||
/** The FilterPrecondition mask is used to explicitate what kind of data a filter really needs to be applied.
|
||||
// For example algorithms that compute per face quality have as precondition the existence of faces
|
||||
// (but quality per face is not a precondition, because quality per face is created by these algorithms)
|
||||
// on the other hand an algorithm that deletes faces according to the stored quality has both FaceQuality
|
||||
// and Face as precondition.
|
||||
// These conditions do NOT include computed properties like borderFlags, manifoldness or watertightness.
|
||||
// They are also used to grayout menus un-appliable entries.
|
||||
*/
|
||||
virtual int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; }
|
||||
|
||||
/** Function used by the framework to get info about the mesh properties changed by the filter.
|
||||
// It is widely used by the meshlab's preview system.
|
||||
//TO BE REPLACED WITH = 0
|
||||
*/
|
||||
virtual int postCondition(const QAction*) const { return MeshModel::MM_ALL; }
|
||||
|
||||
/** \brief applies the selected filter with the already stabilished parameters
|
||||
* This function is called by the framework after getting values for the parameters specified in the \ref InitParameterSet
|
||||
* NO GUI interaction should be done here. No dialog asking, no messagebox errors.
|
||||
* Think that his function will also be called by the commandline framework.
|
||||
* If you want report errors, use the \ref errorMsg() string. It will displayed in case of filters returning false.
|
||||
* When implementing your applyFilter, you should use the cb function to report to the framework the current state of the processing.
|
||||
* During your (long) processing you should call from time to time cb(perc,descriptiveString), where perc is an int (0..100)
|
||||
* saying what you are doing and at what point of the computation you currently are.
|
||||
* \sa errorMsg
|
||||
* \sa initParameterSet
|
||||
*/
|
||||
virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0;
|
||||
|
||||
/** \brief tests if a filter is applicable to a mesh.
|
||||
This function is a handy wrapper used by the framework for the \a getPreConditions callback;
|
||||
For instance a colorize by quality filter cannot be applied to a mesh without per-vertex-quality.
|
||||
On failure (returning false) the function fills the MissingItems list with strings describing the missing items.
|
||||
*/
|
||||
bool isFilterApplicable(const QAction *act, const MeshModel& m, QStringList &MissingItems) const;
|
||||
|
||||
|
||||
enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 };
|
||||
|
||||
/** \brief this function informs the MeshLab core on how many meshes the filter will work on.
|
||||
Valid value:
|
||||
- SINGLE_MESH: the filter works just on the current mesh
|
||||
- FIXED: the number (and the names) of the meshes involved in the filter computation is determined by the parameters selected in the filter's parameters form
|
||||
- VARIABLE: the filter works on a not predetermined number of meshes. The meshes involved are typically selected by the user checking on the correspondent layer on the layer dialog
|
||||
*/
|
||||
virtual FILTER_ARITY filterArity(const QAction *act) const = 0;
|
||||
|
||||
// This function is called to initialized the list of parameters.
|
||||
// it is always called. If a filter does not need parameter it leave it empty and the framework
|
||||
// will not create a dialog (unless for previewing)
|
||||
virtual void initParameterList(const QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {}
|
||||
virtual void initParameterList(const QAction *filter, MeshDocument &md, RichParameterList &par)
|
||||
{
|
||||
initParameterList(filter, *(md.mm()), par);
|
||||
}
|
||||
|
||||
/** \brief is invoked by the framework when the applyFilter fails to give some info to the user about the filter failure
|
||||
* Filters \b must never use QMessageBox for reporting errors.
|
||||
* Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter
|
||||
*/
|
||||
const QString &errorMsg() const { return this->errorMessage; }
|
||||
virtual QString filterInfo(const QAction *a) const { return this->filterInfo(ID(a)); }
|
||||
virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); }
|
||||
virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; }
|
||||
|
||||
virtual FilterIDType ID(const QAction *a) const
|
||||
{
|
||||
QString aa=a->text();
|
||||
foreach(FilterIDType tt, types())
|
||||
if (a->text() == this->filterName(tt)) return tt;
|
||||
aa.replace("&","");
|
||||
foreach(FilterIDType tt, types())
|
||||
if (aa == this->filterName(tt)) return tt;
|
||||
|
||||
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text()));
|
||||
assert(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
virtual QAction *AC(FilterIDType filterID)
|
||||
{
|
||||
QString idName = this->filterName(filterID);
|
||||
return AC(idName);
|
||||
}
|
||||
|
||||
virtual QAction *AC(const QString& idName)
|
||||
{
|
||||
QString i=idName;
|
||||
for(QAction *tt : actionList)
|
||||
if (idName == tt->text()) return tt;
|
||||
i.replace("&","");
|
||||
for(QAction *tt : actionList)
|
||||
if (i == tt->text()) return tt;
|
||||
|
||||
qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName));
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual QList<QAction *> actions() const { return actionList; }
|
||||
virtual QList<FilterIDType> types() const { return typeList; }
|
||||
|
||||
/** Generate the mask of attributes would be created IF the MeshFilterInterface filt would has been called on MeshModel mm
|
||||
BE CAREFUL! this function does NOT change in anyway the state of the MeshModel!!!! **/
|
||||
int previewOnCreatedAttributes(const QAction* act, const MeshModel& mm) const;
|
||||
QString generatedScriptCode;
|
||||
|
||||
MLPluginGLContext* glContext;
|
||||
protected:
|
||||
// Each plugins exposes a set of filtering possibilities.
|
||||
// Each filtering procedure corresponds to a single QAction with a corresponding FilterIDType id.
|
||||
//
|
||||
|
||||
// The list of actions exported by the plugin. Each actions strictly corresponds to
|
||||
QList <QAction *> actionList;
|
||||
|
||||
QList <FilterIDType> typeList;
|
||||
|
||||
// this string is used to pass back to the framework error messages in case of failure of a filter apply.
|
||||
QString errorMessage;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Used to customized the rendering process.
|
||||
Rendering plugins are now responsible of the rendering of the whole MeshDocument and not only of a single MeshModel.
|
||||
@ -490,14 +285,11 @@ public:
|
||||
#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x)
|
||||
#define MESHLAB_PLUGIN_NAME_EXPORTER(x)
|
||||
|
||||
#define MESH_FILTER_INTERFACE_IID "vcg.meshlab.MeshFilterInterface/1.0"
|
||||
#define MESHLAB_FILTER_INTERFACE_IID "vcg.meshlab.MeshLabFilterInterface/1.0"
|
||||
#define MESH_RENDER_INTERFACE_IID "vcg.meshlab.MeshRenderInterface/1.0"
|
||||
#define MESH_DECORATE_INTERFACE_IID "vcg.meshlab.MeshDecorateInterface/1.0"
|
||||
#define MESH_EDIT_INTERFACE_IID "vcg.meshlab.MeshEditInterface/1.0"
|
||||
#define MESH_EDIT_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0"
|
||||
|
||||
Q_DECLARE_INTERFACE(MeshFilterInterface, MESH_FILTER_INTERFACE_IID)
|
||||
Q_DECLARE_INTERFACE(MeshRenderInterface, MESH_RENDER_INTERFACE_IID)
|
||||
Q_DECLARE_INTERFACE(MeshDecorateInterface, MESH_DECORATE_INTERFACE_IID)
|
||||
Q_DECLARE_INTERFACE(MeshEditInterface, MESH_EDIT_INTERFACE_IID)
|
||||
|
||||
71
src/common/interfaces/filter_plugin_interface.cpp
Normal file
71
src/common/interfaces/filter_plugin_interface.cpp
Normal file
@ -0,0 +1,71 @@
|
||||
#include "filter_plugin_interface.h"
|
||||
|
||||
bool FilterPluginInterface::isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const
|
||||
{
|
||||
int preMask = getPreConditions(act);
|
||||
MissingItems.clear();
|
||||
|
||||
if (preMask == MeshModel::MM_NONE) // no precondition specified.
|
||||
return true;
|
||||
|
||||
if (preMask & MeshModel::MM_VERTCOLOR && !m.hasDataMask(MeshModel::MM_VERTCOLOR))
|
||||
MissingItems.push_back("Vertex Color");
|
||||
|
||||
if (preMask & MeshModel::MM_FACECOLOR && !m.hasDataMask(MeshModel::MM_FACECOLOR))
|
||||
MissingItems.push_back("Face Color");
|
||||
|
||||
if (preMask & MeshModel::MM_VERTQUALITY && !m.hasDataMask(MeshModel::MM_VERTQUALITY))
|
||||
MissingItems.push_back("Vertex Quality");
|
||||
|
||||
if (preMask & MeshModel::MM_FACEQUALITY && !m.hasDataMask(MeshModel::MM_FACEQUALITY))
|
||||
MissingItems.push_back("Face Quality");
|
||||
|
||||
if (preMask & MeshModel::MM_WEDGTEXCOORD && !m.hasDataMask(MeshModel::MM_WEDGTEXCOORD))
|
||||
MissingItems.push_back("Per Wedge Texture Coords");
|
||||
|
||||
if (preMask & MeshModel::MM_VERTTEXCOORD && !m.hasDataMask(MeshModel::MM_VERTTEXCOORD))
|
||||
MissingItems.push_back("Per Vertex Texture Coords");
|
||||
|
||||
if (preMask & MeshModel::MM_VERTRADIUS && !m.hasDataMask(MeshModel::MM_VERTRADIUS))
|
||||
MissingItems.push_back("Vertex Radius");
|
||||
|
||||
if (preMask & MeshModel::MM_CAMERA && !m.hasDataMask(MeshModel::MM_CAMERA))
|
||||
MissingItems.push_back("Camera");
|
||||
|
||||
if (preMask & MeshModel::MM_FACENUMBER && (m.cm.fn==0))
|
||||
MissingItems.push_back("Any Faces");
|
||||
|
||||
|
||||
return MissingItems.isEmpty();
|
||||
}
|
||||
|
||||
int FilterPluginInterface::previewOnCreatedAttributes(const QAction* act, const MeshModel& mm ) const
|
||||
{
|
||||
int changedIfCalled = postCondition(act);
|
||||
int createdIfCalled = MeshModel::MM_NONE;
|
||||
if ((changedIfCalled & MeshModel::MM_VERTCOLOR) && !mm.hasDataMask(MeshModel::MM_VERTCOLOR))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOLOR;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_FACECOLOR) && !mm.hasDataMask(MeshModel::MM_FACECOLOR))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_FACECOLOR;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_VERTQUALITY) && !mm.hasDataMask(MeshModel::MM_VERTQUALITY))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTQUALITY;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_FACEQUALITY) && !mm.hasDataMask(MeshModel::MM_FACEQUALITY))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_FACEQUALITY;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_WEDGTEXCOORD) && !mm.hasDataMask(MeshModel::MM_WEDGTEXCOORD))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_WEDGTEXCOORD;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_VERTTEXCOORD) && !mm.hasDataMask(MeshModel::MM_VERTTEXCOORD))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTTEXCOORD;
|
||||
|
||||
if ((changedIfCalled & MeshModel::MM_VERTRADIUS) && !mm.hasDataMask(MeshModel::MM_VERTRADIUS))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTRADIUS;
|
||||
|
||||
if ((getClass(act) == FilterPluginInterface::MeshCreation) && (mm.cm.vn == 0))
|
||||
createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOORD;
|
||||
|
||||
return createdIfCalled;
|
||||
}
|
||||
239
src/common/interfaces/filter_plugin_interface.h
Normal file
239
src/common/interfaces/filter_plugin_interface.h
Normal file
@ -0,0 +1,239 @@
|
||||
/****************************************************************************
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005-2020 \/)\/ *
|
||||
* 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. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef MESHLAB_FILTER_PLUGIN_INTERFACE_H
|
||||
#define MESHLAB_FILTER_PLUGIN_INTERFACE_H
|
||||
|
||||
#include "plugin_interface.h"
|
||||
#include "../meshmodel.h"
|
||||
|
||||
/**
|
||||
\brief The MeshFilterInterface class provide the interface of the filter plugins.
|
||||
|
||||
*/
|
||||
class FilterPluginInterface : public PluginInterface
|
||||
{
|
||||
public:
|
||||
/** The FilterClass enum represents the set of keywords that must be used to categorize a filter.
|
||||
Each filter can belong to one or more filtering class, or-ed together.
|
||||
*/
|
||||
enum FilterClass
|
||||
{
|
||||
Generic = 0x00000, /*!< Should be avoided if possible. */ //
|
||||
Selection = 0x00001, /*!< select or de-select something, basic operation on selections (like deleting)*/
|
||||
Cleaning = 0x00002, /*!< Filters that can be used to clean meshes (duplicated vertices etc)*/
|
||||
Remeshing = 0x00004, /*!< Simplification, Refinement, Reconstruction and mesh optimization*/
|
||||
FaceColoring = 0x00008,
|
||||
VertexColoring = 0x00010,
|
||||
MeshColoring = 0x00020,
|
||||
MeshCreation = 0x00040,
|
||||
Smoothing = 0x00080, /*!< Stuff that does not change the topology, but just the vertex positions*/
|
||||
Quality = 0x00100,
|
||||
Layer = 0x00200, /*!< Layers, attributes */
|
||||
RasterLayer = 0x00400, /*!< Raster Layers, attributes */
|
||||
Normal = 0x00800, /*!< Normal, Curvature, orientation (rotations and transformations fall here)*/
|
||||
Sampling = 0x01000,
|
||||
Texture = 0x02000,
|
||||
RangeMap = 0x04000, /*!< filters specific for range map processing*/
|
||||
PointSet = 0x08000,
|
||||
Measure = 0x10000, /*!< Filters that compute measures and information on meshes.*/
|
||||
Polygonal = 0x20000, /*!< Filters that works on polygonal and quad meshes.*/
|
||||
Camera = 0x40000 /*!< Filters that works on shot of mesh and raster.*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
FilterPluginInterface() : PluginInterface(), glContext(NULL)
|
||||
{
|
||||
}
|
||||
virtual ~FilterPluginInterface() {}
|
||||
|
||||
|
||||
/** The very short string (a few words) describing each filtering action
|
||||
// This string is used also to define the menu entry
|
||||
*/
|
||||
virtual QString filterName(FilterIDType) const = 0;
|
||||
|
||||
/** The long, formatted string describing each filtering action.
|
||||
// This string is printed in the top of the parameter window
|
||||
// so it should be at least one or two paragraphs long. The more the better.
|
||||
// you can use simple html formatting tags (like "<br>" "<b>" and "<i>") to improve readability.
|
||||
// This string is used in the 'About plugin' dialog and by meshlabserver to create the filter list wiki page and the doxygen documentation of the filters.
|
||||
// Here is the place where you should put you bibliographic references in a form like this:
|
||||
<br>
|
||||
See: <br />
|
||||
<i>Luiz Velho, Denis Zorin </i><br/>
|
||||
<b>"4-8 Subdivision"</b><br/>
|
||||
CAGD, volume 18, Issue 5, Pages 397-427.<br/>
|
||||
<br>
|
||||
e.g. italic for authors, bold for title (quoted) and plain for bib ref.
|
||||
*/
|
||||
virtual QString filterInfo(FilterIDType filter) const = 0;
|
||||
|
||||
/** The FilterClass describes in which generic class of filters it fits.
|
||||
// This choice affect the submenu in which each filter will be placed
|
||||
// For example filters that perform an action only on the selection will be placed in the Selection Class
|
||||
*/
|
||||
virtual FilterClass getClass(const QAction *) const { return FilterPluginInterface::Generic; }
|
||||
|
||||
/**
|
||||
The filters can have some additional requirements on the mesh capabiliteis.
|
||||
// For example if a filters requires Face-Face Adjacency you should re-implement
|
||||
// this function making it returns MeshModel::MM_FACEFACETOPO.
|
||||
// The framework will ensure that the mesh has the requirements satisfied before invoking the applyFilter function
|
||||
//
|
||||
// Furthermore, requirements are checked just before the invocation of a filter. If your filter
|
||||
// outputs a never used before mesh property (e.g. face colors), it will be allocated by a call
|
||||
// to MeshModel::updateDataMask(...)
|
||||
*/
|
||||
virtual int getRequirements(const QAction *) { return MeshModel::MM_NONE; }
|
||||
|
||||
/** The FilterPrecondition mask is used to explicitate what kind of data a filter really needs to be applied.
|
||||
// For example algorithms that compute per face quality have as precondition the existence of faces
|
||||
// (but quality per face is not a precondition, because quality per face is created by these algorithms)
|
||||
// on the other hand an algorithm that deletes faces according to the stored quality has both FaceQuality
|
||||
// and Face as precondition.
|
||||
// These conditions do NOT include computed properties like borderFlags, manifoldness or watertightness.
|
||||
// They are also used to grayout menus un-appliable entries.
|
||||
*/
|
||||
virtual int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; }
|
||||
|
||||
/** Function used by the framework to get info about the mesh properties changed by the filter.
|
||||
// It is widely used by the meshlab's preview system.
|
||||
//TO BE REPLACED WITH = 0
|
||||
*/
|
||||
virtual int postCondition(const QAction*) const { return MeshModel::MM_ALL; }
|
||||
|
||||
/** \brief applies the selected filter with the already stabilished parameters
|
||||
* This function is called by the framework after getting values for the parameters specified in the \ref InitParameterSet
|
||||
* NO GUI interaction should be done here. No dialog asking, no messagebox errors.
|
||||
* Think that his function will also be called by the commandline framework.
|
||||
* If you want report errors, use the \ref errorMsg() string. It will displayed in case of filters returning false.
|
||||
* When implementing your applyFilter, you should use the cb function to report to the framework the current state of the processing.
|
||||
* During your (long) processing you should call from time to time cb(perc,descriptiveString), where perc is an int (0..100)
|
||||
* saying what you are doing and at what point of the computation you currently are.
|
||||
* \sa errorMsg
|
||||
* \sa initParameterSet
|
||||
*/
|
||||
virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0;
|
||||
|
||||
/** \brief tests if a filter is applicable to a mesh.
|
||||
This function is a handy wrapper used by the framework for the \a getPreConditions callback;
|
||||
For instance a colorize by quality filter cannot be applied to a mesh without per-vertex-quality.
|
||||
On failure (returning false) the function fills the MissingItems list with strings describing the missing items.
|
||||
*/
|
||||
bool isFilterApplicable(const QAction *act, const MeshModel& m, QStringList &MissingItems) const;
|
||||
|
||||
|
||||
enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 };
|
||||
|
||||
/** \brief this function informs the MeshLab core on how many meshes the filter will work on.
|
||||
Valid value:
|
||||
- SINGLE_MESH: the filter works just on the current mesh
|
||||
- FIXED: the number (and the names) of the meshes involved in the filter computation is determined by the parameters selected in the filter's parameters form
|
||||
- VARIABLE: the filter works on a not predetermined number of meshes. The meshes involved are typically selected by the user checking on the correspondent layer on the layer dialog
|
||||
*/
|
||||
virtual FILTER_ARITY filterArity(const QAction *act) const = 0;
|
||||
|
||||
// This function is called to initialized the list of parameters.
|
||||
// it is always called. If a filter does not need parameter it leave it empty and the framework
|
||||
// will not create a dialog (unless for previewing)
|
||||
virtual void initParameterList(const QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {}
|
||||
virtual void initParameterList(const QAction *filter, MeshDocument &md, RichParameterList &par)
|
||||
{
|
||||
initParameterList(filter, *(md.mm()), par);
|
||||
}
|
||||
|
||||
/** \brief is invoked by the framework when the applyFilter fails to give some info to the user about the filter failure
|
||||
* Filters \b must never use QMessageBox for reporting errors.
|
||||
* Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter
|
||||
*/
|
||||
const QString &errorMsg() const { return this->errorMessage; }
|
||||
virtual QString filterInfo(const QAction *a) const { return this->filterInfo(ID(a)); }
|
||||
virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); }
|
||||
virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; }
|
||||
|
||||
virtual FilterIDType ID(const QAction *a) const
|
||||
{
|
||||
QString aa=a->text();
|
||||
foreach(FilterIDType tt, types())
|
||||
if (a->text() == this->filterName(tt)) return tt;
|
||||
aa.replace("&","");
|
||||
foreach(FilterIDType tt, types())
|
||||
if (aa == this->filterName(tt)) return tt;
|
||||
|
||||
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text()));
|
||||
assert(0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
virtual QAction *AC(FilterIDType filterID)
|
||||
{
|
||||
QString idName = this->filterName(filterID);
|
||||
return AC(idName);
|
||||
}
|
||||
|
||||
virtual QAction *AC(const QString& idName)
|
||||
{
|
||||
QString i=idName;
|
||||
for(QAction *tt : actionList)
|
||||
if (idName == tt->text()) return tt;
|
||||
i.replace("&","");
|
||||
for(QAction *tt : actionList)
|
||||
if (i == tt->text()) return tt;
|
||||
|
||||
qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName));
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual QList<QAction *> actions() const { return actionList; }
|
||||
virtual QList<FilterIDType> types() const { return typeList; }
|
||||
|
||||
/** Generate the mask of attributes would be created IF the MeshFilterInterface filt would has been called on MeshModel mm
|
||||
BE CAREFUL! this function does NOT change in anyway the state of the MeshModel!!!! **/
|
||||
int previewOnCreatedAttributes(const QAction* act, const MeshModel& mm) const;
|
||||
QString generatedScriptCode;
|
||||
|
||||
MLPluginGLContext* glContext;
|
||||
protected:
|
||||
// Each plugins exposes a set of filtering possibilities.
|
||||
// Each filtering procedure corresponds to a single QAction with a corresponding FilterIDType id.
|
||||
//
|
||||
|
||||
// The list of actions exported by the plugin. Each actions strictly corresponds to
|
||||
QList <QAction *> actionList;
|
||||
|
||||
QList <FilterIDType> typeList;
|
||||
|
||||
// this string is used to pass back to the framework error messages in case of failure of a filter apply.
|
||||
QString errorMessage;
|
||||
};
|
||||
|
||||
#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x)
|
||||
#define MESHLAB_PLUGIN_NAME_EXPORTER(x)
|
||||
|
||||
#define FILTER_PLUGIN_INTERFACE_IID "vcg.meshlab.FilterPluginInterface/1.0"
|
||||
Q_DECLARE_INTERFACE(FilterPluginInterface, FILTER_PLUGIN_INTERFACE_IID)
|
||||
|
||||
#endif // MESHLAB_FILTER_PLUGIN_INTERFACE_H
|
||||
@ -106,7 +106,7 @@ public:
|
||||
#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x)
|
||||
#define MESHLAB_PLUGIN_NAME_EXPORTER(x)
|
||||
|
||||
#define MESH_IO_INTERFACE_IID "vcg.meshlab.IOPluginInterface/1.0"
|
||||
Q_DECLARE_INTERFACE(IOPluginInterface, MESH_IO_INTERFACE_IID)
|
||||
#define IO_PLUGIN_INTERFACE_IID "vcg.meshlab.IOPluginInterface/1.0"
|
||||
Q_DECLARE_INTERFACE(IOPluginInterface, IO_PLUGIN_INTERFACE_IID)
|
||||
|
||||
#endif // MESHLAB_IO_PLUGIN_INTERFACE_H
|
||||
|
||||
@ -84,7 +84,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
|
||||
{
|
||||
pluginsLoaded.push_back(fileName);
|
||||
PluginInterface *iCommon = nullptr;
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(plugin);
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(plugin);
|
||||
if (iFilter)
|
||||
{
|
||||
iCommon = iFilter;
|
||||
@ -95,7 +95,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
|
||||
actionFilterMap.insert(filterAction->text(), filterAction);
|
||||
stringFilterMap.insert(filterAction->text(), iFilter);
|
||||
iFilter->initGlobalParameterSet(filterAction, defaultGlobal);
|
||||
if(iFilter->getClass(filterAction)==MeshFilterInterface::Generic)
|
||||
if(iFilter->getClass(filterAction)==FilterPluginInterface::Generic)
|
||||
throw MLException("Missing class for " +fileName+filterAction->text());
|
||||
if(iFilter->getRequirements(filterAction) == int(MeshModel::MM_UNKNOWN))
|
||||
throw MLException("Missing requirements for " +fileName+filterAction->text());
|
||||
@ -103,7 +103,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
|
||||
throw MLException("Missing preconditions for "+fileName+filterAction->text());
|
||||
if(iFilter->postCondition(filterAction) == int(MeshModel::MM_UNKNOWN ))
|
||||
throw MLException("Missing postcondition for "+fileName+filterAction->text());
|
||||
if(iFilter->filterArity(filterAction) == MeshFilterInterface::UNKNOWN_ARITY )
|
||||
if(iFilter->filterArity(filterAction) == FilterPluginInterface::UNKNOWN_ARITY )
|
||||
throw MLException("Missing Arity for " +fileName+filterAction->text());
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
#define PLUGINMANAGER_H
|
||||
|
||||
#include "interfaces.h"
|
||||
#include "interfaces/filter_plugin_interface.h"
|
||||
#include "interfaces/io_plugin_interface.h"
|
||||
//#include "scriptsyntax.h"
|
||||
|
||||
@ -45,7 +46,7 @@ public:
|
||||
QString pluginsCode() const;
|
||||
|
||||
int numberIOPlugins() const;
|
||||
inline QVector<MeshFilterInterface*>& meshFilterPlugins() {return meshFilterPlug;}
|
||||
inline QVector<FilterPluginInterface*>& meshFilterPlugins() {return meshFilterPlug;}
|
||||
inline QVector<MeshRenderInterface*>& meshRenderPlugins() {return meshRenderPlug;}
|
||||
inline QVector<MeshDecorateInterface*>& meshDecoratePlugins() {return meshDecoratePlug;}
|
||||
inline QVector<MeshEditInterfaceFactory*>& meshEditFactoryPlugins() {return meshEditInterfacePlug;}
|
||||
@ -59,14 +60,14 @@ public:
|
||||
|
||||
|
||||
QMap<QString, QAction*> actionFilterMap;
|
||||
QMap<QString, MeshFilterInterface*> stringFilterMap;
|
||||
QMap<QString, FilterPluginInterface*> stringFilterMap;
|
||||
QMap<QString,IOPluginInterface*> allKnowInputFormats;
|
||||
QMap<QString,IOPluginInterface*> allKnowOutputFormats;
|
||||
QStringList inpFilters;
|
||||
QStringList outFilters;
|
||||
|
||||
QVector<IOPluginInterface*> meshIOPlug;
|
||||
QVector<MeshFilterInterface*> meshFilterPlug;
|
||||
QVector<FilterPluginInterface*> meshFilterPlug;
|
||||
QVector<MeshRenderInterface*> meshRenderPlug;
|
||||
QVector<MeshDecorateInterface*> meshDecoratePlug;
|
||||
QVector<MeshEditInterfaceFactory*> meshEditInterfacePlug;
|
||||
|
||||
@ -210,7 +210,7 @@ void FilterScriptDialog::editOldParameters( const int row )
|
||||
//get a pointer to this action and filter from the main window so we can get the
|
||||
//description of the parameters from the filter
|
||||
QAction *action = mainWindow->pluginManager().actionFilterMap[actionName];
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(action->parent());
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(action->parent());
|
||||
|
||||
if(NULL == iFilter){
|
||||
qDebug() << "null filter";
|
||||
|
||||
@ -500,7 +500,7 @@ void MainWindow::createToolBars()
|
||||
filterToolBar = addToolBar(tr("Filter"));
|
||||
filterToolBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
|
||||
foreach(MeshFilterInterface *iFilter, PM.meshFilterPlugins())
|
||||
foreach(FilterPluginInterface *iFilter, PM.meshFilterPlugins())
|
||||
{
|
||||
foreach(QAction* filterAction, iFilter->actions())
|
||||
{
|
||||
@ -717,10 +717,10 @@ void MainWindow::fillFilterMenu()
|
||||
filterMenu->addMenu(filterMenuCamera);
|
||||
|
||||
|
||||
QMap<QString, MeshFilterInterface *>::iterator msi;
|
||||
QMap<QString, FilterPluginInterface *>::iterator msi;
|
||||
for (msi = PM.stringFilterMap.begin(); msi != PM.stringFilterMap.end(); ++msi)
|
||||
{
|
||||
MeshFilterInterface * iFilter = msi.value();
|
||||
FilterPluginInterface * iFilter = msi.value();
|
||||
QAction *filterAction = iFilter->AC((msi.key()));
|
||||
QString tooltip = iFilter->filterInfo(filterAction) + "<br>" + getDecoratedFileName(filterAction->data().toString());
|
||||
filterAction->setToolTip(tooltip);
|
||||
@ -728,79 +728,79 @@ void MainWindow::fillFilterMenu()
|
||||
connect(filterAction, SIGNAL(triggered()), this, SLOT(startFilter()));
|
||||
|
||||
int filterClass = iFilter->getClass(filterAction);
|
||||
if (filterClass & MeshFilterInterface::FaceColoring)
|
||||
if (filterClass & FilterPluginInterface::FaceColoring)
|
||||
{
|
||||
filterMenuColorize->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::VertexColoring)
|
||||
if (filterClass & FilterPluginInterface::VertexColoring)
|
||||
{
|
||||
filterMenuColorize->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::MeshColoring)
|
||||
if (filterClass & FilterPluginInterface::MeshColoring)
|
||||
{
|
||||
filterMenuColorize->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Selection)
|
||||
if (filterClass & FilterPluginInterface::Selection)
|
||||
{
|
||||
filterMenuSelect->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Cleaning)
|
||||
if (filterClass & FilterPluginInterface::Cleaning)
|
||||
{
|
||||
filterMenuClean->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Remeshing)
|
||||
if (filterClass & FilterPluginInterface::Remeshing)
|
||||
{
|
||||
filterMenuRemeshing->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Smoothing)
|
||||
if (filterClass & FilterPluginInterface::Smoothing)
|
||||
{
|
||||
filterMenuSmoothing->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Normal)
|
||||
if (filterClass & FilterPluginInterface::Normal)
|
||||
{
|
||||
filterMenuNormal->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Quality)
|
||||
if (filterClass & FilterPluginInterface::Quality)
|
||||
{
|
||||
filterMenuQuality->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Measure)
|
||||
if (filterClass & FilterPluginInterface::Measure)
|
||||
{
|
||||
filterMenuQuality->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Layer)
|
||||
if (filterClass & FilterPluginInterface::Layer)
|
||||
{
|
||||
filterMenuMeshLayer->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::RasterLayer)
|
||||
if (filterClass & FilterPluginInterface::RasterLayer)
|
||||
{
|
||||
filterMenuRasterLayer->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::MeshCreation)
|
||||
if (filterClass & FilterPluginInterface::MeshCreation)
|
||||
{
|
||||
filterMenuCreate->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::RangeMap)
|
||||
if (filterClass & FilterPluginInterface::RangeMap)
|
||||
{
|
||||
filterMenuRangeMap->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::PointSet)
|
||||
if (filterClass & FilterPluginInterface::PointSet)
|
||||
{
|
||||
filterMenuPointSet->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Sampling)
|
||||
if (filterClass & FilterPluginInterface::Sampling)
|
||||
{
|
||||
filterMenuSampling->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Texture)
|
||||
if (filterClass & FilterPluginInterface::Texture)
|
||||
{
|
||||
filterMenuTexture->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Polygonal)
|
||||
if (filterClass & FilterPluginInterface::Polygonal)
|
||||
{
|
||||
filterMenuPolygonal->addAction(filterAction);
|
||||
}
|
||||
if (filterClass & MeshFilterInterface::Camera)
|
||||
if (filterClass & FilterPluginInterface::Camera)
|
||||
{
|
||||
filterMenuCamera->addAction(filterAction);
|
||||
}
|
||||
|
||||
@ -783,7 +783,7 @@ void MainWindow::runFilterScript()
|
||||
int classes = 0;
|
||||
int postCondMask = 0;
|
||||
QAction *action = PM.actionFilterMap[ filtnm];
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(action->parent());
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(action->parent());
|
||||
|
||||
int req=iFilter->getRequirements(action);
|
||||
if (meshDoc()->mm() != NULL)
|
||||
@ -824,7 +824,7 @@ void MainWindow::runFilterScript()
|
||||
atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true;
|
||||
|
||||
|
||||
if (iFilter->filterArity(action) == MeshFilterInterface::SINGLE_MESH)
|
||||
if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH)
|
||||
{
|
||||
MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm());
|
||||
if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL))
|
||||
@ -864,11 +864,11 @@ void MainWindow::runFilterScript()
|
||||
postCondMask = iFilter->postCondition(action);
|
||||
if (meshDoc()->mm() != NULL)
|
||||
{
|
||||
if(classes & MeshFilterInterface::FaceColoring )
|
||||
if(classes & FilterPluginInterface::FaceColoring )
|
||||
{
|
||||
meshDoc()->mm()->updateDataMask(MeshModel::MM_FACECOLOR);
|
||||
}
|
||||
if(classes & MeshFilterInterface::VertexColoring )
|
||||
if(classes & FilterPluginInterface::VertexColoring )
|
||||
{
|
||||
meshDoc()->mm()->updateDataMask(MeshModel::MM_VERTCOLOR);
|
||||
}
|
||||
@ -881,12 +881,12 @@ void MainWindow::runFilterScript()
|
||||
}
|
||||
|
||||
bool newmeshcreated = false;
|
||||
if (classes & MeshFilterInterface::MeshCreation)
|
||||
if (classes & FilterPluginInterface::MeshCreation)
|
||||
newmeshcreated = true;
|
||||
updateSharedContextDataAfterFilterExecution(postCondMask, classes, newmeshcreated);
|
||||
meshDoc()->meshDocStateData().clear();
|
||||
|
||||
if(classes & MeshFilterInterface::MeshCreation)
|
||||
if(classes & FilterPluginInterface::MeshCreation)
|
||||
GLA()->resetTrackBall();
|
||||
/* to be changed */
|
||||
|
||||
@ -931,7 +931,7 @@ void MainWindow::startFilter()
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
if (action == NULL)
|
||||
throw MLException("Invalid filter action value.");
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(action->parent());
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(action->parent());
|
||||
if (meshDoc() == NULL)
|
||||
return;
|
||||
//OLD FILTER PHILOSOPHY
|
||||
@ -992,19 +992,19 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in
|
||||
if (mm == NULL)
|
||||
continue;
|
||||
//Just to be sure that the filter author didn't forget to add changing tags to the postCondition field
|
||||
if ((mm->hasDataMask(MeshModel::MM_FACECOLOR)) && (fclasses & MeshFilterInterface::FaceColoring ))
|
||||
if ((mm->hasDataMask(MeshModel::MM_FACECOLOR)) && (fclasses & FilterPluginInterface::FaceColoring ))
|
||||
postcondmask = postcondmask | MeshModel::MM_FACECOLOR;
|
||||
|
||||
if ((mm->hasDataMask(MeshModel::MM_VERTCOLOR)) && (fclasses & MeshFilterInterface::VertexColoring ))
|
||||
if ((mm->hasDataMask(MeshModel::MM_VERTCOLOR)) && (fclasses & FilterPluginInterface::VertexColoring ))
|
||||
postcondmask = postcondmask | MeshModel::MM_VERTCOLOR;
|
||||
|
||||
if ((mm->hasDataMask(MeshModel::MM_COLOR)) && (fclasses & MeshFilterInterface::MeshColoring ))
|
||||
if ((mm->hasDataMask(MeshModel::MM_COLOR)) && (fclasses & FilterPluginInterface::MeshColoring ))
|
||||
postcondmask = postcondmask | MeshModel::MM_COLOR;
|
||||
|
||||
if ((mm->hasDataMask(MeshModel::MM_FACEQUALITY)) && (fclasses & MeshFilterInterface::Quality ))
|
||||
if ((mm->hasDataMask(MeshModel::MM_FACEQUALITY)) && (fclasses & FilterPluginInterface::Quality ))
|
||||
postcondmask = postcondmask | MeshModel::MM_FACEQUALITY;
|
||||
|
||||
if ((mm->hasDataMask(MeshModel::MM_VERTQUALITY)) && (fclasses & MeshFilterInterface::Quality ))
|
||||
if ((mm->hasDataMask(MeshModel::MM_VERTQUALITY)) && (fclasses & FilterPluginInterface::Quality ))
|
||||
postcondmask = postcondmask | MeshModel::MM_VERTQUALITY;
|
||||
|
||||
MLRenderingData dttoberendered;
|
||||
@ -1066,7 +1066,7 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in
|
||||
}
|
||||
MLPerViewGLOptions opts;
|
||||
curr.get(opts);
|
||||
if (fclasses & MeshFilterInterface::MeshColoring)
|
||||
if (fclasses & FilterPluginInterface::MeshColoring)
|
||||
{
|
||||
bool hasmeshcolor = mm->hasDataMask(MeshModel::MM_COLOR);
|
||||
opts._perpoint_mesh_color_enabled = hasmeshcolor;
|
||||
@ -1137,7 +1137,7 @@ from the user defined dialog
|
||||
|
||||
void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool isPreview)
|
||||
{
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(action->parent());
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(action->parent());
|
||||
qb->show();
|
||||
iFilter->setLog(&meshDoc()->Log);
|
||||
|
||||
@ -1179,7 +1179,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool
|
||||
atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true;
|
||||
atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true;
|
||||
|
||||
if (iFilter->filterArity(action) == MeshFilterInterface::SINGLE_MESH)
|
||||
if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH)
|
||||
{
|
||||
MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm());
|
||||
if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL))
|
||||
@ -1244,16 +1244,16 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool
|
||||
}
|
||||
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY arity = iFilter->filterArity(action);
|
||||
FilterPluginInterface::FILTER_ARITY arity = iFilter->filterArity(action);
|
||||
QList<MeshModel*> tmp;
|
||||
switch(arity)
|
||||
{
|
||||
case (MeshFilterInterface::SINGLE_MESH):
|
||||
case (FilterPluginInterface::SINGLE_MESH):
|
||||
{
|
||||
tmp.push_back(meshDoc()->mm());
|
||||
break;
|
||||
}
|
||||
case (MeshFilterInterface::FIXED):
|
||||
case (FilterPluginInterface::FIXED):
|
||||
{
|
||||
for(const RichParameter& p : mergedenvironment)
|
||||
{
|
||||
@ -1266,7 +1266,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (MeshFilterInterface::VARIABLE):
|
||||
case (FilterPluginInterface::VARIABLE):
|
||||
{
|
||||
for(MeshModel* mm = meshDoc()->nextMesh();mm != NULL;mm=meshDoc()->nextMesh(mm))
|
||||
{
|
||||
@ -1279,7 +1279,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool
|
||||
break;
|
||||
}
|
||||
|
||||
if(iFilter->getClass(action) & MeshFilterInterface::MeshCreation )
|
||||
if(iFilter->getClass(action) & FilterPluginInterface::MeshCreation )
|
||||
GLA()->resetTrackBall();
|
||||
|
||||
for(int jj = 0;jj < tmp.size();++jj)
|
||||
@ -1288,19 +1288,19 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool
|
||||
if (mm != NULL)
|
||||
{
|
||||
// at the end for filters that change the color, or selection set the appropriate rendering mode
|
||||
if(iFilter->getClass(action) & MeshFilterInterface::FaceColoring )
|
||||
if(iFilter->getClass(action) & FilterPluginInterface::FaceColoring )
|
||||
mm->updateDataMask(MeshModel::MM_FACECOLOR);
|
||||
|
||||
if(iFilter->getClass(action) & MeshFilterInterface::VertexColoring )
|
||||
if(iFilter->getClass(action) & FilterPluginInterface::VertexColoring )
|
||||
mm->updateDataMask(MeshModel::MM_VERTCOLOR);
|
||||
|
||||
if(iFilter->getClass(action) & MeshFilterInterface::MeshColoring )
|
||||
if(iFilter->getClass(action) & FilterPluginInterface::MeshColoring )
|
||||
mm->updateDataMask(MeshModel::MM_COLOR);
|
||||
|
||||
if(iFilter->postCondition(action) & MeshModel::MM_CAMERA)
|
||||
mm->updateDataMask(MeshModel::MM_CAMERA);
|
||||
|
||||
if(iFilter->getClass(action) & MeshFilterInterface::Texture )
|
||||
if(iFilter->getClass(action) & FilterPluginInterface::Texture )
|
||||
updateTexture(mm->id());
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ MeshlabStdDialog::MeshlabStdDialog(QWidget *p)
|
||||
}
|
||||
|
||||
/* manages the setup of the standard parameter window, when the execution of a plugin filter is requested */
|
||||
bool MeshlabStdDialog::showAutoDialog(MeshFilterInterface *mfi, MeshModel *mm, MeshDocument * mdp, QAction *action, MainWindow *mwi, QWidget *gla)
|
||||
bool MeshlabStdDialog::showAutoDialog(FilterPluginInterface *mfi, MeshModel *mm, MeshDocument * mdp, QAction *action, MainWindow *mwi, QWidget *gla)
|
||||
{
|
||||
validcache = false;
|
||||
curAction = action;
|
||||
@ -69,7 +69,7 @@ void MeshlabStdDialog::changeCurrentMesh(int meshInd)
|
||||
|
||||
bool MeshlabStdDialog::isPreviewable()
|
||||
{
|
||||
if ((curAction == NULL) || (curmfi == NULL) || (curmfi->filterArity(curAction) != MeshFilterInterface::SINGLE_MESH))
|
||||
if ((curAction == NULL) || (curmfi == NULL) || (curmfi->filterArity(curAction) != FilterPluginInterface::SINGLE_MESH))
|
||||
return false;
|
||||
|
||||
if ((curmask == MeshModel::MM_UNKNOWN) || (curmask == MeshModel::MM_NONE))
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
|
||||
#include<QDockWidget>
|
||||
#include "rich_parameter_gui/richparameterlistframe.h"
|
||||
#include "../common/interfaces/filter_plugin_interface.h"
|
||||
|
||||
class MainWindow;
|
||||
class MeshlabStdDialog : public QDockWidget
|
||||
@ -40,7 +41,7 @@ public:
|
||||
void createFrame();
|
||||
void loadFrameContent(MeshDocument *mdPt=0);
|
||||
|
||||
bool showAutoDialog(MeshFilterInterface *mfi, MeshModel *mm, MeshDocument * md, QAction *q, MainWindow *mwi, QWidget *gla=0);
|
||||
bool showAutoDialog(FilterPluginInterface *mfi, MeshModel *mm, MeshDocument * md, QAction *q, MainWindow *mwi, QWidget *gla=0);
|
||||
bool isPreviewable();
|
||||
|
||||
public slots:
|
||||
@ -67,7 +68,7 @@ public:
|
||||
uint curmask;
|
||||
MeshModel *curModel;
|
||||
MeshDocument * curMeshDoc;
|
||||
MeshFilterInterface *curmfi;
|
||||
FilterPluginInterface *curmfi;
|
||||
MainWindow *curmwi;
|
||||
QWidget * curgla;
|
||||
RichParameterList curParSet;
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
#include "plugindialog.h"
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <common/interfaces/io_plugin_interface.h>
|
||||
|
||||
#include <QLabel>
|
||||
@ -138,7 +139,7 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil
|
||||
foreach(QAction *a,iDecorate->actions()){Templist.push_back(a->text());}
|
||||
addItems(pluginItem,Templist);
|
||||
}
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(plugin);
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(plugin);
|
||||
if (iFilter){
|
||||
QStringList Templist;
|
||||
foreach(QAction *a,iFilter->actions()){Templist.push_back(a->text());}
|
||||
@ -205,7 +206,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/)
|
||||
if (actionName==a->text())
|
||||
labelInfo->setText(iDecorate->decorationInfo(a));
|
||||
}
|
||||
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(plugin);
|
||||
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(plugin);
|
||||
if (iFilter)
|
||||
{
|
||||
foreach(QAction *a,iFilter->actions())
|
||||
|
||||
@ -24,8 +24,6 @@
|
||||
#ifndef RICHPARAMETERLISTFRAME_H
|
||||
#define RICHPARAMETERLISTFRAME_H
|
||||
|
||||
#include "../../common/interfaces.h"
|
||||
|
||||
#include "richparameterwidgets.h"
|
||||
|
||||
#include<QCheckBox>
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
#include <common/GLExtensionsManager.h>
|
||||
#include "filter_ao.h"
|
||||
#include <QGLFramebufferObject>
|
||||
#include <QElapsedTimer>
|
||||
#include <QTextStream>
|
||||
#include <vcg/math/gen_normal.h>
|
||||
|
||||
#include <wrap/qt/checkGLError.h>
|
||||
@ -97,16 +99,16 @@ int AmbientOcclusionPlugin::getRequirements(const QAction * /*action*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(const QAction*) const
|
||||
FilterPluginInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(const QAction*) const
|
||||
{
|
||||
return SINGLE_MESH;
|
||||
}
|
||||
|
||||
int getRequirements(QAction *action);
|
||||
|
||||
MeshFilterInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction * /*filter*/) const
|
||||
FilterPluginInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction * /*filter*/) const
|
||||
{
|
||||
return MeshFilterInterface::VertexColoring;
|
||||
return FilterPluginInterface::VertexColoring;
|
||||
//return MeshFilterInterface::FilterClass(MeshFilterInterface::FaceColoring | MeshFilterInterface::VertexColoring);
|
||||
};
|
||||
|
||||
|
||||
@ -26,14 +26,14 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <wrap/gl/gl_surface.h>
|
||||
class AOGLWidget;
|
||||
class AmbientOcclusionPlugin : public QObject, public MeshFilterInterface
|
||||
class AmbientOcclusionPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
// Attributes
|
||||
protected:
|
||||
|
||||
@ -716,16 +716,16 @@ FilterCameraPlugin::FilterClass FilterCameraPlugin::getClass(const QAction *a) c
|
||||
case FP_CAMERA_TRANSLATE :
|
||||
case FP_CAMERA_TRANSFORM:
|
||||
case FP_SET_RASTER_CAMERA :
|
||||
return FilterClass (MeshFilterInterface::Camera + MeshFilterInterface::RasterLayer) ;
|
||||
return FilterClass (FilterPluginInterface::Camera + FilterPluginInterface::RasterLayer) ;
|
||||
case FP_QUALITY_FROM_CAMERA:
|
||||
return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::RasterLayer + MeshFilterInterface::Quality);
|
||||
return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::RasterLayer + FilterPluginInterface::Quality);
|
||||
case FP_ORIENT_NORMALS_WITH_CAMERAS:
|
||||
return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::Normal);
|
||||
return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::Normal);
|
||||
case FP_SET_MESH_CAMERA:
|
||||
return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::Layer);
|
||||
return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::Layer);
|
||||
}
|
||||
assert(0);
|
||||
return MeshFilterInterface::Camera;
|
||||
return FilterPluginInterface::Camera;
|
||||
}
|
||||
|
||||
int FilterCameraPlugin::getPreConditions(const QAction * a) const
|
||||
@ -747,7 +747,7 @@ int FilterCameraPlugin::getPreConditions(const QAction * a) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterCameraPlugin::filterArity(const QAction* act ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterCameraPlugin::filterArity(const QAction* act ) const
|
||||
{
|
||||
switch (ID(act))
|
||||
{
|
||||
|
||||
@ -26,13 +26,13 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterCameraPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterCameraPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_SET_MESH_CAMERA,
|
||||
|
||||
@ -159,12 +159,12 @@ QString CleanFilter::filterName(FilterIDType filter) const
|
||||
case FP_REMOVE_UNREFERENCED_VERTEX:
|
||||
case FP_REMOVE_DUPLICATED_VERTEX:
|
||||
case FP_COMPACT_VERT:
|
||||
case FP_COMPACT_FACE: return MeshFilterInterface::Cleaning;
|
||||
case FP_BALL_PIVOTING: return MeshFilterInterface::Remeshing;
|
||||
case FP_MERGE_WEDGE_TEX: return MeshFilterInterface::FilterClass(MeshFilterInterface::Cleaning + MeshFilterInterface::Texture);
|
||||
case FP_COMPACT_FACE: return FilterPluginInterface::Cleaning;
|
||||
case FP_BALL_PIVOTING: return FilterPluginInterface::Remeshing;
|
||||
case FP_MERGE_WEDGE_TEX: return FilterPluginInterface::FilterClass(FilterPluginInterface::Cleaning + FilterPluginInterface::Texture);
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
int CleanFilter::getRequirements(const QAction *action)
|
||||
|
||||
@ -25,13 +25,13 @@
|
||||
#define __CLEAN_FILTER_H__
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class CleanFilter : public QObject, public MeshFilterInterface
|
||||
class CleanFilter : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
|
||||
@ -932,7 +932,7 @@ FilterColorProjectionPlugin::FilterClass FilterColorProjectionPlugin::getClass(c
|
||||
return FilterClass(Camera + Texture);
|
||||
break;
|
||||
default : assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,13 +25,13 @@
|
||||
#define FILTER_COLORPROJ_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterColorProjectionPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterColorProjectionPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_SINGLEIMAGEPROJ, FP_MULTIIMAGETRIVIALPROJ, FP_MULTIIMAGETRIVIALPROJTEXTURE };
|
||||
|
||||
@ -915,7 +915,7 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const
|
||||
return false;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterColorProc::getClass(const QAction *a) const
|
||||
FilterPluginInterface::FilterClass FilterColorProc::getClass(const QAction *a) const
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
@ -933,10 +933,10 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const
|
||||
case CP_MAP_VQUALITY_INTO_COLOR:
|
||||
case CP_VERTEX_SMOOTH:
|
||||
case CP_FACE_TO_VERTEX:
|
||||
case CP_TEXTURE_TO_VERTEX: return MeshFilterInterface::VertexColoring;
|
||||
case CP_SCATTER_PER_MESH: return MeshFilterInterface::MeshColoring;
|
||||
case CP_TEXTURE_TO_VERTEX: return FilterPluginInterface::VertexColoring;
|
||||
case CP_SCATTER_PER_MESH: return FilterPluginInterface::MeshColoring;
|
||||
case CP_SATURATE_QUALITY:
|
||||
case CP_CLAMP_QUALITY: return MeshFilterInterface::Quality;
|
||||
case CP_CLAMP_QUALITY: return FilterPluginInterface::Quality;
|
||||
case CP_DISCRETE_CURVATURE: return FilterClass(Normal + VertexColoring);
|
||||
case CP_TRIANGLE_QUALITY: return FilterClass(Quality + FaceColoring);
|
||||
case CP_RANDOM_FACE:
|
||||
@ -944,10 +944,10 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const
|
||||
case CP_FACE_SMOOTH:
|
||||
case CP_VERTEX_TO_FACE:
|
||||
case CP_MESH_TO_FACE:
|
||||
case CP_MAP_FQUALITY_INTO_COLOR: return MeshFilterInterface::FaceColoring;
|
||||
case CP_MAP_FQUALITY_INTO_COLOR: return FilterPluginInterface::FaceColoring;
|
||||
default: assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
int FilterColorProc::postCondition( const QAction* filter ) const
|
||||
@ -1022,7 +1022,7 @@ int FilterColorProc::getPreConditions(const QAction* filter ) const
|
||||
return MeshModel::MM_NONE;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* act ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* act ) const
|
||||
{
|
||||
switch(ID(act))
|
||||
{
|
||||
@ -1050,12 +1050,12 @@ MeshFilterInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* ac
|
||||
case CP_MAP_FQUALITY_INTO_COLOR:
|
||||
case CP_FACE_TO_VERTEX:
|
||||
case CP_FACE_SMOOTH:
|
||||
case CP_TEXTURE_TO_VERTEX: return MeshFilterInterface::SINGLE_MESH;
|
||||
case CP_SCATTER_PER_MESH: return MeshFilterInterface::VARIABLE;
|
||||
case CP_TEXTURE_TO_VERTEX: return FilterPluginInterface::SINGLE_MESH;
|
||||
case CP_SCATTER_PER_MESH: return FilterPluginInterface::VARIABLE;
|
||||
|
||||
default: assert(0);
|
||||
}
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -25,14 +25,14 @@
|
||||
#define FILTERCOLORPROCPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
|
||||
class FilterColorProc : public QObject, public MeshFilterInterface
|
||||
class FilterColorProc : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { CP_FILLING,
|
||||
|
||||
@ -527,7 +527,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri
|
||||
return true;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterCreate::getClass(const QAction *a) const
|
||||
FilterPluginInterface::FilterClass FilterCreate::getClass(const QAction *a) const
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
@ -543,11 +543,11 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri
|
||||
case CR_CONE:
|
||||
case CR_TORUS:
|
||||
case CR_FITPLANE:
|
||||
return MeshFilterInterface::MeshCreation;
|
||||
return FilterPluginInterface::MeshCreation;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -23,13 +23,13 @@
|
||||
|
||||
#ifndef FILTER_CREATE_H
|
||||
#define FILTER_CREATE_H
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterCreate : public QObject, public MeshFilterInterface
|
||||
class FilterCreate : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -83,8 +83,8 @@ QString FilterCreateIso::pluginName() const
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_CREATEISO : return MeshFilterInterface::MeshCreation;
|
||||
default : return MeshFilterInterface::Generic;
|
||||
case FP_CREATEISO : return FilterPluginInterface::MeshCreation;
|
||||
default : return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,14 +33,14 @@ Added the new sample filter plugin that removes border faces
|
||||
#define FILTERCREATEISO_PLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
|
||||
class FilterCreateIso : public QObject, public MeshFilterInterface
|
||||
class FilterCreateIso : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
|
||||
@ -28,18 +28,17 @@
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
|
||||
#include <common/meshmodel.h>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
|
||||
//FILE _iob[] = { *stdin, *stdout, *stderr };
|
||||
//extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
|
||||
|
||||
class FilterCSG : public QObject, public MeshFilterInterface
|
||||
class FilterCSG : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
enum {
|
||||
CSG_OPERATION_INTERSECTION = 0,
|
||||
@ -63,7 +62,7 @@ public:
|
||||
|
||||
virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *);
|
||||
|
||||
virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); }
|
||||
virtual FilterClass getClass(const QAction *) const { return FilterPluginInterface::FilterClass( FilterPluginInterface::Layer + FilterPluginInterface::Remeshing ); }
|
||||
FILTER_ARITY filterArity(const QAction*) const {return FIXED;}
|
||||
};
|
||||
|
||||
|
||||
@ -253,14 +253,14 @@ int FilterDirt::postCondition(const QAction *a) const
|
||||
return MeshModel::MM_ALL;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterDirt::getClass(const QAction *filter) const
|
||||
FilterPluginInterface::FilterClass FilterDirt::getClass(const QAction *filter) const
|
||||
{
|
||||
switch (ID(filter)) {
|
||||
case FP_DIRT:return MeshFilterInterface::Sampling;
|
||||
case FP_CLOUD_MOVEMENT:return MeshFilterInterface::Remeshing;
|
||||
case FP_DIRT:return FilterPluginInterface::Sampling;
|
||||
case FP_CLOUD_MOVEMENT:return FilterPluginInterface::Remeshing;
|
||||
default:assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
MESHLAB_PLUGIN_NAME_EXPORTER(FilterDirt)
|
||||
|
||||
@ -27,8 +27,7 @@
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <common/meshmodel.h>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include<vector>
|
||||
#include<vcg/complex/complex.h>
|
||||
//#include "muParser.h"
|
||||
@ -37,11 +36,11 @@ using namespace vcg;
|
||||
//using namespace mu;
|
||||
|
||||
|
||||
class FilterDirt : public QObject, public MeshFilterInterface
|
||||
class FilterDirt : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
protected:
|
||||
double x,y,z,nx,ny,nz,r,g,b,q,rad;
|
||||
//double x0,y0,z0,x1,y1,z1,x2,y2,z2,nx0,ny0,nz0,nx1,ny1,nz1,nx2,ny2,nz2,r0,g0,b0,r1,g1,b1,r2,g2,b2,q0,q1,q2;
|
||||
|
||||
@ -257,7 +257,7 @@ void FilterFractal::initParameterSetForCratersGeneration(MeshDocument &md, RichP
|
||||
|
||||
bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos* cb)
|
||||
{
|
||||
if(this->getClass(filter) == MeshFilterInterface::MeshCreation)
|
||||
if(this->getClass(filter) == FilterPluginInterface::MeshCreation)
|
||||
md.addNewMesh("",this->filterName(ID(filter)));
|
||||
switch(ID(filter))
|
||||
{
|
||||
@ -338,18 +338,18 @@ bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, const R
|
||||
return false;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterFractal::getClass(const QAction* filter) const
|
||||
FilterPluginInterface::FilterClass FilterFractal::getClass(const QAction* filter) const
|
||||
{
|
||||
switch(ID(filter)) {
|
||||
case CR_FRACTAL_TERRAIN:
|
||||
return MeshFilterInterface::MeshCreation;
|
||||
return FilterPluginInterface::MeshCreation;
|
||||
break;
|
||||
case FP_FRACTAL_MESH:
|
||||
case FP_CRATERS:
|
||||
return MeshFilterInterface::Smoothing;
|
||||
return FilterPluginInterface::Smoothing;
|
||||
break;
|
||||
default: assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,18 +382,18 @@ int FilterFractal::postCondition(const QAction *filter) const
|
||||
return MeshModel::MM_ALL;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterFractal::filterArity(const QAction* act ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterFractal::filterArity(const QAction* act ) const
|
||||
{
|
||||
switch(ID(act))
|
||||
{
|
||||
case FP_FRACTAL_MESH:
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case CR_FRACTAL_TERRAIN:
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
case FP_CRATERS:
|
||||
return MeshFilterInterface::VARIABLE;
|
||||
return FilterPluginInterface::VARIABLE;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@ -28,14 +28,14 @@
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include "craters_utils.h"
|
||||
|
||||
class FilterFractal : public QObject, public MeshFilterInterface
|
||||
class FilterFractal : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
FilterFractal();
|
||||
|
||||
@ -166,22 +166,22 @@ FilterFunctionPlugin::FilterClass FilterFunctionPlugin::getClass(const QAction *
|
||||
switch(ID(a))
|
||||
{
|
||||
case FF_FACE_SELECTION:
|
||||
case FF_VERT_SELECTION: return MeshFilterInterface::Selection;
|
||||
case FF_VERT_SELECTION: return FilterPluginInterface::Selection;
|
||||
case FF_FACE_QUALITY: return FilterClass(Quality + FaceColoring);
|
||||
case FF_VERT_QUALITY: return FilterClass(Quality + VertexColoring);
|
||||
case FF_VERT_TEXTURE_FUNC: return MeshFilterInterface::Texture;
|
||||
case FF_VERT_COLOR: return MeshFilterInterface::VertexColoring;
|
||||
case FF_VERT_NORMAL: return MeshFilterInterface::Normal;
|
||||
case FF_FACE_COLOR: return MeshFilterInterface::FaceColoring;
|
||||
case FF_WEDGE_TEXTURE_FUNC: return MeshFilterInterface::Texture;
|
||||
case FF_ISOSURFACE: return MeshFilterInterface::MeshCreation;
|
||||
case FF_GRID: return MeshFilterInterface::MeshCreation;
|
||||
case FF_REFINE: return MeshFilterInterface::Remeshing;
|
||||
case FF_GEOM_FUNC: return MeshFilterInterface::Smoothing;
|
||||
case FF_DEF_VERT_ATTRIB: return MeshFilterInterface::Layer;
|
||||
case FF_DEF_FACE_ATTRIB: return MeshFilterInterface::Layer;
|
||||
case FF_VERT_TEXTURE_FUNC: return FilterPluginInterface::Texture;
|
||||
case FF_VERT_COLOR: return FilterPluginInterface::VertexColoring;
|
||||
case FF_VERT_NORMAL: return FilterPluginInterface::Normal;
|
||||
case FF_FACE_COLOR: return FilterPluginInterface::FaceColoring;
|
||||
case FF_WEDGE_TEXTURE_FUNC: return FilterPluginInterface::Texture;
|
||||
case FF_ISOSURFACE: return FilterPluginInterface::MeshCreation;
|
||||
case FF_GRID: return FilterPluginInterface::MeshCreation;
|
||||
case FF_REFINE: return FilterPluginInterface::Remeshing;
|
||||
case FF_GEOM_FUNC: return FilterPluginInterface::Smoothing;
|
||||
case FF_DEF_VERT_ATTRIB: return FilterPluginInterface::Layer;
|
||||
case FF_DEF_FACE_ATTRIB: return FilterPluginInterface::Layer;
|
||||
|
||||
default: return MeshFilterInterface::Generic;
|
||||
default: return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@ void FilterFunctionPlugin::initParameterList(const QAction *action,MeshModel &m,
|
||||
// The Real Core Function doing the actual mesh processing.
|
||||
bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb)
|
||||
{
|
||||
if(this->getClass(filter) == MeshFilterInterface::MeshCreation)
|
||||
if(this->getClass(filter) == FilterPluginInterface::MeshCreation)
|
||||
md.addNewMesh("",this->filterName(ID(filter)));
|
||||
MeshModel &m=*(md.mm());
|
||||
Q_UNUSED(cb);
|
||||
@ -1433,7 +1433,7 @@ void FilterFunctionPlugin::setPerFaceVariables(Parser &p, CMeshO &m)
|
||||
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QAction* filter ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QAction* filter ) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
@ -1450,12 +1450,12 @@ MeshFilterInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QActio
|
||||
case FF_DEF_VERT_ATTRIB:
|
||||
case FF_DEF_FACE_ATTRIB:
|
||||
case FF_REFINE:
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case FF_GRID:
|
||||
case FF_ISOSURFACE:
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -26,16 +26,16 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
#include "muParser.h"
|
||||
#include "filter_refine.h"
|
||||
|
||||
class FilterFunctionPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterFunctionPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
protected:
|
||||
double x,y,z,nx,ny,nz,r,g,b,a,q,rad,vtu,vtv,vsel;
|
||||
|
||||
@ -90,10 +90,10 @@ FilterGeodesic::FilterClass FilterGeodesic::getClass(const QAction *a) const
|
||||
{
|
||||
case FP_QUALITY_BORDER_GEODESIC :
|
||||
case FP_QUALITY_SELECTED_GEODESIC :
|
||||
case FP_QUALITY_POINT_GEODESIC : return FilterGeodesic::FilterClass(MeshFilterInterface::VertexColoring + MeshFilterInterface::Quality);
|
||||
case FP_QUALITY_POINT_GEODESIC : return FilterGeodesic::FilterClass(FilterPluginInterface::VertexColoring + FilterPluginInterface::Quality);
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
int FilterGeodesic::getRequirements(const QAction *action)
|
||||
|
||||
@ -24,15 +24,15 @@
|
||||
#define FILTERGEODESIC_PLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <vcg/complex/algorithms/geodesic.h>
|
||||
|
||||
|
||||
class FilterGeodesic : public QObject, public MeshFilterInterface
|
||||
class FilterGeodesic : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
|
||||
@ -65,10 +65,10 @@ GlobalRegistrationPlugin::FilterClass GlobalRegistrationPlugin::getClass(const Q
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_GLOBAL_REGISTRATION : return MeshFilterInterface::PointSet;
|
||||
case FP_GLOBAL_REGISTRATION : return FilterPluginInterface::PointSet;
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
void GlobalRegistrationPlugin::initParameterList(const QAction *action,MeshDocument &md, RichParameterList & parlst)
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
#ifndef SAMPLEFILTERSPLUGIN_H
|
||||
#define SAMPLEFILTERSPLUGIN_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class GlobalRegistrationPlugin : public QObject, public MeshFilterInterface
|
||||
class GlobalRegistrationPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_GLOBAL_REGISTRATION } ;
|
||||
|
||||
@ -97,7 +97,7 @@ int FilterImgPatchParamPlugin::getRequirements(const QAction *act )
|
||||
}
|
||||
|
||||
|
||||
MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QAction *act ) const
|
||||
FilterPluginInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QAction *act ) const
|
||||
{
|
||||
switch( ID(act) )
|
||||
{
|
||||
@ -105,7 +105,7 @@ MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QActi
|
||||
case FP_PATCH_PARAM_AND_TEXTURING: return Texture;
|
||||
case FP_RASTER_VERT_COVERAGE:
|
||||
case FP_RASTER_FACE_COVERAGE: return FilterClass(Quality + Camera + Texture);
|
||||
default: assert(0); return MeshFilterInterface::Generic;
|
||||
default: assert(0); return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -28,18 +28,18 @@
|
||||
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <vcg/math/similarity2.h>
|
||||
#include "Patch.h"
|
||||
#include <wrap/glw/glw.h>
|
||||
class VisibleSet;
|
||||
|
||||
|
||||
class FilterImgPatchParamPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterImgPatchParamPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES( MeshFilterInterface )
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES( FilterPluginInterface )
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@ -453,9 +453,9 @@ bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument&
|
||||
return false;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterIsoParametrization::getClass(const QAction *) const
|
||||
FilterPluginInterface::FilterClass FilterIsoParametrization::getClass(const QAction *) const
|
||||
{
|
||||
return MeshFilterInterface::Remeshing;
|
||||
return FilterPluginInterface::Remeshing;
|
||||
}
|
||||
|
||||
int FilterIsoParametrization::postCondition(const QAction* /*filter*/ ) const
|
||||
@ -463,18 +463,18 @@ int FilterIsoParametrization::postCondition(const QAction* /*filter*/ ) const
|
||||
return MeshModel::MM_WEDGTEXCOORD | MeshModel::MM_VERTTEXCOORD;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterIsoParametrization::filterArity(const QAction* filter) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterIsoParametrization::filterArity(const QAction* filter) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
case ISOP_PARAM :
|
||||
case ISOP_REMESHING :
|
||||
case ISOP_DIAMPARAM :
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case ISOP_TRANSFER:
|
||||
return MeshFilterInterface::FIXED;
|
||||
return FilterPluginInterface::FIXED;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -29,13 +29,13 @@
|
||||
#include <diamond_sampler.h>
|
||||
#include <diam_parametrization.h>
|
||||
#include <stat_remeshing.h>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterIsoParametrization : public QObject, public MeshFilterInterface
|
||||
class FilterIsoParametrization : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {ISOP_PARAM,
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
|
||||
#include<vcg/complex/append.h>
|
||||
#include <QImageReader>
|
||||
#include <QDir>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
|
||||
|
||||
@ -849,18 +851,18 @@ FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(const QAction *a) con
|
||||
case FP_MESH_VISIBILITY :
|
||||
case FP_SPLITCONNECTED :
|
||||
case FP_DELETE_MESH :
|
||||
case FP_DELETE_NON_VISIBLE_MESH : return MeshFilterInterface::Layer;
|
||||
case FP_DELETE_NON_VISIBLE_MESH : return FilterPluginInterface::Layer;
|
||||
case FP_RENAME_RASTER :
|
||||
case FP_DELETE_RASTER :
|
||||
case FP_DELETE_NON_SELECTED_RASTER :
|
||||
case FP_EXPORT_CAMERAS: return MeshFilterInterface::RasterLayer;
|
||||
case FP_IMPORT_CAMERAS: return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::RasterLayer);
|
||||
case FP_EXPORT_CAMERAS: return FilterPluginInterface::RasterLayer;
|
||||
case FP_IMPORT_CAMERAS: return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::RasterLayer);
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction* filter) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction* filter) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
@ -872,18 +874,18 @@ MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction*
|
||||
case FP_SELECTCURRENT :
|
||||
case FP_SPLITCONNECTED :
|
||||
case FP_DELETE_MESH :
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case FP_RENAME_RASTER :
|
||||
case FP_DELETE_RASTER :
|
||||
case FP_DELETE_NON_SELECTED_RASTER :
|
||||
case FP_EXPORT_CAMERAS:
|
||||
case FP_IMPORT_CAMERAS:
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
case FP_FLATTEN :
|
||||
case FP_DELETE_NON_VISIBLE_MESH :
|
||||
return MeshFilterInterface::VARIABLE;
|
||||
return FilterPluginInterface::VARIABLE;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
int FilterLayerPlugin::postCondition(const QAction* filter) const
|
||||
@ -909,7 +911,7 @@ int FilterLayerPlugin::postCondition(const QAction* filter) const
|
||||
|
||||
default: assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
MESHLAB_PLUGIN_NAME_EXPORTER(FilterLayerPlugin)
|
||||
|
||||
@ -26,13 +26,13 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterLayerPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterLayerPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -127,10 +127,10 @@ QString FilterMeasurePlugin::filterName(FilterIDType filterId) const
|
||||
|
||||
FilterMeasurePlugin::FilterClass FilterMeasurePlugin::getClass(const QAction *) const
|
||||
{
|
||||
return MeshFilterInterface::Measure;
|
||||
return FilterPluginInterface::Measure;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(const QAction*) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(const QAction*) const
|
||||
{
|
||||
return SINGLE_MESH;
|
||||
}
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
#ifndef FILTER_MEASURE_H
|
||||
#define FILTER_MEASURE_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterMeasurePlugin : public QObject, public MeshFilterInterface
|
||||
class FilterMeasurePlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -133,7 +133,7 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction
|
||||
case FP_FAUX_CREASE :
|
||||
case FP_FAUX_EXTRACT :
|
||||
case FP_VATTR_SEAM :
|
||||
case FP_REFINE_LS3_LOOP : return MeshFilterInterface::Remeshing;
|
||||
case FP_REFINE_LS3_LOOP : return FilterPluginInterface::Remeshing;
|
||||
case FP_REFINE_CATMULL :
|
||||
case FP_REFINE_HALF_CATMULL :
|
||||
case FP_QUAD_DOMINANT :
|
||||
@ -150,7 +150,7 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction
|
||||
case FP_CENTER :
|
||||
case FP_SCALE :
|
||||
case FP_PRINCIPAL_AXIS :
|
||||
case FP_FLIP_AND_SWAP : return MeshFilterInterface::Normal;
|
||||
case FP_FLIP_AND_SWAP : return FilterPluginInterface::Normal;
|
||||
|
||||
case FP_COMPUTE_PRINC_CURV_DIR : return FilterClass( Normal + VertexColoring );
|
||||
|
||||
@ -162,12 +162,12 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction
|
||||
|
||||
case FP_PERIMETER_POLYLINE :
|
||||
case FP_SLICE_WITH_A_PLANE :
|
||||
case FP_CYLINDER_UNWRAP : return MeshFilterInterface::Measure;
|
||||
case FP_CYLINDER_UNWRAP : return FilterPluginInterface::Measure;
|
||||
|
||||
default : assert(0); return MeshFilterInterface::Generic;
|
||||
default : assert(0); return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
int ExtraMeshFilterPlugin::getPreCondition(QAction *filter) const
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
#ifndef EXTRAFILTERSPLUGIN_H
|
||||
#define EXTRAFILTERSPLUGIN_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface
|
||||
class ExtraMeshFilterPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
enum RefPlane { REF_CENTER,REF_MIN,REF_ORIG};
|
||||
|
||||
|
||||
@ -99,24 +99,24 @@ QString MlsPlugin::pluginName() const
|
||||
return QString("Filter Unknown");
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass MlsPlugin::getClass(const QAction *a) const
|
||||
FilterPluginInterface::FilterClass MlsPlugin::getClass(const QAction *a) const
|
||||
{
|
||||
int filterId = ID(a);
|
||||
|
||||
switch(filterId) {
|
||||
case FP_APSS_PROJECTION :
|
||||
case FP_RIMLS_PROJECTION : return FilterClass(MeshFilterInterface::PointSet + MeshFilterInterface::Smoothing);
|
||||
case FP_RIMLS_PROJECTION : return FilterClass(FilterPluginInterface::PointSet + FilterPluginInterface::Smoothing);
|
||||
case FP_APSS_AFRONT :
|
||||
case FP_RIMLS_AFRONT :
|
||||
case FP_APSS_MCUBE :
|
||||
case FP_RIMLS_MCUBE : return FilterClass(MeshFilterInterface::PointSet | MeshFilterInterface::Remeshing);
|
||||
case FP_RIMLS_MCUBE : return FilterClass(FilterPluginInterface::PointSet | FilterPluginInterface::Remeshing);
|
||||
case FP_APSS_COLORIZE :
|
||||
case FP_RIMLS_COLORIZE : return FilterClass(MeshFilterInterface::PointSet | MeshFilterInterface::VertexColoring);
|
||||
case FP_RADIUS_FROM_DENSITY : return MeshFilterInterface::PointSet;
|
||||
case FP_SELECT_SMALL_COMPONENTS : return MeshFilterInterface::Selection;
|
||||
case FP_RIMLS_COLORIZE : return FilterClass(FilterPluginInterface::PointSet | FilterPluginInterface::VertexColoring);
|
||||
case FP_RADIUS_FROM_DENSITY : return FilterPluginInterface::PointSet;
|
||||
case FP_SELECT_SMALL_COMPONENTS : return FilterPluginInterface::Selection;
|
||||
}
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
// Info() must return the longer string describing each filtering action
|
||||
|
||||
@ -26,13 +26,13 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class MlsPlugin : public QObject, public MeshFilterInterface
|
||||
class MlsPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -88,10 +88,10 @@ FilterMutualGlobal::FilterClass FilterMutualGlobal::getClass(const QAction *a) c
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_IMAGE_GLOBALIGN : return MeshFilterInterface::Camera;
|
||||
case FP_IMAGE_GLOBALIGN : return FilterPluginInterface::Camera;
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
// This function define the needed parameters for each filter. Return true if the filter has some parameters
|
||||
|
||||
@ -36,14 +36,14 @@ add sampleplugins
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include "alignset.h"
|
||||
|
||||
class FilterMutualGlobal : public QObject, public MeshFilterInterface
|
||||
class FilterMutualGlobal : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_IMAGE_GLOBALIGN} ;
|
||||
|
||||
@ -73,14 +73,14 @@ FilterMutualInfoPlugin::FilterClass FilterMutualInfoPlugin::getClass(const QActi
|
||||
{
|
||||
switch(ID(a)) {
|
||||
case FP_IMAGE_MUTUALINFO:
|
||||
return MeshFilterInterface::Camera;
|
||||
return FilterPluginInterface::Camera;
|
||||
default :
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(const QAction*) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(const QAction*) const
|
||||
{
|
||||
return SINGLE_MESH;
|
||||
}
|
||||
|
||||
@ -26,14 +26,14 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include "alignset.h"
|
||||
|
||||
class FilterMutualInfoPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterMutualInfoPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include <vcg/complex/algorithms/smooth.h>
|
||||
#include <vcg/complex/algorithms/create/plymc/plymc.h>
|
||||
#include <vcg/complex/algorithms/create/plymc/simplemeshprovider.h>
|
||||
#include <QTemporaryFile>
|
||||
|
||||
using namespace vcg;
|
||||
|
||||
@ -86,11 +87,11 @@ QString PlyMCPlugin::pluginName() const
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_PLYMC : return MeshFilterInterface::Remeshing;
|
||||
case FP_MC_SIMPLIFY : return MeshFilterInterface::Remeshing;
|
||||
case FP_PLYMC : return FilterPluginInterface::Remeshing;
|
||||
case FP_MC_SIMPLIFY : return FilterPluginInterface::Remeshing;
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
// This function define the needed parameters for each filter. Return true if the filter has some parameters
|
||||
@ -246,13 +247,13 @@ bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric
|
||||
return true;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY PlyMCPlugin::filterArity(const QAction * filter ) const
|
||||
FilterPluginInterface::FILTER_ARITY PlyMCPlugin::filterArity(const QAction * filter ) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
case FP_PLYMC : return MeshFilterInterface::VARIABLE;
|
||||
case FP_MC_SIMPLIFY : return MeshFilterInterface::SINGLE_MESH;
|
||||
default: return MeshFilterInterface::NONE;
|
||||
case FP_PLYMC : return FilterPluginInterface::VARIABLE;
|
||||
case FP_MC_SIMPLIFY : return FilterPluginInterface::SINGLE_MESH;
|
||||
default: return FilterPluginInterface::NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
#ifndef _FILTER_PLYMC_H_
|
||||
#define _FILTER_PLYMC_H_
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class PlyMCPlugin : public QObject, public MeshFilterInterface
|
||||
class PlyMCPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
@ -46,7 +46,7 @@ public:
|
||||
virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/);
|
||||
virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ;
|
||||
FilterClass getClass(const QAction* a) const;
|
||||
MeshFilterInterface::FILTER_ARITY filterArity(const QAction* filter) const;
|
||||
FilterPluginInterface::FILTER_ARITY filterArity(const QAction* filter) const;
|
||||
int postCondition(const QAction *filter) const;
|
||||
};
|
||||
|
||||
|
||||
@ -120,9 +120,9 @@ QString QhullPlugin::pluginName() const
|
||||
case FP_QHULL_DELAUNAY_TRIANGULATION :
|
||||
case FP_QHULL_VORONOI_FILTERING :
|
||||
case FP_QHULL_ALPHA_COMPLEX_AND_SHAPE:
|
||||
return FilterClass (MeshFilterInterface::Remeshing) ;
|
||||
return FilterClass (FilterPluginInterface::Remeshing) ;
|
||||
case FP_QHULL_VISIBLE_POINTS:
|
||||
return FilterClass (MeshFilterInterface::Selection + MeshFilterInterface::PointSet);
|
||||
return FilterClass (FilterPluginInterface::Selection + FilterPluginInterface::PointSet);
|
||||
default : assert(0);
|
||||
}
|
||||
return FilterClass(0);
|
||||
|
||||
@ -29,13 +29,13 @@ History
|
||||
#define QHULLFILTERSPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class QhullPlugin : public QObject, public MeshFilterInterface
|
||||
class QhullPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -69,12 +69,12 @@ QString QualityMapperFilter::pluginName() const
|
||||
return QString("");
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass QualityMapperFilter::getClass(const QAction *a) const
|
||||
FilterPluginInterface::FilterClass QualityMapperFilter::getClass(const QAction *a) const
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_QUALITY_MAPPER : return MeshFilterInterface::Quality;
|
||||
default : assert(0); return MeshFilterInterface::Generic;
|
||||
case FP_QUALITY_MAPPER : return FilterPluginInterface::Quality;
|
||||
default : assert(0); return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ FIRST RELEASE
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
#include "../edit_quality/common/transferfunction.h"
|
||||
#include <vcg/complex/algorithms/stat.h> // for ComputePerVertexQualityMinMax
|
||||
@ -55,11 +55,11 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class QualityMapperFilter : public QObject, public MeshFilterInterface
|
||||
class QualityMapperFilter : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
private:
|
||||
Frange _meshMinMaxQuality;
|
||||
|
||||
@ -87,10 +87,10 @@ FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(const QAction *a) c
|
||||
{
|
||||
switch(ID(a)) {
|
||||
case FP_MOVE_VERTEX :
|
||||
return MeshFilterInterface::Smoothing;
|
||||
return FilterPluginInterface::Smoothing;
|
||||
default :
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(const QAction *a) c
|
||||
* @brief FilterSamplePlugin::filterArity
|
||||
* @return
|
||||
*/
|
||||
MeshFilterInterface::FILTER_ARITY FilterSamplePlugin::filterArity(const QAction*) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterSamplePlugin::filterArity(const QAction*) const
|
||||
{
|
||||
return SINGLE_MESH;
|
||||
}
|
||||
|
||||
@ -39,13 +39,13 @@ add sampleplugins
|
||||
#ifndef FILTERSAMPLE_PLUGIN_H
|
||||
#define FILTERSAMPLE_PLUGIN_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterSamplePlugin : public QObject, public MeshFilterInterface
|
||||
class FilterSamplePlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_MOVE_VERTEX } ;
|
||||
|
||||
@ -72,7 +72,7 @@ QString ExtraSampleDynPlugin::filterName(FilterIDType filterId) const
|
||||
// The FilterClass describes in which generic class of filters it fits.
|
||||
// This choice affect the submenu in which each filter will be placed
|
||||
// In this case this sample belong to the class of filters that change the vertex colors
|
||||
MeshFilterInterface::FilterClass ExtraSampleDynPlugin::getClass(const QAction *) const { return MeshFilterInterface::VertexColoring; }
|
||||
FilterPluginInterface::FilterClass ExtraSampleDynPlugin::getClass(const QAction *) const { return FilterPluginInterface::VertexColoring; }
|
||||
|
||||
// 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
|
||||
|
||||
@ -26,13 +26,13 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class ExtraSampleDynPlugin : public QObject, public MeshFilterInterface
|
||||
class ExtraSampleDynPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_VERTEX_COLOR_NOISE } ;
|
||||
|
||||
@ -74,10 +74,10 @@ ExtraSampleGPUPlugin::FilterClass ExtraSampleGPUPlugin::getClass(const QAction *
|
||||
{
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_GPU_EXAMPLE: return MeshFilterInterface::RasterLayer; //should be generic, but better avoid it
|
||||
case FP_GPU_EXAMPLE: return FilterPluginInterface::RasterLayer; //should be generic, but better avoid it
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
// This function define the needed parameters for each filter. Return true if the filter has some parameters
|
||||
|
||||
@ -36,13 +36,13 @@ add sampleplugins
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class ExtraSampleGPUPlugin : public QObject, public MeshFilterInterface
|
||||
class ExtraSampleGPUPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_GPU_EXAMPLE } ;
|
||||
|
||||
@ -40,6 +40,8 @@ $Log: samplefilter.cpp,v $
|
||||
#include <vcg/complex/algorithms/geodesic.h>
|
||||
#include <vcg/complex/algorithms/voronoi_processing.h>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
|
||||
using namespace vcg;
|
||||
using namespace std;
|
||||
|
||||
@ -1356,7 +1358,7 @@ switch(ID(action))
|
||||
return true;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterDocSampling::getClass(const QAction *action) const
|
||||
FilterPluginInterface::FilterClass FilterDocSampling::getClass(const QAction *action) const
|
||||
{
|
||||
switch(ID(action))
|
||||
{
|
||||
@ -1372,8 +1374,8 @@ MeshFilterInterface::FilterClass FilterDocSampling::getClass(const QAction *acti
|
||||
case FP_TEXEL_SAMPLING : return FilterDocSampling::Sampling;
|
||||
case FP_UNIFORM_MESH_RESAMPLING: return FilterDocSampling::Remeshing;
|
||||
case FP_DISK_COLORING:
|
||||
case FP_VORONOI_COLORING: return MeshFilterInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::VertexColoring);
|
||||
case FP_POINTCLOUD_SIMPLIFICATION : return MeshFilterInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::PointSet);
|
||||
case FP_VORONOI_COLORING: return FilterPluginInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::VertexColoring);
|
||||
case FP_POINTCLOUD_SIMPLIFICATION : return FilterPluginInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::PointSet);
|
||||
default: assert(0);
|
||||
}
|
||||
return FilterClass(0);
|
||||
@ -1396,7 +1398,7 @@ int FilterDocSampling::postCondition(const QAction* a ) const
|
||||
return MeshModel::MM_ALL;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction * filter ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction * filter ) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
@ -1408,15 +1410,15 @@ MeshFilterInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction *
|
||||
case FP_REGULAR_RECURSIVE_SAMPLING :
|
||||
case FP_UNIFORM_MESH_RESAMPLING:
|
||||
case FP_POINTCLOUD_SIMPLIFICATION :
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case FP_DISTANCE_REFERENCE :
|
||||
case FP_HAUSDORFF_DISTANCE :
|
||||
case FP_POISSONDISK_SAMPLING :
|
||||
case FP_DISK_COLORING :
|
||||
case FP_VORONOI_COLORING :
|
||||
return MeshFilterInterface::FIXED;
|
||||
return FilterPluginInterface::FIXED;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
MESHLAB_PLUGIN_NAME_EXPORTER(FilterDocSampling)
|
||||
|
||||
@ -23,13 +23,13 @@
|
||||
#ifndef FILTERDOCSAMPLINGPLUGIN_H
|
||||
#define FILTERDOCSAMPLINGPLUGIN_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterDocSampling : public QObject, public MeshFilterInterface
|
||||
class FilterDocSampling : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -26,6 +26,10 @@
|
||||
#include <Psapi.h>
|
||||
#endif
|
||||
|
||||
#include <QDir>
|
||||
#include <QTemporaryDir>
|
||||
#include <QTemporaryFile>
|
||||
|
||||
#include "filter_screened_poisson.h"
|
||||
#include "poisson_utils.h"
|
||||
|
||||
@ -77,14 +81,14 @@ QString FilterScreenedPoissonPlugin::filterInfo(FilterIDType filter) const
|
||||
}
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterScreenedPoissonPlugin::getClass(const QAction* a) const
|
||||
FilterPluginInterface::FilterClass FilterScreenedPoissonPlugin::getClass(const QAction* a) const
|
||||
{
|
||||
if (ID(a) == FP_SCREENED_POISSON){
|
||||
return FilterScreenedPoissonPlugin::FilterClass(MeshFilterInterface::Remeshing);
|
||||
return FilterScreenedPoissonPlugin::FilterClass(FilterPluginInterface::Remeshing);
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,7 +227,7 @@ int FilterScreenedPoissonPlugin::postCondition(const QAction* filter) const
|
||||
}
|
||||
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterScreenedPoissonPlugin::filterArity(const QAction*) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterScreenedPoissonPlugin::filterArity(const QAction*) const
|
||||
{
|
||||
return VARIABLE;
|
||||
}
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
#ifndef SAMPLEFILTERSPLUGIN_H
|
||||
#define SAMPLEFILTERSPLUGIN_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterScreenedPoissonPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterScreenedPoissonPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
public:
|
||||
|
||||
enum {
|
||||
|
||||
@ -1095,9 +1095,9 @@ void SdfGpuPlugin::TraceRay(int peelingIteration,const Point3f& dir, MeshModel*
|
||||
checkGLError::debugInfo("Error during depth peeling");
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY SdfGpuPlugin::filterArity(const QAction *) const
|
||||
FilterPluginInterface::FILTER_ARITY SdfGpuPlugin::filterArity(const QAction *) const
|
||||
{
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
}
|
||||
|
||||
MESHLAB_PLUGIN_NAME_EXPORTER(SdfGpuPlugin)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
#include <gpuProgram.h>
|
||||
#include <framebufferObject.h>
|
||||
@ -11,11 +11,11 @@
|
||||
|
||||
enum ONPRIMITIVE{ON_VERTICES=0, ON_FACES=1};
|
||||
|
||||
class SdfGpuPlugin : public QObject, public MeshFilterInterface
|
||||
class SdfGpuPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
@ -31,7 +31,7 @@ public:
|
||||
|
||||
FilterClass getClass(const QAction *) const
|
||||
{
|
||||
return MeshFilterInterface::VertexColoring;
|
||||
return FilterPluginInterface::VertexColoring;
|
||||
}
|
||||
|
||||
FILTER_ARITY filterArity(const QAction* act) const;
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
* Q_EXPORT_PLUGIN(SdfPlugin)
|
||||
* \endcode
|
||||
*/
|
||||
class SingleMeshFilterInterface : public QObject, public MeshFilterInterface{
|
||||
class SingleMeshFilterInterface : public QObject, public FilterPluginInterface{
|
||||
|
||||
public:
|
||||
/**
|
||||
@ -80,7 +80,7 @@ public:
|
||||
* plugin to the bottom of the list.
|
||||
*/
|
||||
virtual FilterClass getClass() const{
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
#include <vcg/complex/algorithms/stat.h>
|
||||
#include <vcg/complex/algorithms/point_outlier.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
using namespace vcg;
|
||||
|
||||
// ERROR CHECKING UTILITY
|
||||
@ -649,18 +651,18 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md,
|
||||
return true;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(const QAction *action) const
|
||||
FilterPluginInterface::FilterClass SelectionFilterPlugin::getClass(const QAction *action) const
|
||||
{
|
||||
switch(ID(action))
|
||||
{
|
||||
case CP_SELFINTERSECT_SELECT: return FilterClass(MeshFilterInterface::Selection + MeshFilterInterface::Cleaning);
|
||||
case CP_SELFINTERSECT_SELECT: return FilterClass(FilterPluginInterface::Selection + FilterPluginInterface::Cleaning);
|
||||
|
||||
case CP_SELECT_TEXBORDER : return FilterClass(MeshFilterInterface::Selection + MeshFilterInterface::Texture);
|
||||
case CP_SELECT_TEXBORDER : return FilterClass(FilterPluginInterface::Selection + FilterPluginInterface::Texture);
|
||||
|
||||
case FP_SELECT_BY_FACE_QUALITY :
|
||||
case FP_SELECT_BY_VERT_QUALITY : return FilterClass(MeshFilterInterface::Selection + MeshFilterInterface::Quality);
|
||||
case FP_SELECT_BY_VERT_QUALITY : return FilterClass(FilterPluginInterface::Selection + FilterPluginInterface::Quality);
|
||||
|
||||
case FP_SELECTBYANGLE : return MeshFilterInterface::FilterClass(MeshFilterInterface::RangeMap + MeshFilterInterface::Selection);
|
||||
case FP_SELECTBYANGLE : return FilterPluginInterface::FilterClass(FilterPluginInterface::RangeMap + FilterPluginInterface::Selection);
|
||||
|
||||
case FP_SELECT_ALL :
|
||||
case FP_SELECT_NONE :
|
||||
@ -681,9 +683,9 @@ MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(const QAction *
|
||||
case FP_SELECT_OUTLIER:
|
||||
case FP_SELECT_BY_COLOR:
|
||||
case CP_SELECT_NON_MANIFOLD_VERTEX:
|
||||
case CP_SELECT_NON_MANIFOLD_FACE: return FilterClass(MeshFilterInterface::Selection);
|
||||
case CP_SELECT_NON_MANIFOLD_FACE: return FilterClass(FilterPluginInterface::Selection);
|
||||
}
|
||||
return MeshFilterInterface::Selection;
|
||||
return FilterPluginInterface::Selection;
|
||||
}
|
||||
|
||||
int SelectionFilterPlugin::getRequirements(const QAction *action)
|
||||
|
||||
@ -25,14 +25,14 @@
|
||||
#define FILTER_SELECT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
|
||||
class SelectionFilterPlugin : public QObject, public MeshFilterInterface
|
||||
class SelectionFilterPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QJSEngine>
|
||||
#include <QSettings>
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <wrap/io_trimesh/export_ply.h>
|
||||
#include "miniz.h"
|
||||
|
||||
@ -68,14 +71,14 @@ FilterSketchFabPlugin::FilterClass FilterSketchFabPlugin::getClass(const QAction
|
||||
{
|
||||
switch(ID(a)) {
|
||||
case FP_SKETCHFAB :
|
||||
return MeshFilterInterface::Smoothing;
|
||||
return FilterPluginInterface::Smoothing;
|
||||
default :
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(const QAction* a) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(const QAction* a) const
|
||||
{
|
||||
switch(ID(a)) {
|
||||
case FP_SKETCHFAB :
|
||||
|
||||
@ -24,14 +24,14 @@
|
||||
#ifndef FILTERSKETCHFAB_H
|
||||
#define FILTERSKETCHFAB_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <QHttpPart>
|
||||
|
||||
class FilterSketchFabPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterSketchFabPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum { FP_SKETCHFAB } ;
|
||||
|
||||
@ -153,9 +153,9 @@ int FilterSSynth::postCondition(const QAction* /*filter*/) const
|
||||
return MeshModel::MM_NONE;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FilterClass FilterSSynth::getClass(const QAction */*filter*/) const
|
||||
FilterPluginInterface::FilterClass FilterSSynth::getClass(const QAction */*filter*/) const
|
||||
{
|
||||
return MeshFilterInterface::MeshCreation;
|
||||
return FilterPluginInterface::MeshCreation;
|
||||
}
|
||||
|
||||
QList<IOPluginInterface::Format> FilterSSynth::importFormats() const
|
||||
|
||||
@ -27,14 +27,13 @@
|
||||
|
||||
|
||||
#include <QObject>
|
||||
#include <common/meshmodel.h>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <meshlabplugins/io_x3d/io_x3d.h>
|
||||
|
||||
class FilterSSynth : public QObject,public IOPluginInterface, public MeshFilterInterface{
|
||||
class FilterSSynth : public QObject,public IOPluginInterface, public FilterPluginInterface{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface IOPluginInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface IOPluginInterface)
|
||||
public:
|
||||
enum {CR_SSYNTH} ;
|
||||
|
||||
@ -58,7 +57,7 @@ public:
|
||||
void initPreOpenParameter(const QString &formatName, const QString &filename, RichParameterList &parlst);
|
||||
bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0);
|
||||
bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb, QWidget *parent);
|
||||
MeshFilterInterface::FILTER_ARITY filterArity(const QAction *) const {return NONE;}
|
||||
FilterPluginInterface::FILTER_ARITY filterArity(const QAction *) const {return NONE;}
|
||||
private:
|
||||
QString ssynth(QString grammar,int maxdepth,int seed,vcg::CallBackPos *cb);
|
||||
QString GetTemplate(int sphereres);
|
||||
|
||||
@ -165,11 +165,11 @@ FilterTexturePlugin::FilterClass FilterTexturePlugin::getClass(const QAction *a)
|
||||
case FP_PLANAR_MAPPING :
|
||||
case FP_SET_TEXTURE :
|
||||
case FP_COLOR_TO_TEXTURE :
|
||||
case FP_TRANSFER_TO_TEXTURE : return MeshFilterInterface::Texture;
|
||||
case FP_TEX_TO_VCOLOR_TRANSFER : return FilterClass(MeshFilterInterface::VertexColoring + MeshFilterInterface::Texture);
|
||||
case FP_TRANSFER_TO_TEXTURE : return FilterPluginInterface::Texture;
|
||||
case FP_TEX_TO_VCOLOR_TRANSFER : return FilterClass(FilterPluginInterface::VertexColoring + FilterPluginInterface::Texture);
|
||||
default : assert(0);
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
static QString extractFilenameWOExt(MeshModel* mm)
|
||||
@ -1109,7 +1109,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c
|
||||
return true;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction * filter ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction * filter ) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
@ -1120,12 +1120,12 @@ MeshFilterInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction
|
||||
case FP_PLANAR_MAPPING :
|
||||
case FP_SET_TEXTURE :
|
||||
case FP_COLOR_TO_TEXTURE :
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case FP_TRANSFER_TO_TEXTURE :
|
||||
case FP_TEX_TO_VCOLOR_TRANSFER :
|
||||
return MeshFilterInterface::FIXED;
|
||||
return FilterPluginInterface::FIXED;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -28,17 +28,17 @@
|
||||
#include <QObject>
|
||||
#include <QTime>
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
#include <vcg/complex/append.h>
|
||||
#include <vcg/complex/algorithms/attribute_seam.h>
|
||||
#include <vcg/complex/algorithms/point_sampling.h>
|
||||
#include <vcg/space/triangle2.h>
|
||||
|
||||
class FilterTexturePlugin : public QObject, public MeshFilterInterface
|
||||
class FilterTexturePlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -174,11 +174,11 @@ QString TriOptimizePlugin::pluginName() const
|
||||
TriOptimizePlugin::FilterClass TriOptimizePlugin::getClass(const QAction *action) const
|
||||
{
|
||||
switch(ID(action)) {
|
||||
case FP_PLANAR_EDGE_FLIP: return MeshFilterInterface::Remeshing;
|
||||
case FP_CURVATURE_EDGE_FLIP: return MeshFilterInterface::Remeshing;
|
||||
case FP_NEAR_LAPLACIAN_SMOOTH: return MeshFilterInterface::Smoothing;
|
||||
case FP_PLANAR_EDGE_FLIP: return FilterPluginInterface::Remeshing;
|
||||
case FP_CURVATURE_EDGE_FLIP: return FilterPluginInterface::Remeshing;
|
||||
case FP_NEAR_LAPLACIAN_SMOOTH: return FilterPluginInterface::Smoothing;
|
||||
}
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
|
||||
int TriOptimizePlugin::postCondition(const QAction *a) const
|
||||
|
||||
@ -25,13 +25,13 @@
|
||||
#define TRIOPTIMIZEFILTERSPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class TriOptimizePlugin : public QObject, public MeshFilterInterface
|
||||
class TriOptimizePlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -186,7 +186,7 @@ QString FilterUnsharp::filterInfo(FilterIDType filterId) const
|
||||
switch(ID(a))
|
||||
{
|
||||
case FP_CREASE_CUT :
|
||||
return MeshFilterInterface::FilterClass( MeshFilterInterface::Normal | MeshFilterInterface::Remeshing);
|
||||
return FilterPluginInterface::FilterClass( FilterPluginInterface::Normal | FilterPluginInterface::Remeshing);
|
||||
case FP_SD_LAPLACIAN_SMOOTH:
|
||||
case FP_HC_LAPLACIAN_SMOOTH:
|
||||
case FP_LAPLACIAN_SMOOTH:
|
||||
@ -200,20 +200,20 @@ QString FilterUnsharp::filterInfo(FilterIDType filterId) const
|
||||
case FP_UNSHARP_GEOMETRY:
|
||||
case FP_UNSHARP_QUALITY:
|
||||
case FP_LINEAR_MORPH :
|
||||
return MeshFilterInterface::Smoothing;
|
||||
return FilterPluginInterface::Smoothing;
|
||||
|
||||
case FP_UNSHARP_VERTEX_COLOR:
|
||||
return MeshFilterInterface::FilterClass( MeshFilterInterface::Smoothing | MeshFilterInterface::VertexColoring);
|
||||
return FilterPluginInterface::FilterClass( FilterPluginInterface::Smoothing | FilterPluginInterface::VertexColoring);
|
||||
|
||||
case FP_RECOMPUTE_FACE_NORMAL :
|
||||
case FP_RECOMPUTE_QUADFACE_NORMAL :
|
||||
case FP_RECOMPUTE_VERTEX_NORMAL :
|
||||
case FP_FACE_NORMAL_NORMALIZE:
|
||||
case FP_VERTEX_NORMAL_NORMALIZE:
|
||||
return MeshFilterInterface::Normal;
|
||||
case FP_SCALAR_HARMONIC_FIELD: return MeshFilterInterface::Remeshing;
|
||||
return FilterPluginInterface::Normal;
|
||||
case FP_SCALAR_HARMONIC_FIELD: return FilterPluginInterface::Remeshing;
|
||||
|
||||
default : return MeshFilterInterface::Generic;
|
||||
default : return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
int FilterUnsharp::getPreConditions(const QAction *a) const
|
||||
@ -785,7 +785,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R
|
||||
return true;
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * filter ) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * filter ) const
|
||||
{
|
||||
switch(ID(filter))
|
||||
{
|
||||
@ -809,11 +809,11 @@ MeshFilterInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * fil
|
||||
case FP_RECOMPUTE_FACE_NORMAL:
|
||||
case FP_RECOMPUTE_QUADFACE_NORMAL:
|
||||
case FP_SCALAR_HARMONIC_FIELD:
|
||||
return MeshFilterInterface::SINGLE_MESH;
|
||||
return FilterPluginInterface::SINGLE_MESH;
|
||||
case FP_LINEAR_MORPH :
|
||||
return MeshFilterInterface::FIXED;
|
||||
return FilterPluginInterface::FIXED;
|
||||
}
|
||||
return MeshFilterInterface::NONE;
|
||||
return FilterPluginInterface::NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,14 +24,14 @@
|
||||
#define FilterUnsharp_PLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
|
||||
class FilterUnsharp : public QObject, public MeshFilterInterface
|
||||
class FilterUnsharp : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
|
||||
@ -101,20 +101,20 @@ FilterVoronoiPlugin::FilterClass FilterVoronoiPlugin::getClass(const QAction* a)
|
||||
case VORONOI_SAMPLING :
|
||||
case VOLUME_SAMPLING:
|
||||
case VORONOI_SCAFFOLDING:
|
||||
return MeshFilterInterface::Sampling;
|
||||
return FilterPluginInterface::Sampling;
|
||||
case BUILD_SHELL:
|
||||
return MeshFilterInterface::Remeshing;
|
||||
return FilterPluginInterface::Remeshing;
|
||||
case CROSS_FIELD_CREATION:
|
||||
return MeshFilterInterface::Normal;
|
||||
return FilterPluginInterface::Normal;
|
||||
// case CROSS_FIELD_SMOOTHING:
|
||||
// return MeshFilterInterface::Smoothing;
|
||||
default :
|
||||
assert(0);
|
||||
return MeshFilterInterface::Generic;
|
||||
return FilterPluginInterface::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
MeshFilterInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(const QAction* a) const
|
||||
FilterPluginInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(const QAction* a) const
|
||||
{
|
||||
switch(ID(a)) {
|
||||
case VORONOI_SAMPLING :
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
#ifndef FILTER_VORONOI_H
|
||||
#define FILTER_VORONOI_H
|
||||
|
||||
#include <common/interfaces.h>
|
||||
#include <common/interfaces/filter_plugin_interface.h>
|
||||
|
||||
class FilterVoronoiPlugin : public QObject, public MeshFilterInterface
|
||||
class FilterVoronoiPlugin : public QObject, public FilterPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID)
|
||||
Q_INTERFACES(MeshFilterInterface)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(FilterPluginInterface)
|
||||
|
||||
public:
|
||||
enum {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
class ExtraMeshIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
class BaseMeshIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ namespace io {
|
||||
class BreMeshIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
class ColladaIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
class IOMPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
class ExpeIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
class JSONIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
public:
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
class PDBIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
class TriIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
class TxtIOPlugin : public QObject, public IOPluginInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID)
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID)
|
||||
Q_INTERFACES(IOPluginInterface)
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user