Developer Documentation
|
OpenFlipper uses QTs scripting system to provide scripting functions to the user and to the plugins. It also includes a batch mode where OpenFlipper is started without an user interface. All plugins which support this mode can than be controlled by command line supplied batch scripts without any user interaction.
The ScriptingInterface has several functions to support scripting.
If a scriptable slot is executed, it can add an entry to OpenFlippers script history. This history can later be used to rerun a process in batch mode ( ScriptInterface::scriptInfo() ).
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 ) )
)
Get Information about scriptable functions ( ScriptInterface::getAvailableFunctions(),ScriptInterface::getDescription() ).
The first function ( ScriptInterface::getAvailableFunctions() ) can be used to get a QStringlist of all available functions. Each string is of the form pluginname.functionname
The second function ( ScriptInterface::getDescription() ) can be used to get information about a function, if it was provided by the developer.
To use the ScriptInterface:
An easier interface to call functions is available by the RPC Interface. Additionally it is possible to connect signals and slots across plugins via the Plugin Connection Interface