mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 08:09:39 +00:00
filter parametrization plugin draft
This commit is contained in:
parent
d9d9ed105c
commit
08b0eb5e7b
@ -172,6 +172,7 @@ if(NOT DEFINED MESHLAB_PLUGINS) # it may be already defined in parent directory
|
||||
meshlabplugins/filter_mls
|
||||
meshlabplugins/filter_mutualglobal
|
||||
meshlabplugins/filter_mutualinfo
|
||||
meshlabplugins/filter_parametrization
|
||||
meshlabplugins/filter_plymc
|
||||
meshlabplugins/filter_qhull
|
||||
meshlabplugins/filter_quality
|
||||
|
||||
7
src/meshlabplugins/filter_parametrization/CMakeLists.txt
Normal file
7
src/meshlabplugins/filter_parametrization/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council
|
||||
|
||||
set(SOURCES filter_parametrization.cpp)
|
||||
|
||||
set(HEADERS filter_parametrization.h)
|
||||
|
||||
add_meshlab_plugin(filter_parametrization ${SOURCES} ${HEADERS})
|
||||
@ -0,0 +1,121 @@
|
||||
/****************************************************************************
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005-2021 \/)\/ *
|
||||
* 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. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#include "filter_parametrization.h"
|
||||
|
||||
FilterParametrizationPlugin::FilterParametrizationPlugin()
|
||||
{
|
||||
typeList = { FP_HARMONIC_PARAM};
|
||||
|
||||
for(const ActionIDType& tt : typeList)
|
||||
actionList.push_back(new QAction(filterName(tt), this));
|
||||
}
|
||||
|
||||
QString FilterParametrizationPlugin::pluginName() const
|
||||
{
|
||||
return "FilterParametrization";
|
||||
}
|
||||
|
||||
QString FilterParametrizationPlugin::vendor() const
|
||||
{
|
||||
return "CNR-ISTI-VCLab";
|
||||
}
|
||||
|
||||
QString FilterParametrizationPlugin::filterName(ActionIDType filterId) const
|
||||
{
|
||||
switch(filterId) {
|
||||
case FP_HARMONIC_PARAM :
|
||||
return "Armonic Parametrization";
|
||||
default :
|
||||
assert(0);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
QString FilterParametrizationPlugin::filterInfo(ActionIDType filterId) const
|
||||
{
|
||||
switch(filterId) {
|
||||
case FP_HARMONIC_PARAM :
|
||||
return "";
|
||||
default :
|
||||
assert(0);
|
||||
return "Unknown Filter";
|
||||
}
|
||||
}
|
||||
|
||||
FilterParametrizationPlugin::FilterClass FilterParametrizationPlugin::getClass(const QAction *a) const
|
||||
{
|
||||
switch(ID(a)) {
|
||||
case FP_HARMONIC_PARAM :
|
||||
return FilterPlugin::Texture;
|
||||
default :
|
||||
assert(0);
|
||||
return FilterPlugin::Generic;
|
||||
}
|
||||
}
|
||||
|
||||
FilterPlugin::FilterArity FilterParametrizationPlugin::filterArity(const QAction*) const
|
||||
{
|
||||
return SINGLE_MESH;
|
||||
}
|
||||
|
||||
int FilterParametrizationPlugin::getPreConditions(const QAction*) const
|
||||
{
|
||||
return MeshModel::MM_NONE;
|
||||
}
|
||||
|
||||
int FilterParametrizationPlugin::postCondition(const QAction*) const
|
||||
{
|
||||
return MeshModel::MM_VERTTEXCOORD;
|
||||
}
|
||||
|
||||
RichParameterList FilterParametrizationPlugin::initParameterList(const QAction *action, const MeshModel &m)
|
||||
{
|
||||
RichParameterList parlst;
|
||||
switch(ID(action)) {
|
||||
case FP_HARMONIC_PARAM :
|
||||
break;
|
||||
default :
|
||||
assert(0);
|
||||
}
|
||||
return parlst;
|
||||
}
|
||||
|
||||
std::map<std::string, QVariant> FilterParametrizationPlugin::applyFilter(
|
||||
const QAction * action,
|
||||
const RichParameterList & par,
|
||||
MeshDocument &md,
|
||||
unsigned int& /*postConditionMask*/,
|
||||
vcg::CallBackPos *cb)
|
||||
{
|
||||
switch(ID(action)) {
|
||||
case FP_HARMONIC_PARAM :
|
||||
|
||||
break;
|
||||
default :
|
||||
wrongActionCalled(action);
|
||||
}
|
||||
return std::map<std::string, QVariant>();
|
||||
}
|
||||
|
||||
MESHLAB_PLUGIN_NAME_EXPORTER(FilterSamplePlugin)
|
||||
@ -0,0 +1,62 @@
|
||||
/****************************************************************************
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005-2021 \/)\/ *
|
||||
* 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_PARAMETRIZATION_PLUGIN_H
|
||||
#define MESHLAB_FILTER_PARAMETRIZATION_PLUGIN_H
|
||||
|
||||
#include <common/plugins/interfaces/filter_plugin.h>
|
||||
|
||||
class FilterParametrizationPlugin : public QObject, public FilterPlugin
|
||||
{
|
||||
//keep these three lines unchanged
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_IID)
|
||||
Q_INTERFACES(FilterPlugin)
|
||||
|
||||
public:
|
||||
//enum used to give an ID to every filter implemented in the plugin
|
||||
enum FileterIds {FP_HARMONIC_PARAM};
|
||||
|
||||
FilterParametrizationPlugin();
|
||||
|
||||
QString pluginName() const;
|
||||
QString vendor() const;
|
||||
|
||||
QString filterName(ActionIDType filter) const;
|
||||
QString filterInfo(ActionIDType filter) const;
|
||||
FilterClass getClass(const QAction* a) const;
|
||||
FilterArity filterArity(const QAction*) const;
|
||||
int getPreConditions(const QAction *) const;
|
||||
int postCondition(const QAction* ) const;
|
||||
RichParameterList initParameterList(const QAction*, const MeshModel &/*m*/);
|
||||
std::map<std::string, QVariant> applyFilter(
|
||||
const QAction* action,
|
||||
const RichParameterList & params,
|
||||
MeshDocument &md,
|
||||
unsigned int& postConditionMask,
|
||||
vcg::CallBackPos * cb);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif //MESHLAB_FILTER_PARAMETRIZATION_PLUGIN_H
|
||||
Loading…
x
Reference in New Issue
Block a user