mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-19 19:14:42 +00:00
FilterSelect uses new applyFilter call
This commit is contained in:
parent
7d45699c02
commit
7e69d37def
@ -157,7 +157,7 @@ else()
|
||||
meshlabplugins/filter_sampling
|
||||
meshlabplugins/filter_screened_poisson
|
||||
meshlabplugins/filter_sdfgpu
|
||||
# meshlabplugins/filter_select
|
||||
meshlabplugins/filter_select
|
||||
# meshlabplugins/filter_sketchfab
|
||||
# meshlabplugins/filter_ssynth
|
||||
# meshlabplugins/filter_texture
|
||||
|
||||
@ -78,7 +78,7 @@ SUBDIRS += \ #sub projects names
|
||||
filter_sampling \
|
||||
filter_screened_poisson \
|
||||
filter_sdfgpu \
|
||||
#filter_select \
|
||||
filter_select \
|
||||
#filter_sketchfab \
|
||||
#filter_ssynth \
|
||||
#filter_texture \
|
||||
|
||||
@ -303,11 +303,13 @@ void SelectionFilterPlugin::initParameterList(const QAction *action, MeshModel &
|
||||
}
|
||||
}
|
||||
|
||||
bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, std::map<std::string, QVariant>&, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * /*cb*/)
|
||||
std::map<std::string, QVariant> SelectionFilterPlugin::applyFilter(
|
||||
const QAction *action,
|
||||
const RichParameterList & par,
|
||||
MeshDocument &md,
|
||||
unsigned int& /*postConditionMask*/,
|
||||
vcg::CallBackPos * /*cb*/)
|
||||
{
|
||||
if (md.mm() == NULL)
|
||||
return false;
|
||||
|
||||
MeshModel &m=*(md.mm());
|
||||
CMeshO::FaceIterator fi;
|
||||
CMeshO::VertexIterator vi;
|
||||
@ -408,8 +410,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md,
|
||||
// if usecamera but mesh does not have one
|
||||
if( usecam && !m.hasDataMask(MeshModel::MM_CAMERA) )
|
||||
{
|
||||
errorMessage = "Mesh has not a camera that can be used to compute view direction. Please set a view direction."; // text
|
||||
return false;
|
||||
throw MLException("Mesh has not a camera that can be used to compute view direction. Please set a view direction.");
|
||||
}
|
||||
if(usecam)
|
||||
{
|
||||
@ -646,9 +647,10 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md,
|
||||
log("Selected %d outlier vertices", selVertexNum);
|
||||
} break;
|
||||
|
||||
default: assert(0);
|
||||
default:
|
||||
wrongActionCalled(action);
|
||||
}
|
||||
return true;
|
||||
return std::map<std::string, QVariant>();
|
||||
}
|
||||
|
||||
FilterPlugin::FilterClass SelectionFilterPlugin::getClass(const QAction *action) const
|
||||
|
||||
@ -33,53 +33,58 @@ class SelectionFilterPlugin : public QObject, public FilterPlugin
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_IID)
|
||||
Q_INTERFACES(FilterPlugin)
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
|
||||
public:
|
||||
/* naming convention :
|
||||
- FP -> Filter Plugin
|
||||
- name of the plugin separated by _
|
||||
*/
|
||||
enum {
|
||||
FP_SELECT_ALL,
|
||||
FP_SELECT_NONE,
|
||||
FP_SELECTBYANGLE,
|
||||
FP_SELECT_UGLY,
|
||||
FP_SELECT_INVERT,
|
||||
FP_SELECT_CONNECTED,
|
||||
FP_SELECT_FACE_FROM_VERT,
|
||||
FP_SELECT_VERT_FROM_FACE,
|
||||
FP_SELECT_DELETE_VERT,
|
||||
FP_SELECT_DELETE_ALL_FACE,
|
||||
FP_SELECT_DELETE_FACE,
|
||||
FP_SELECT_DELETE_FACEVERT,
|
||||
FP_SELECT_ERODE,
|
||||
FP_SELECT_DILATE,
|
||||
FP_SELECT_BORDER,
|
||||
FP_SELECT_BY_FACE_QUALITY,
|
||||
FP_SELECT_BY_VERT_QUALITY,
|
||||
FP_SELECT_BY_RANGE,
|
||||
FP_SELECT_BY_COLOR,CP_SELFINTERSECT_SELECT,
|
||||
CP_SELECT_TEXBORDER,
|
||||
CP_SELECT_NON_MANIFOLD_FACE,
|
||||
CP_SELECT_NON_MANIFOLD_VERTEX,
|
||||
FP_SELECT_FACES_BY_EDGE,
|
||||
FP_SELECT_FOLD_FACE,
|
||||
FP_SELECT_OUTLIER
|
||||
enum {
|
||||
FP_SELECT_ALL,
|
||||
FP_SELECT_NONE,
|
||||
FP_SELECTBYANGLE,
|
||||
FP_SELECT_UGLY,
|
||||
FP_SELECT_INVERT,
|
||||
FP_SELECT_CONNECTED,
|
||||
FP_SELECT_FACE_FROM_VERT,
|
||||
FP_SELECT_VERT_FROM_FACE,
|
||||
FP_SELECT_DELETE_VERT,
|
||||
FP_SELECT_DELETE_ALL_FACE,
|
||||
FP_SELECT_DELETE_FACE,
|
||||
FP_SELECT_DELETE_FACEVERT,
|
||||
FP_SELECT_ERODE,
|
||||
FP_SELECT_DILATE,
|
||||
FP_SELECT_BORDER,
|
||||
FP_SELECT_BY_FACE_QUALITY,
|
||||
FP_SELECT_BY_VERT_QUALITY,
|
||||
FP_SELECT_BY_RANGE,
|
||||
FP_SELECT_BY_COLOR,CP_SELFINTERSECT_SELECT,
|
||||
CP_SELECT_TEXBORDER,
|
||||
CP_SELECT_NON_MANIFOLD_FACE,
|
||||
CP_SELECT_NON_MANIFOLD_VERTEX,
|
||||
FP_SELECT_FACES_BY_EDGE,
|
||||
FP_SELECT_FOLD_FACE,
|
||||
FP_SELECT_OUTLIER
|
||||
} ;
|
||||
|
||||
SelectionFilterPlugin();
|
||||
//~SelectionFilterPlugin();
|
||||
QString pluginName() const;
|
||||
//~SelectionFilterPlugin();
|
||||
QString pluginName() const;
|
||||
virtual QString filterInfo(ActionIDType filter) const;
|
||||
virtual QString filterName(ActionIDType filter) const;
|
||||
|
||||
virtual FilterClass getClass(const QAction*) const;
|
||||
void initParameterList(const QAction* action, MeshModel &m, RichParameterList &parlst);
|
||||
int getPreConditions(const QAction*) const;
|
||||
int postCondition(const QAction* ) const;
|
||||
int getRequirements(const QAction*);
|
||||
bool applyFilter(const QAction* filter, MeshDocument &md, std::map<std::string, QVariant>& outputValues, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ;
|
||||
FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;}
|
||||
virtual QString filterName(ActionIDType filter) const;
|
||||
|
||||
virtual FilterClass getClass(const QAction*) const;
|
||||
void initParameterList(const QAction* action, MeshModel &m, RichParameterList &parlst);
|
||||
int getPreConditions(const QAction*) const;
|
||||
int postCondition(const QAction* ) const;
|
||||
int getRequirements(const QAction*);
|
||||
std::map<std::string, QVariant> applyFilter(
|
||||
const QAction* action,
|
||||
const RichParameterList & parameters,
|
||||
MeshDocument &md,
|
||||
unsigned int& postConditionMask,
|
||||
vcg::CallBackPos * cb);
|
||||
FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user