decorate_plugin_interface.h and fix last commit

This commit is contained in:
alemuntoni 2020-09-18 15:17:15 +02:00
parent d7d9746936
commit 3f172b9f41
17 changed files with 208 additions and 161 deletions

View File

@ -48,6 +48,7 @@ HEADERS += \
filterscript.h \
GLLogStream.h \
interfaces.h \
interfaces/decorate_plugin_interface.h \
interfaces/filter_plugin_interface.h \
interfaces/io_plugin_interface.h \
interfaces/mainwindow_interface.h \

View File

@ -52,121 +52,6 @@ class GLAreaReg;
class MeshModel;
/**
MeshDecorateInterface is the base class of all <b> decorators </b>
Decorators are 'read-only' visualization aids that helps to show some data about a document.
Decorators can make some permesh precomputation but the rendering has to be efficient.
Decorators should save the additional data into per-mesh attribute.
There are two classes of Decorations
- PerMesh
- PerDocument
PerMesh Decorators are associated to each mesh/view
Some example of PerDocument Decorations
- backgrounds
- trackball icon
- axis
- shadows
- screen space Ambient occlusion (think it as a generic 'darkner')
Some example of PerMesh Decorations
- coloring of selected vertex/face
- displaying of normals/curvature directions
- display of specific tagging
*/
class MeshDecorateInterface : public PluginInterface
{
public:
/** The DecorationClass 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 DecorationClass
{
Generic = 0x00000, /*!< Should be avoided if possible. */ //
PerMesh = 0x00001, /*!< Decoration that are applied on a single mesh */
PerDocument = 0x00002, /*!< Decoration that are applied on a single mesh */
PreRendering = 0x00004, /*!< Decoration that are applied <i>before</i> the rendering of the document/mesh */
PostRendering = 0x00008 /*!< Decoration that are applied <i>after</i> the rendering of the document/mesh */
};
MeshDecorateInterface() : PluginInterface() {}
virtual ~MeshDecorateInterface() {}
/** The very short string (a few words) describing each filtering action
// This string is used also to define the menu entry
*/
virtual QString decorationName(FilterIDType) const = 0;
virtual QString decorationInfo(FilterIDType) const = 0;
virtual QString decorationName(QAction *a) const { return decorationName(ID(a)); }
virtual QString decorationInfo(QAction *a) const { return decorationInfo(ID(a)); }
virtual bool startDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; }
virtual bool startDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; }
virtual void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0;
virtual void decorateDoc(QAction *, MeshDocument &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0;
virtual void endDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) {}
virtual void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) {}
/** \brief tests if a decoration is applicable to a mesh.
* used only for PerMesh Decorators.
For instance curvature cannot be shown on a mesh without curvature.
On failure (returning false) the function fills the MissingItems list with strings describing the missing items.
It is invoked only for decoration of \i PerMesh class;
*/
virtual bool isDecorationApplicable(QAction *, const MeshModel&, QString&) const { return true; }
virtual int getDecorationClass(QAction *) const = 0;
virtual QList<QAction *> actions() const { return actionList; }
virtual QList<FilterIDType> types() const { return typeList; }
protected:
QList <QAction *> actionList;
QList <FilterIDType> typeList;
virtual FilterIDType ID(QAction *a) const
{
QString aa=a->text();
foreach(FilterIDType tt, types())
if (a->text() == this->decorationName(tt)) return tt;
aa.replace("&","");
foreach(FilterIDType tt, types())
if (aa == this->decorationName(tt)) return tt;
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text()));
assert(0);
return -1;
}
virtual FilterIDType ID(QString name) const
{
QString n = name;
foreach(FilterIDType tt, types())
if (name == this->decorationName(tt)) return tt;
n.replace("&","");
foreach(FilterIDType tt, types())
if (n == this->decorationName(tt)) return tt;
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name));
assert(0);
return -1;
}
public:
virtual QAction *action(QString name) const
{
QString n = name;
foreach(QAction *tt, actions())
if (name == this->decorationName(ID(tt))) return tt;
n.replace("&","");
foreach(QAction *tt, actions())
if (n == this->decorationName(ID(tt))) return tt;
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name));
return 0;
}
};
/*
@ -254,11 +139,9 @@ public:
#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x)
#define MESHLAB_PLUGIN_NAME_EXPORTER(x)
#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(MeshDecorateInterface, MESH_DECORATE_INTERFACE_IID)
Q_DECLARE_INTERFACE(MeshEditInterface, MESH_EDIT_INTERFACE_IID)
Q_DECLARE_INTERFACE(MeshEditInterfaceFactory, MESH_EDIT_INTERFACE_FACTORY_IID)

View File

@ -0,0 +1,153 @@
/****************************************************************************
* 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_DECORATE_PLUGIN_INTERFACE_H
#define MESHLAB_DECORATE_PLUGIN_INTERFACE_H
#include "plugin_interface.h"
class GLArea;
/**
MeshDecorateInterface is the base class of all <b> decorators </b>
Decorators are 'read-only' visualization aids that helps to show some data about a document.
Decorators can make some permesh precomputation but the rendering has to be efficient.
Decorators should save the additional data into per-mesh attribute.
There are two classes of Decorations
- PerMesh
- PerDocument
PerMesh Decorators are associated to each mesh/view
Some example of PerDocument Decorations
- backgrounds
- trackball icon
- axis
- shadows
- screen space Ambient occlusion (think it as a generic 'darkner')
Some example of PerMesh Decorations
- coloring of selected vertex/face
- displaying of normals/curvature directions
- display of specific tagging
*/
class DecoratePluginInterface : public PluginInterface
{
public:
/** The DecorationClass 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 DecorationClass
{
Generic = 0x00000, /*!< Should be avoided if possible. */ //
PerMesh = 0x00001, /*!< Decoration that are applied on a single mesh */
PerDocument = 0x00002, /*!< Decoration that are applied on a single mesh */
PreRendering = 0x00004, /*!< Decoration that are applied <i>before</i> the rendering of the document/mesh */
PostRendering = 0x00008 /*!< Decoration that are applied <i>after</i> the rendering of the document/mesh */
};
DecoratePluginInterface() : PluginInterface() {}
virtual ~DecoratePluginInterface() {}
/** The very short string (a few words) describing each filtering action
// This string is used also to define the menu entry
*/
virtual QString decorationName(FilterIDType) const = 0;
virtual QString decorationInfo(FilterIDType) const = 0;
virtual QString decorationName(QAction *a) const { return decorationName(ID(a)); }
virtual QString decorationInfo(QAction *a) const { return decorationInfo(ID(a)); }
virtual bool startDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; }
virtual bool startDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; }
virtual void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0;
virtual void decorateDoc(QAction *, MeshDocument &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0;
virtual void endDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) {}
virtual void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) {}
/** \brief tests if a decoration is applicable to a mesh.
* used only for PerMesh Decorators.
For instance curvature cannot be shown on a mesh without curvature.
On failure (returning false) the function fills the MissingItems list with strings describing the missing items.
It is invoked only for decoration of \i PerMesh class;
*/
virtual bool isDecorationApplicable(QAction *, const MeshModel&, QString&) const { return true; }
virtual int getDecorationClass(QAction *) const = 0;
virtual QList<QAction *> actions() const { return actionList; }
virtual QList<FilterIDType> types() const { return typeList; }
protected:
QList <QAction *> actionList;
QList <FilterIDType> typeList;
virtual FilterIDType ID(QAction *a) const
{
QString aa=a->text();
foreach(FilterIDType tt, types())
if (a->text() == this->decorationName(tt)) return tt;
aa.replace("&","");
foreach(FilterIDType tt, types())
if (aa == this->decorationName(tt)) return tt;
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text()));
assert(0);
return -1;
}
virtual FilterIDType ID(QString name) const
{
QString n = name;
foreach(FilterIDType tt, types())
if (name == this->decorationName(tt)) return tt;
n.replace("&","");
foreach(FilterIDType tt, types())
if (n == this->decorationName(tt)) return tt;
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name));
assert(0);
return -1;
}
public:
virtual QAction *action(QString name) const
{
QString n = name;
foreach(QAction *tt, actions())
if (name == this->decorationName(ID(tt))) return tt;
n.replace("&","");
foreach(QAction *tt, actions())
if (n == this->decorationName(ID(tt))) return tt;
qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name));
return 0;
}
};
#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x)
#define MESHLAB_PLUGIN_NAME_EXPORTER(x)
#define DECORATE_PLUGIN_INTERFACE_IID "vcg.meshlab.MeshDecorateInterface/1.0"
Q_DECLARE_INTERFACE(DecoratePluginInterface, DECORATE_PLUGIN_INTERFACE_IID)
#endif // MESHLAB_DECORATE_PLUGIN_INTERFACE_H

View File

@ -115,7 +115,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
iIO->initGlobalParameterSet(NULL, defaultGlobal);
}
MeshDecorateInterface *iDecorator = qobject_cast<MeshDecorateInterface *>(plugin);
DecoratePluginInterface *iDecorator = qobject_cast<DecoratePluginInterface *>(plugin);
if (iDecorator)
{
iCommon = iDecorator;
@ -160,9 +160,9 @@ int PluginManager::numberIOPlugins() const
}
// Search among all the decorator plugins the one that contains a decoration with the given name
MeshDecorateInterface *PluginManager::getDecoratorInterfaceByName(const QString& name)
DecoratePluginInterface *PluginManager::getDecoratorInterfaceByName(const QString& name)
{
foreach(MeshDecorateInterface *tt, this->meshDecoratePlugins())
foreach(DecoratePluginInterface *tt, this->meshDecoratePlugins())
{
foreach( QAction *ac, tt->actions())
if( name == tt->decorationName(ac) ) return tt;

View File

@ -28,6 +28,7 @@
#include "interfaces/filter_plugin_interface.h"
#include "interfaces/io_plugin_interface.h"
#include "interfaces/render_plugin_interface.h"
#include "interfaces/decorate_plugin_interface.h"
//#include "scriptsyntax.h"
#include<QMap>
@ -49,7 +50,7 @@ public:
int numberIOPlugins() const;
inline QVector<FilterPluginInterface*>& meshFilterPlugins() {return meshFilterPlug;}
inline QVector<RenderPluginInterface*>& meshRenderPlugins() {return meshRenderPlug;}
inline QVector<MeshDecorateInterface*>& meshDecoratePlugins() {return meshDecoratePlug;}
inline QVector<DecoratePluginInterface*>& meshDecoratePlugins() {return meshDecoratePlug;}
inline QVector<MeshEditInterfaceFactory*>& meshEditFactoryPlugins() {return meshEditInterfacePlug;}
static QString getDefaultPluginDirPath();
@ -57,7 +58,7 @@ public:
QMap<QString,RichParameterList> generateFilterParameterMap();
MeshDecorateInterface* getDecoratorInterfaceByName(const QString& name);
DecoratePluginInterface* getDecoratorInterfaceByName(const QString& name);
QMap<QString, QAction*> actionFilterMap;
@ -70,7 +71,7 @@ public:
QVector<IOPluginInterface*> meshIOPlug;
QVector<FilterPluginInterface*> meshFilterPlug;
QVector<RenderPluginInterface*> meshRenderPlug;
QVector<MeshDecorateInterface*> meshDecoratePlug;
QVector<DecoratePluginInterface*> meshDecoratePlug;
QVector<MeshEditInterfaceFactory*> meshEditInterfacePlug;
QVector<QAction *> editActionList;
QVector<QAction *> decoratorActionList;

View File

@ -484,7 +484,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/)
QList<QAction *>& tmpset = iPerMeshDecoratorsListMap[mp->id()];
for( QList<QAction *>::iterator it = tmpset.begin(); it != tmpset.end();++it)
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>((*it)->parent());
DecoratePluginInterface * decorInterface = qobject_cast<DecoratePluginInterface *>((*it)->parent());
decorInterface->decorateMesh(*it,*mp,this->glas.currentGlobalParamSet,this,&painter,md()->Log);
}
MLRenderingData meshdt;
@ -546,7 +546,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/)
QList<QAction *>& tmpset = iPerMeshDecoratorsListMap[mp->id()];
for (QList<QAction *>::iterator it = tmpset.begin(); it != tmpset.end(); ++it)
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>((*it)->parent());
DecoratePluginInterface * decorInterface = qobject_cast<DecoratePluginInterface *>((*it)->parent());
decorInterface->decorateMesh(*it, *mp, this->glas.currentGlobalParamSet, this, &painter, md()->Log);
}
}
@ -567,7 +567,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/)
foreach(QAction * p, iPerDocDecoratorlist)
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>(p->parent());
DecoratePluginInterface * decorInterface = qobject_cast<DecoratePluginInterface *>(p->parent());
decorInterface->decorateDoc(p, *this->md(), this->glas.currentGlobalParamSet, this, &painter, md()->Log);
}
@ -1065,7 +1065,7 @@ void GLArea::updateAllDecorators()
return;
foreach(QAction * p, iPerDocDecoratorlist)
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>(p->parent());
DecoratePluginInterface * decorInterface = qobject_cast<DecoratePluginInterface *>(p->parent());
decorInterface->endDecorate(p, *md(), this->glas.currentGlobalParamSet, this);
decorInterface->setLog(&md()->Log);
decorInterface->startDecorate(p, *md(), this->glas.currentGlobalParamSet, this);
@ -1151,7 +1151,7 @@ bool GLArea::readyToClose()
// Now manage the closing of the decorator set;
foreach(QAction* act, iPerDocDecoratorlist)
{
MeshDecorateInterface* mdec = qobject_cast<MeshDecorateInterface*>(act->parent());
DecoratePluginInterface* mdec = qobject_cast<DecoratePluginInterface*>(act->parent());
mdec->endDecorate(act,*md(),glas.currentGlobalParamSet,this);
mdec->setLog(NULL);
}
@ -1165,7 +1165,7 @@ bool GLArea::readyToClose()
for(QSet<QAction *>::iterator it = dectobeclose.begin();it != dectobeclose.end();++it)
{
MeshDecorateInterface* mdec = qobject_cast<MeshDecorateInterface*>((*it)->parent());
DecoratePluginInterface* mdec = qobject_cast<DecoratePluginInterface*>((*it)->parent());
if (mdec != NULL)
{
mdec->endDecorate(*it,*md(),glas.currentGlobalParamSet,this);
@ -1402,7 +1402,7 @@ void GLArea::toggleDecorator(QString name)
void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet)
{
makeCurrent();
MeshDecorateInterface *iDecorateTemp = this->mw()->PM.getDecoratorInterfaceByName(name);
DecoratePluginInterface *iDecorateTemp = this->mw()->PM.getDecoratorInterfaceByName(name);
if (!iDecorateTemp) {
this->Logf(GLLogStream::SYSTEM,"Could not get Decorate interface %s", qUtf8Printable(name));
this->Log(GLLogStream::SYSTEM,"Known decorate interfaces:");
@ -1415,7 +1415,7 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet)
}
QAction *action = iDecorateTemp->action(name);
if(iDecorateTemp->getDecorationClass(action)== MeshDecorateInterface::PerDocument)
if(iDecorateTemp->getDecorationClass(action)== DecoratePluginInterface::PerDocument)
{
bool found=this->iPerDocDecoratorlist.removeOne(action);
if(found)
@ -1441,7 +1441,7 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet)
}
}
if(iDecorateTemp->getDecorationClass(action)== MeshDecorateInterface::PerMesh)
if(iDecorateTemp->getDecorationClass(action)== DecoratePluginInterface::PerMesh)
{
MeshModel &currentMeshModel = *mm();
bool found=this->iCurPerMeshDecoratorList().removeOne(action);

View File

@ -37,6 +37,8 @@
#include <QTime>
#include <common/interfaces.h>
#include <common/interfaces/render_plugin_interface.h>
#include <common/interfaces/decorate_plugin_interface.h>
#include <common/ml_shared_data_context.h>
#include "glarea_setting.h"
#include "snapshotsetting.h"
@ -308,7 +310,7 @@ public slots:
MeshModel *m = md()->getMesh(i.key());
foreach(QAction *p, i.value())
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>(p->parent());
DecoratePluginInterface * decorInterface = qobject_cast<DecoratePluginInterface *>(p->parent());
decorInterface->endDecorate(p, *m, this->glas.currentGlobalParamSet, this);
decorInterface->setLog(&md()->Log);
decorInterface->startDecorate(p, *m, this->glas.currentGlobalParamSet, this);

View File

@ -893,7 +893,7 @@ void LayerDialog::updateDecoratorParsView()
ui->decParsTree->clear();
for(int ii = 0; ii < decList.size();++ii)
{
MeshDecorateInterface* decPlug = qobject_cast<MeshDecorateInterface *>(decList[ii]->parent());
DecoratePluginInterface* decPlug = qobject_cast<DecoratePluginInterface *>(decList[ii]->parent());
if (!decPlug)
{
mw->GLA()->Log(GLLogStream::SYSTEM,"MeshLab System Error: A Decorator Plugin has been expected.");
@ -1219,7 +1219,7 @@ void RasterTreeWidgetItem::updateVisibilityIcon( bool isvisible )
DecoratorParamsTreeWidget::DecoratorParamsTreeWidget(QAction* act,MainWindow *mw,QWidget* parent) :
QFrame(parent),mainWin(mw),frame(NULL),savebut(NULL),resetbut(NULL),loadbut(NULL),dialoglayout(NULL)
{
MeshDecorateInterface* decPlug = qobject_cast<MeshDecorateInterface *>(act->parent());
DecoratePluginInterface* decPlug = qobject_cast<DecoratePluginInterface *>(act->parent());
if (!decPlug) {
mw->GLA()->Log(GLLogStream::SYSTEM, "MeshLab System Error: A Decorator Plugin has been expected.");
}

View File

@ -42,7 +42,7 @@ class GLLogStream;
class MeshModel;
class RasterModel;
class MeshDocument;
class MeshDecorateInterface;
class DecoratePluginInterface;
class RichParameterListFrame;
class QGridLayout;
class QToolBar;

View File

@ -473,7 +473,7 @@ void MainWindow::createToolBars()
decoratorToolBar = addToolBar("Decorator");
foreach(MeshDecorateInterface *iDecorate, PM.meshDecoratePlugins())
foreach(DecoratePluginInterface *iDecorate, PM.meshDecoratePlugins())
{
foreach(QAction *decorateAction, iDecorate->actions())
{
@ -818,7 +818,7 @@ void MainWindow::fillFilterMenu()
void MainWindow::fillDecorateMenu()
{
foreach(MeshDecorateInterface *iDecorate, PM.meshDecoratePlugins())
foreach(DecoratePluginInterface *iDecorate, PM.meshDecoratePlugins())
{
foreach(QAction *decorateAction, iDecorate->actions())
{

View File

@ -1444,7 +1444,7 @@ void MainWindow::applyDecorateMode()
if(GLA()->mm() == 0) return;
QAction *action = qobject_cast<QAction *>(sender()); // find the action which has sent the signal
MeshDecorateInterface *iDecorateTemp = qobject_cast<MeshDecorateInterface *>(action->parent());
DecoratePluginInterface *iDecorateTemp = qobject_cast<DecoratePluginInterface *>(action->parent());
GLA()->toggleDecorator(iDecorateTemp->decorationName(action));

View File

@ -25,6 +25,9 @@
#include <common/interfaces.h>
#include <common/interfaces/filter_plugin_interface.h>
#include <common/interfaces/io_plugin_interface.h>
#include <common/interfaces/decorate_plugin_interface.h>
#include <common/interfaces/render_plugin_interface.h>
#include <QLabel>
#include <QTreeWidget>
@ -133,7 +136,7 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil
}
addItems(pluginItem,Templist);
}
MeshDecorateInterface *iDecorate = qobject_cast<MeshDecorateInterface *>(plugin);
DecoratePluginInterface *iDecorate = qobject_cast<DecoratePluginInterface *>(plugin);
if (iDecorate){
QStringList Templist;
foreach(QAction *a,iDecorate->actions()){Templist.push_back(a->text());}
@ -199,7 +202,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/)
if (actionName==formats) labelInfo->setText(f.description);
}
}
MeshDecorateInterface *iDecorate = qobject_cast<MeshDecorateInterface *>(plugin);
DecoratePluginInterface *iDecorate = qobject_cast<DecoratePluginInterface *>(plugin);
if (iDecorate)
{
foreach(QAction *a,iDecorate->actions())

View File

@ -34,14 +34,15 @@ New small samples
#include <QAction>
#include <QList>
#include <common/interfaces.h>
#include <common/interfaces/decorate_plugin_interface.h>
#include <common/ml_shared_data_context.h>
#include "cubemap.h"
class DecorateBackgroundPlugin : public QObject, public MeshDecorateInterface
class DecorateBackgroundPlugin : public QObject, public DecoratePluginInterface
{
Q_OBJECT
MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID)
Q_INTERFACES(MeshDecorateInterface)
MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID)
Q_INTERFACES(DecoratePluginInterface)
QString decorationName(FilterIDType id) const;
QString decorationInfo(FilterIDType id) const;
QString pluginName() const;
@ -72,7 +73,7 @@ DecorateBackgroundPlugin()
/*<< DP_SHOW_CUBEMAPPED_ENV*/
<< DP_SHOW_GRID;
foreach(FilterIDType tt , types()){
for(FilterIDType tt : types()){
actionList << new QAction(decorationName(tt), this);
if(tt==DP_SHOW_GRID)
actionList.last()->setIcon(QIcon(":/images/show_background_grid.png"));
@ -88,7 +89,7 @@ DecorateBackgroundPlugin()
void decorateDoc(QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &_log);
void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){}
void initGlobalParameterSet(QAction *, RichParameterList &/*globalparam*/);
int getDecorationClass(QAction * /*action*/) const { return MeshDecorateInterface::PerDocument; }
int getDecorationClass(QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; }
private:

View File

@ -24,7 +24,9 @@
#ifndef EXTRADECORATEPLUGIN_H
#define EXTRADECORATEPLUGIN_H
#include <common/interfaces.h>
#include <common/interfaces/decorate_plugin_interface.h>
#include <common/ml_shared_data_context.h>
#include <wrap/gui/coordinateframe.h>
#include "colorhistogram.h"
@ -33,11 +35,11 @@ typedef vcg::ColorHistogram<float> CHist;
typedef std::pair<Point3m,vcg::Color4b> PointPC; // this type is used to have a simple coord+color pair to rapidly draw non manifold faces
class DecorateBasePlugin : public QObject, public MeshDecorateInterface
class DecorateBasePlugin : public QObject, public DecoratePluginInterface
{
Q_OBJECT
MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID)
Q_INTERFACES(MeshDecorateInterface)
MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID)
Q_INTERFACES(DecoratePluginInterface)
QString decorationName(FilterIDType filter) const;
QString decorationInfo(FilterIDType filter) const;
QString pluginName() const;

View File

@ -27,18 +27,19 @@
#include <QObject>
#include <common/interfaces.h>
#include <common/interfaces/decorate_plugin_interface.h>
#include <common/ml_shared_data_context.h>
#include <common/meshmodel.h>
#include <wrap/glw/glw.h>
class DecorateRasterProjPlugin : public QObject, public MeshDecorateInterface
class DecorateRasterProjPlugin : public QObject, public DecoratePluginInterface
{
Q_OBJECT
MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID)
Q_INTERFACES( MeshDecorateInterface )
MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID)
Q_INTERFACES( DecoratePluginInterface )
// Types.

View File

@ -28,7 +28,7 @@
#include <cassert>
//#include <QObject>
#include <common/interfaces.h>
#include <common/interfaces/decorate_plugin_interface.h>
//#include <meshlab/glarea.h>

View File

@ -24,7 +24,7 @@
#define SAMPLE_DECORATE_PLUGIN_H
#include <QObject>
#include <common/interfaces.h>
#include <common/interfaces/decorate_plugin_interface.h>
#include "decorate_shader.h"
#include "shadow_mapping.h"
@ -32,11 +32,11 @@
#include "variance_shadow_mapping_blur.h"
#include "ssao.h"
class DecorateShadowPlugin : public QObject, public MeshDecorateInterface
class DecorateShadowPlugin : public QObject, public DecoratePluginInterface
{
Q_OBJECT
MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID)
Q_INTERFACES(MeshDecorateInterface)
MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID)
Q_INTERFACES(DecoratePluginInterface)
enum {
DP_SHOW_SHADOW,
@ -93,7 +93,7 @@ public:
void decorateDoc(QAction *a, MeshDocument &m, const RichParameterList*, GLArea *gla, QPainter *p, GLLogStream &);
void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *);
void initGlobalParameterSet(QAction *, RichParameterList & globalparam);
int getDecorationClass(QAction * /*action*/) const { return MeshDecorateInterface::PerDocument; }
int getDecorationClass(QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; }
private:
DecorateShader* smShader, *vsmShader, *vsmbShader;