-
Notifications
You must be signed in to change notification settings - Fork 23
Creating Plugins
There are two basic types of plugins - tool plugin and object plugin. Object plugin is used to create a scene object, tool plugin to provide some functionality.
To better understand how plugins are created, go to the directory IbisPlugins and investigate its content.
E.g. LandmarkRegistrationObject is an object plugin, ImageFilterPlugin is a tool plugin.
Plugins may depend on other plugins. Take ImageFilterPlugin as example of a plugin that does not depend on other plugin, USManualCalibration es example of a plugin that does.
-
Create a subdirectory PluginName in the directory IbisPlugins
-
Go to directory PluginName
-
Create file declare-plugin.cmake with the following line:
not dependent on other plugin:
DeclarePlugin( PluginName NO DESCRIPTION "plugin description" )
depending on OtherPlugin:
DeclarePlugin( PluginName NO DEPENDS OtherPlugin DESCRIPTION "description" )
Use "YES" instead of "NO" if you want your plugin to be build by default.
-
Create class PluginNamePluginInterface. You have to derive it either from ToolPluginInterface or from ObjectPluginInterface. Check the headers to see which pure virtual functions you need to override.
-
Create CmakeLists.txt, see how it is done in existing plugins
set( PluginSrc pluginnameplugininterface.cpp ... )
set( PluginHdr pluginnameplugininterface.h ... )
set( PluginHdrMoc ... )
set( PluginUi *.ui )
DefinePlugin( "${PluginSrc}" "${PluginHdr}" "${PluginHdrMoc}" "${PluginUi}" )
If you want to develop a private plugin, create a subdirectory IbisPluginsExtra in directory ibis and put your plugin in IbisPluginsExtra.