Developer Documentation
ScriptInterface Class Reference

Interface for all Plugins which provide scriptable Functions. More...

#include <OpenFlipper/BasePlugin/ScriptInterface.hh>

Inheritance diagram for ScriptInterface:
BSplineCurveSelectionPlugin BSplineSurfaceSelectionPlugin ColorPlugin ComponentsPlugin DataControlPlugin DecimaterPlugin FileBundlePlugin FileBVHPlugin FileLightPlugin FileOBJPlugin FileOFFPlugin FileOMPlugin FileOpenVolumeMeshPlugin FilePlaPlugin FilePLYPlugin FilePolyLinePlugin FilePTSPlugin FileScriptPlugin FileSKLPlugin FileSPHPlugin FileSTLPlugin FileViewPlugin FileVTKPlugin HoleFillerPlugin INIPlugin IsotropicRemesherPlugin MergePlugin MeshComparePlugin MeshConvertPlugin MeshObjectSelectionPlugin MeshRepairPlugin MovePlugin ObjectSelectionPlugin PolyLinePlugin PolyLineSelectionPlugin PropertyVisPlugin RemesherPlugin ScriptingPlugin SelectionBasePlugin SkeletonEditingPlugin SmootherPlugin SmootherPlugin SplatCloudObjectSelectionPlugin SubdividerPlugin VolumeMeshConvertPlugin VolumeMeshSelectionPlugin VsiPlugin

Signals

Scripting History
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed. More...
 
Others
virtual void getScriptingEngine (QScriptEngine *&_engine)
 

Public Member Functions

virtual ~ScriptInterface ()
 Destructor.
 

Script execution

virtual void executeFileScript (QString _filename)
 
virtual void executeScript (QString _script)
 

Function Information

virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
virtual void getAvailableFunctions (QStringList &_functions)
 

Slots for a scripting control plugin like Plugin-Script

virtual void slotScriptInfo (QString _pluginName, QString _functionWithParameters)
 
virtual void slotExecuteScript (QString _script)
 
virtual void slotExecuteFileScript (QString _filename)
 

Detailed Description

Interface for all Plugins which provide scriptable Functions.

Detailed description

Definition at line 58 of file ScriptInterface.hh.

Member Function Documentation

◆ executeFileScript()

virtual void ScriptInterface::executeFileScript ( QString  _filename)
inlinevirtual

Emit this signal to execute a script from a file

Parameters
_filenameFilename of the script to execute

Definition at line 80 of file ScriptInterface.hh.

◆ executeScript

virtual void ScriptInterface::executeScript ( QString  _script)
inlinevirtualsignal

Emit this signal to execute a script

Parameters
_scriptThe script to execute

Definition at line 75 of file ScriptInterface.hh.

◆ getAvailableFunctions

virtual void ScriptInterface::getAvailableFunctions ( QStringList &  _functions)
inlinevirtualsignal

With this signal you can get a list of all available scripting functions

Parameters
_functionsAll available functions

Definition at line 94 of file ScriptInterface.hh.

◆ getDescription()

virtual void ScriptInterface::getDescription ( QString  _function,
QString &  _description,
QStringList &  _parameters,
QStringList &  _descriptions 
)
inlinevirtual

With this signal you can get descriptions about a given function if available

Parameters
_functionname of the function (e.g. plugin.function)
_descriptiona description for the function
_parameterslist of names for the parameters
_descriptionslist of descriptions for the parameters (_descriptions[i] corresponds to _parameters[i])

Definition at line 103 of file ScriptInterface.hh.

◆ getScriptingEngine

virtual void ScriptInterface::getScriptingEngine ( QScriptEngine *&  _engine)
inlinevirtualsignal

Emit this signal to get a reference to the core scripting engine

Parameters
_engineThe scripting Engine

Definition at line 146 of file ScriptInterface.hh.

◆ scriptInfo

virtual void ScriptInterface::scriptInfo ( QString  _functionWithParameters)
inlinevirtualsignal

Emit this signal if a scriptable function is executed.

e.g. selectAllVertices( ObjectId )

If you execute this function, you can append your functions to the script execution history in OpenFlipper. In this history OpenFlipper records operations that are scriptable. Later this list can be executed again and therefore reruns the recorded operations.

The following example code shows a function called translate in a plugin, that gets an ObjectId as a parameter. The plugin which emits this function will automatically be added in the history ( e.g.

move.translate( ObjectId , Vector(1 , 0 , 0 ) )

)

emit scriptInfo( "translate( ObjectId , Vector(1 , 0 , 0 ) )" );
Parameters
_functionWithParametersThe called function with all parameters

Definition at line 131 of file ScriptInterface.hh.

◆ slotExecuteFileScript()

virtual void ScriptInterface::slotExecuteFileScript ( QString  _filename)
inlineprivatevirtual

Slot for a scripting plugin. Gets the Script as a filename, opens and executes it.

Definition at line 175 of file ScriptInterface.hh.

◆ slotExecuteScript()

virtual void ScriptInterface::slotExecuteScript ( QString  _script)
inlineprivatevirtual

Slot for a scripting plugin. Gets the Script as QString and executes it.

Parameters
_scriptScript to execute as a QString

Definition at line 170 of file ScriptInterface.hh.

◆ slotScriptInfo

virtual void ScriptInterface::slotScriptInfo ( QString  _pluginName,
QString  _functionWithParameters 
)
inlineprivatevirtualslot

Slot for a scripting plugin. Gets the Script and executes it.

Parameters
_pluginNameName of the plugin that executed a scriptable function
_functionWithParametersName with parameters (values!) of the function to call.

Definition at line 163 of file ScriptInterface.hh.


The documentation for this class was generated from the following file: