mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 01:24:36 +00:00
first code sketch to support scripting engine
This commit is contained in:
parent
d74f494a66
commit
766c3faccf
@ -50,6 +50,7 @@ win32-msvc2008:CONFIG += staticlib
|
||||
QT += opengl
|
||||
QT += xml
|
||||
|
||||
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
|
||||
@ -43,7 +43,7 @@ class QTreeWidgetItem;
|
||||
class MeshModel;
|
||||
class RenderMode;
|
||||
class GLArea;
|
||||
|
||||
class QScriptEngine;
|
||||
|
||||
/** The MainWindowInterface class defines just the executeFilter() callback function
|
||||
that is invoked by the standard parameter input dialog.
|
||||
@ -339,6 +339,9 @@ public:
|
||||
*/
|
||||
virtual QTreeWidgetItem *tagDump(TagBase * /*tag*/, MeshDocument &/*md*/, MeshModel */*mm*/) {assert (0); return 0;}
|
||||
|
||||
|
||||
virtual void registerScriptProxyFunctions(QScriptEngine* eng) {};
|
||||
|
||||
virtual FilterIDType ID(QAction *a) const
|
||||
{
|
||||
foreach( FilterIDType tt, types())
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include "pluginmanager.h"
|
||||
#include <QtScript/QtScript>
|
||||
|
||||
PluginManager::PluginManager()
|
||||
{
|
||||
@ -8,7 +9,7 @@ PluginManager::PluginManager()
|
||||
//qApp->addLibraryPath(getBaseDirPath());
|
||||
}
|
||||
|
||||
void PluginManager::loadPlugins(RichParameterSet& defaultGlobal)
|
||||
void PluginManager::loadPlugins(RichParameterSet& defaultGlobal,QScriptEngine* eng)
|
||||
{
|
||||
pluginsDir=QDir(getPluginDirPath());
|
||||
// without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
|
||||
@ -41,6 +42,8 @@ void PluginManager::loadPlugins(RichParameterSet& defaultGlobal)
|
||||
actionFilterMap.insert(filterAction->text(),filterAction);
|
||||
stringFilterMap.insert(filterAction->text(),iFilter);
|
||||
iFilter->initGlobalParameterSet(filterAction,defaultGlobal);
|
||||
if (eng != NULL)
|
||||
iFilter->registerScriptProxyFunctions(eng);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#define PLUGINMANAGER_H
|
||||
|
||||
#include "interfaces.h"
|
||||
|
||||
class QScriptEngine;
|
||||
/**
|
||||
\brief This class provides the basic tools for managing all the plugins. It is used by both meshlab and meshlab server.
|
||||
*/
|
||||
@ -34,7 +34,7 @@ class PluginManager
|
||||
public:
|
||||
PluginManager();
|
||||
enum TypeIO{IMPORT,EXPORT};
|
||||
void loadPlugins(RichParameterSet& defaultGlobal);
|
||||
void loadPlugins(RichParameterSet& defaultGlobal,QScriptEngine* eng = NULL);
|
||||
|
||||
inline QVector<MeshIOInterface*>& meshIOPlugins() {return meshIOPlug;}
|
||||
inline QVector<MeshFilterInterface*>& meshFilterPlugins() {return meshFilterPlug;}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user