mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-19 19:14:42 +00:00
refactoring - std::list instead of QList for filter plugins
This commit is contained in:
parent
0c24af61e9
commit
bc8e586b3d
@ -134,36 +134,36 @@ else()
|
||||
meshlabplugins/filter_geodesic
|
||||
meshlabplugins/filter_sample_gpu
|
||||
meshlabplugins/filter_ao
|
||||
meshlabplugins/filter_camera
|
||||
#meshlabplugins/filter_camera
|
||||
meshlabplugins/filter_clean
|
||||
meshlabplugins/filter_color_projection
|
||||
meshlabplugins/filter_colorproc
|
||||
#meshlabplugins/filter_color_projection
|
||||
#meshlabplugins/filter_colorproc
|
||||
meshlabplugins/filter_create
|
||||
meshlabplugins/filter_csg
|
||||
meshlabplugins/filter_dirt
|
||||
meshlabplugins/filter_fractal
|
||||
meshlabplugins/filter_func
|
||||
meshlabplugins/filter_img_patch_param
|
||||
meshlabplugins/filter_isoparametrization
|
||||
meshlabplugins/filter_layer
|
||||
meshlabplugins/filter_measure
|
||||
meshlabplugins/filter_meshing
|
||||
meshlabplugins/filter_mls
|
||||
meshlabplugins/filter_mutualglobal
|
||||
meshlabplugins/filter_mutualinfo
|
||||
meshlabplugins/filter_plymc
|
||||
meshlabplugins/filter_qhull
|
||||
meshlabplugins/filter_quality
|
||||
meshlabplugins/filter_sampling
|
||||
meshlabplugins/filter_screened_poisson
|
||||
meshlabplugins/filter_sdfgpu
|
||||
meshlabplugins/filter_select
|
||||
meshlabplugins/filter_sketchfab
|
||||
meshlabplugins/filter_ssynth
|
||||
meshlabplugins/filter_texture
|
||||
meshlabplugins/filter_trioptimize
|
||||
meshlabplugins/filter_unsharp
|
||||
meshlabplugins/filter_voronoi
|
||||
#meshlabplugins/filter_csg
|
||||
#meshlabplugins/filter_dirt
|
||||
#meshlabplugins/filter_fractal
|
||||
#meshlabplugins/filter_func
|
||||
#meshlabplugins/filter_img_patch_param
|
||||
#meshlabplugins/filter_isoparametrization
|
||||
#meshlabplugins/filter_layer
|
||||
#meshlabplugins/filter_measure
|
||||
#meshlabplugins/filter_meshing
|
||||
#meshlabplugins/filter_mls
|
||||
#meshlabplugins/filter_mutualglobal
|
||||
#meshlabplugins/filter_mutualinfo
|
||||
#meshlabplugins/filter_plymc
|
||||
#meshlabplugins/filter_qhull
|
||||
#meshlabplugins/filter_quality
|
||||
#meshlabplugins/filter_sampling
|
||||
#meshlabplugins/filter_screened_poisson
|
||||
#meshlabplugins/filter_sdfgpu
|
||||
#meshlabplugins/filter_select
|
||||
#meshlabplugins/filter_sketchfab
|
||||
#meshlabplugins/filter_ssynth
|
||||
#meshlabplugins/filter_texture
|
||||
#meshlabplugins/filter_trioptimize
|
||||
#meshlabplugins/filter_unsharp
|
||||
#meshlabplugins/filter_voronoi
|
||||
|
||||
# Rendering and Decoration Plugins
|
||||
meshlabplugins/render_gdp
|
||||
|
||||
@ -33,10 +33,10 @@ void DecoratePlugin::initGlobalParameterList(const QAction* /*format*/, RichPara
|
||||
QAction* DecoratePlugin::action(QString name) const
|
||||
{
|
||||
QString n = name;
|
||||
foreach(QAction *tt, actions())
|
||||
for(QAction *tt : actions())
|
||||
if (name == this->decorationName(ID(tt))) return tt;
|
||||
n.replace("&","");
|
||||
foreach(QAction *tt, actions())
|
||||
for(QAction *tt : actions())
|
||||
if (n == this->decorationName(ID(tt))) return tt;
|
||||
|
||||
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name));
|
||||
|
||||
@ -219,8 +219,8 @@ public:
|
||||
virtual QAction* getFilterAction(ActionIDType filterID);
|
||||
virtual QAction* getFilterAction(const QString& idName);
|
||||
|
||||
virtual QList<QAction*> actions() const { return actionList; }
|
||||
virtual QList<ActionIDType> types() const { return typeList; }
|
||||
virtual std::list<QAction*> actions() const { return actionList; }
|
||||
virtual std::list<ActionIDType> types() const { return typeList; }
|
||||
|
||||
/**
|
||||
* @brief wrongActionCalled throws a MLException. Call this function whenever
|
||||
@ -241,9 +241,9 @@ protected:
|
||||
//
|
||||
|
||||
// The list of actions exported by the plugin. Each actions strictly corresponds to
|
||||
QList <QAction*> actionList;
|
||||
std::list <QAction*> actionList;
|
||||
|
||||
QList <ActionIDType> typeList;
|
||||
std::list <ActionIDType> typeList;
|
||||
};
|
||||
|
||||
#define FILTER_PLUGIN_IID "vcg.meshlab.FilterPlugin/1.0"
|
||||
|
||||
@ -110,8 +110,7 @@ pymeshlab::FunctionSet::FunctionSet(const PluginManager& pm)
|
||||
}
|
||||
|
||||
for (FilterPlugin* fp : pm.filterPluginIterator()){
|
||||
QList<QAction*> acts = fp->actions();
|
||||
for (QAction* act : acts) {
|
||||
for (QAction* act : fp->actions()) {
|
||||
QString originalFilterName = fp->filterName(act);
|
||||
QString description = fp->filterInfo(act);
|
||||
QString pythonFilterName = fp->pythonFilterName(act);
|
||||
|
||||
@ -45,11 +45,12 @@ static GLuint vs, fs, shdrID;
|
||||
|
||||
AmbientOcclusionPlugin::AmbientOcclusionPlugin()
|
||||
{
|
||||
typeList
|
||||
<< FP_AMBIENT_OCCLUSION;
|
||||
typeList = {
|
||||
FP_AMBIENT_OCCLUSION
|
||||
};
|
||||
|
||||
foreach(ActionIDType tt , types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
for(ActionIDType tt : types())
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
|
||||
init = false;
|
||||
useGPU = AMBOCC_USEGPU_BY_DEFAULT;
|
||||
|
||||
@ -37,29 +37,30 @@ int SnapVertexBorder(CMeshO &m, Scalarm threshold,vcg::CallBackPos * cb);
|
||||
|
||||
CleanFilter::CleanFilter()
|
||||
{
|
||||
typeList
|
||||
<< FP_BALL_PIVOTING
|
||||
<< FP_REMOVE_WRT_Q
|
||||
<< FP_REMOVE_ISOLATED_COMPLEXITY
|
||||
<< FP_REMOVE_ISOLATED_DIAMETER
|
||||
<< FP_REMOVE_TVERTEX_FLIP
|
||||
<< FP_REMOVE_TVERTEX_COLLAPSE
|
||||
<< FP_SNAP_MISMATCHED_BORDER
|
||||
<< FP_REMOVE_DUPLICATE_FACE
|
||||
<< FP_REMOVE_FOLD_FACE
|
||||
<< FP_REMOVE_NON_MANIF_EDGE
|
||||
<< FP_REMOVE_NON_MANIF_EDGE_SPLIT
|
||||
<< FP_REMOVE_NON_MANIF_VERT
|
||||
<< FP_REMOVE_UNREFERENCED_VERTEX
|
||||
<< FP_REMOVE_DUPLICATED_VERTEX
|
||||
<< FP_REMOVE_FACE_ZERO_AREA
|
||||
<< FP_MERGE_CLOSE_VERTEX
|
||||
<< FP_MERGE_WEDGE_TEX
|
||||
<< FP_COMPACT_FACE
|
||||
<< FP_COMPACT_VERT;
|
||||
typeList = {
|
||||
FP_BALL_PIVOTING,
|
||||
FP_REMOVE_WRT_Q,
|
||||
FP_REMOVE_ISOLATED_COMPLEXITY,
|
||||
FP_REMOVE_ISOLATED_DIAMETER,
|
||||
FP_REMOVE_TVERTEX_FLIP,
|
||||
FP_REMOVE_TVERTEX_COLLAPSE,
|
||||
FP_SNAP_MISMATCHED_BORDER,
|
||||
FP_REMOVE_DUPLICATE_FACE,
|
||||
FP_REMOVE_FOLD_FACE,
|
||||
FP_REMOVE_NON_MANIF_EDGE,
|
||||
FP_REMOVE_NON_MANIF_EDGE_SPLIT,
|
||||
FP_REMOVE_NON_MANIF_VERT,
|
||||
FP_REMOVE_UNREFERENCED_VERTEX,
|
||||
FP_REMOVE_DUPLICATED_VERTEX,
|
||||
FP_REMOVE_FACE_ZERO_AREA,
|
||||
FP_MERGE_CLOSE_VERTEX,
|
||||
FP_MERGE_WEDGE_TEX,
|
||||
FP_COMPACT_FACE,
|
||||
FP_COMPACT_VERT
|
||||
};
|
||||
|
||||
for(ActionIDType tt : types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
|
||||
QCoreApplication* app = QCoreApplication::instance();
|
||||
if (app != nullptr)
|
||||
@ -67,8 +68,6 @@ CleanFilter::CleanFilter()
|
||||
}
|
||||
|
||||
CleanFilter::~CleanFilter() {
|
||||
for (int i = 0; i < actionList.count() ; i++ )
|
||||
delete actionList.at(i);
|
||||
}
|
||||
|
||||
QString CleanFilter::pluginName() const
|
||||
|
||||
@ -35,13 +35,23 @@ using namespace tri;
|
||||
|
||||
FilterCreate::FilterCreate()
|
||||
{
|
||||
typeList << CR_BOX<< CR_ANNULUS << CR_SPHERE<< CR_SPHERE_CAP
|
||||
<< CR_RANDOM_SPHERE<< CR_ICOSAHEDRON<< CR_DODECAHEDRON
|
||||
<< CR_TETRAHEDRON<<CR_OCTAHEDRON<<CR_CONE<<CR_TORUS
|
||||
<< CR_FITPLANE;
|
||||
typeList = {
|
||||
CR_BOX,
|
||||
CR_ANNULUS,
|
||||
CR_SPHERE,
|
||||
CR_SPHERE_CAP,
|
||||
CR_RANDOM_SPHERE,
|
||||
CR_ICOSAHEDRON,
|
||||
CR_DODECAHEDRON,
|
||||
CR_TETRAHEDRON,
|
||||
CR_OCTAHEDRON,
|
||||
CR_CONE,
|
||||
CR_TORUS,
|
||||
CR_FITPLANE
|
||||
};
|
||||
|
||||
foreach(ActionIDType tt , types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
for(ActionIDType tt : types())
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
}
|
||||
|
||||
QString FilterCreate::pluginName() const
|
||||
|
||||
@ -41,17 +41,14 @@ using namespace vcg;
|
||||
|
||||
FilterCreateIso::FilterCreateIso()
|
||||
{
|
||||
typeList << FP_CREATEISO;
|
||||
typeList = {FP_CREATEISO};
|
||||
|
||||
ActionIDType tt;
|
||||
foreach(tt , types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
for(ActionIDType tt : types())
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
|
||||
}
|
||||
|
||||
FilterCreateIso::~FilterCreateIso() {
|
||||
for (int i = 0; i < actionList.count() ; i++ )
|
||||
delete actionList.at(i);
|
||||
}
|
||||
|
||||
QString FilterCreateIso::pluginName() const
|
||||
|
||||
@ -41,18 +41,17 @@ using namespace vcg;
|
||||
|
||||
FilterGeodesic::FilterGeodesic()
|
||||
{
|
||||
typeList << FP_QUALITY_BORDER_GEODESIC
|
||||
<< FP_QUALITY_POINT_GEODESIC
|
||||
<< FP_QUALITY_SELECTED_GEODESIC;
|
||||
typeList = {
|
||||
FP_QUALITY_BORDER_GEODESIC,
|
||||
FP_QUALITY_POINT_GEODESIC,
|
||||
FP_QUALITY_SELECTED_GEODESIC
|
||||
};
|
||||
|
||||
ActionIDType tt;
|
||||
foreach(tt , types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
for(ActionIDType tt : types())
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
}
|
||||
|
||||
FilterGeodesic::~FilterGeodesic() {
|
||||
for (int i = 0; i < actionList.count() ; i++ )
|
||||
delete actionList.at(i);
|
||||
}
|
||||
|
||||
QString FilterGeodesic::pluginName() const
|
||||
|
||||
@ -26,14 +26,19 @@
|
||||
/**
|
||||
* @brief Constructor usually performs only two simple tasks of filling the two lists
|
||||
* - typeList: with all the possible id of the filtering actions
|
||||
* - actionList with the corresponding actions. If you want to add icons to your filtering actions you can do here by construction the QActions accordingly
|
||||
* - actionList with the corresponding actions. If you want to add icons to
|
||||
* your filtering actions you can do here by construction the QActions accordingly
|
||||
*/
|
||||
FilterSamplePlugin::FilterSamplePlugin()
|
||||
{
|
||||
typeList << FP_MOVE_VERTEX;
|
||||
typeList = {FP_MOVE_VERTEX};
|
||||
|
||||
for(ActionIDType tt : types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
}
|
||||
|
||||
FilterSamplePlugin::~FilterSamplePlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QString FilterSamplePlugin::pluginName() const
|
||||
|
||||
@ -51,6 +51,7 @@ public:
|
||||
enum { FP_MOVE_VERTEX } ;
|
||||
|
||||
FilterSamplePlugin();
|
||||
virtual ~FilterSamplePlugin();
|
||||
|
||||
QString pluginName() const;
|
||||
|
||||
|
||||
@ -35,10 +35,14 @@ using namespace vcg;
|
||||
|
||||
ExtraSampleDynPlugin::ExtraSampleDynPlugin()
|
||||
{
|
||||
typeList << FP_VERTEX_COLOR_NOISE;
|
||||
typeList = {FP_VERTEX_COLOR_NOISE};
|
||||
|
||||
foreach(ActionIDType tt , types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
for(ActionIDType tt : types())
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
}
|
||||
|
||||
ExtraSampleDynPlugin::~ExtraSampleDynPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QString ExtraSampleDynPlugin::pluginName() const
|
||||
|
||||
@ -38,6 +38,7 @@ class ExtraSampleDynPlugin : public QObject, public FilterPlugin
|
||||
enum { FP_VERTEX_COLOR_NOISE } ;
|
||||
|
||||
ExtraSampleDynPlugin();
|
||||
virtual ~ExtraSampleDynPlugin();
|
||||
|
||||
QString pluginName() const;
|
||||
virtual QString filterName(ActionIDType filter) const;
|
||||
|
||||
@ -34,10 +34,10 @@ using namespace glw;
|
||||
|
||||
ExtraSampleGPUPlugin::ExtraSampleGPUPlugin()
|
||||
{
|
||||
typeList << FP_GPU_EXAMPLE;
|
||||
typeList = {FP_GPU_EXAMPLE};
|
||||
|
||||
foreach(ActionIDType tt , types())
|
||||
actionList << new QAction(filterName(tt), this);
|
||||
for(ActionIDType tt : types())
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
}
|
||||
|
||||
QString ExtraSampleGPUPlugin::pluginName() const
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user