The main purpose of a OpenMASK plugin is to add new features through new object classes (simulated objects, visual objects, animators, extensions,...) which are registered in factories and are available for the end user.
As plugins are dynamic libraries, they can be use as libraries or as plugins.
OM::PluginsLoader::getInstance().init( controller ) ;
#OpenMASK3 root { Class Controller UserParams { Plugins [ ["${OMK_HOME}/lib" "OMKAddOn"] ] ... } ... }
If the name is empty the path must include the complete path with the name. To find the complete path based on a path plus a name, the loader concats path and name like this (see also Plugin constructor):
Plugins [ ["${OMK_HOME}/lib" "OMKAddOn"] ]
Plugins [ ["${OMK_HOME}/lib/debug/OMKAddOn_d.dll"] ]
${OMK_HOME}
as the environment variable OMK_HOME. This is the best way to be platform independent. The first writing is better because it is also plaform independent.If the plugin needs more informations to be initialised, the user can add a configuration string to the plugin parameters, it will be passed as a parameter to the initialisation function of the plugin. The use is to give the path of a configuration file. To do that, the third parameter of the set must be set like this:
Plugins [ ["${OMK_HOME}/lib" "OMKAddOn" "../theConfiguration.cfg"] ]
Plugins [ ["${OMK_HOME}/lib/debug/OMKAddOn_d.dll" "" "../theConfiguration.cfg"] ]
The basic OpenMASK plugin which adds some objects classes in their factory is very easy to write.
You can see OMKPluginAddOn.cpp source file which is use as the interface of the AddOn plugin.
Documentation generated on Mon Jun 9 11:45:59 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |