BaseInterface Class Reference

Interface class from which all plugins have to be created. More...

#include <OpenFlipper/BasePlugin/BaseInterface.hh>

Inheritance diagram for BaseInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~BaseInterface ()
 Destructor.

Private Slots

virtual void exit ()
virtual void noguiSupported ()
Initialization

virtual void initializePlugin ()
 Initialize Plugin.
virtual void pluginsInitialized ()
 Initialize Plugin step 2.

Object/View updates



virtual void slotObjectUpdated (int)
 An object has been updated by another plugin.
virtual void slotObjectUpdated (int, const UpdateType)
 An object has been updated by another plugin.
virtual void slotAllCleared ()
 Called if the whole scene is cleared.
virtual void slotObjectSelectionChanged (int)
 The active object has changed.
virtual void slotVisibilityChanged (int)
 An object has been shown or hidden.
virtual void slotObjectPropertiesChanged (int)
 Object properties have been changed.
virtual void slotViewChanged ()
 View has changed.
virtual void updateView ()
 Update current view in Main Application.
virtual void updatedObject (int)
 An object has been changed or added by this plugin.
virtual void updatedObject (int, const UpdateType)
 An object has been changed or added by this plugin.
virtual void nodeVisibilityChanged (int)
 A scenegraph node has been shown or hidden.

Plugin identification



virtual void setSlotDescription (QString, QString, QStringList, QStringList)
 Set a description for a public slot.
virtual QString name ()=0
 Return a name for the plugin.
virtual QString description ()=0
 Return a description of what the plugin is doing.
virtual QString version ()
 Return a version string for your plugin.

Detailed Description

Interface class from which all plugins have to be created.

You have to implement at least name and description for your plugin. All other functions and signals are optional. If you want to implement or use them just add them to your plugin header.

See Plugin Programming for a tutorial on plugin programming.

Also see Dataflow diagrams for a detailed overview of OpenFlipper's data flow and interface function calls.

Definition at line 73 of file BaseInterface.hh.


Member Function Documentation

virtual QString BaseInterface::description (  )  [pure virtual]

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implemented in MouseAndKeyPlugin, SimplePlugin, and SmootherPlugin.

Referenced by Core::loadPlugin().

virtual void BaseInterface::exit (  )  [inline, private, virtual, slot]

This function is called when the application exits or when your plugin is about to be unloaded. Here you can clean up your plugin, delete local variables...

Definition at line 268 of file BaseInterface.hh.

virtual void BaseInterface::initializePlugin (  )  [inline, private, virtual, slot]

Initialize Plugin.

This slot is called if the plugin is loaded and has to be initialized. All initialization stuff in this slot has to stay inside the plugin, no external signals are allowed here (and will be ignored). Don't create any objects via pluginfunctions here. Use the pluginsInitialized() slot for external initialization. After execution of this slot your plugin should be fully functional. Only gui elements may be uninitialized and should be created in pluginsInitialized().

Reimplemented in MouseAndKeyPlugin, and SmootherPlugin.

Definition at line 89 of file BaseInterface.hh.

virtual QString BaseInterface::name (  )  [pure virtual]

Return a name for the plugin.

This Function has to return the name of the plugin.

Implemented in MouseAndKeyPlugin, SimplePlugin, and SmootherPlugin.

Referenced by OptionsWidget::initKeyTree(), Core::loadPlugin(), CoreWidget::slotAddKeyMapping(), and Core::slotLoadPlugin().

virtual void BaseInterface::nodeVisibilityChanged ( int   )  [inline, virtual, signal]

A scenegraph node has been shown or hidden.

Emit this Signal, if you changed the visibility of a scenegraph node directly (not via object->show/hide). This is required to reset the near and far plane for the viewers to provide an optimal view. Use the id of the object the node is attached to or -1 if it is not connected to an object.

Definition at line 145 of file BaseInterface.hh.

virtual void BaseInterface::noguiSupported (  )  [inline, private, virtual, slot]

Using this function you can inform the core that your plugin can run without creating a widget. If your plugin does not implement this function, it will not be loaded in scripting mode without gui. You dont have to do anything in this function.

Definition at line 274 of file BaseInterface.hh.

virtual void BaseInterface::pluginsInitialized (  )  [inline, private, virtual, slot]

Initialize Plugin step 2.

This slot is called if all plugins are loaded and the core is ready. Here you can create objects, set Textures and everything which will involve signals to the core.

Reimplemented in MouseAndKeyPlugin.

Definition at line 96 of file BaseInterface.hh.

virtual void BaseInterface::setSlotDescription ( QString  ,
QString  ,
QStringList  ,
QStringList   
) [inline, virtual, signal]

Set a description for a public slot.

public slots of each plugin are automaticly available for scripting.
Use this Signal to add a description for your slot so that everyone knows what it is used for.

Parameters:
_slotName the name of the slot
_slotDescription a description for the slot
_parameters list of parameters
_descriptions list of descriptions for the parameters (_descriptions[i] corresponds to _parameters[i])

Definition at line 258 of file BaseInterface.hh.

virtual void BaseInterface::slotAllCleared (  )  [inline, private, virtual, slot]

Called if the whole scene is cleared.

This slot is called if the main application cleared the whole scene. No objects will remain in memory and all destructors of the objects are called before this signal is emitted.

Definition at line 180 of file BaseInterface.hh.

virtual void BaseInterface::slotObjectPropertiesChanged ( int   )  [inline, private, virtual, slot]

Object properties have been changed.

This slot is called if the object properties (e.g. name ) have changed The id of the object is given as a parameter. If multiple or all objects have changed, the id will be -1.

Definition at line 207 of file BaseInterface.hh.

virtual void BaseInterface::slotObjectSelectionChanged ( int   )  [inline, private, virtual, slot]

The active object has changed.

This slot is called by the main aplication if the currentselection of an object has changed.
This means that the selection of source / target objects has changed. Addisionally you get the id of the object that has been changed or -1 if all objects have been modified.

Definition at line 189 of file BaseInterface.hh.

virtual void BaseInterface::slotObjectUpdated ( int  ,
const   UpdateType 
) [inline, private, virtual, slot]

An object has been updated by another plugin.

This slot is called by the main aplication if the number or status of existing objects changed or if an existing object has been changed. This could mean, that objects are added or deleted or that an existing object with the given id has been modified. If you store local information about one of these Objects, you should check if its still valid!
Dont emit BaseInterface::updatedObject(int) in this slot as this causes an endless Loop!! You dont need to call updateView as the core triggers a redraw itself.

Parameters:
_identifier Identifier of the updated/new object or -1 if one is deleted.
_type the type states which part of the object (topology, selection, ..) had been updated

Definition at line 172 of file BaseInterface.hh.

virtual void BaseInterface::slotObjectUpdated ( int   )  [inline, private, virtual, slot]

An object has been updated by another plugin.

This slot is called by the main aplication if the number or status of existing objects changed or if an existing object has been changed. This could mean, that objects are added or deleted or that an existing object with the given id has been modified. If you store local information about one of these Objects, you should check if its still valid!
Dont emit BaseInterface::updatedObject(int) in this slot as this causes an endless Loop!! You dont need to call updateView as the core triggers a redraw itself.

Parameters:
_identifier Identifier of the updated/new object or -1 if one is deleted.

Definition at line 159 of file BaseInterface.hh.

virtual void BaseInterface::slotViewChanged (  )  [inline, private, virtual, slot]

View has changed.

This slot is called when the view in one of the viewers changed ( Viewing direction/viewer position ) !! Be carefull to not change the view in this slot !! !! This will of course lead to an endless loop !!

Definition at line 216 of file BaseInterface.hh.

virtual void BaseInterface::slotVisibilityChanged ( int   )  [inline, private, virtual, slot]

An object has been shown or hidden.

This slot is called if an objecct is shown or hidden. The id of the object is given as a parameter. If multiple or all objects have changed, the id will be -1.

Definition at line 198 of file BaseInterface.hh.

virtual void BaseInterface::updatedObject ( int  ,
const   UpdateType 
) [inline, virtual, signal]

An object has been changed or added by this plugin.

Emit this Signal, if you updated any part of an object.
If you changed the element itself (geometry, topology,..) you also have to emit this signal.
Dont emit this Signal in BaseInterface::slotObjectUpdated() as this causes an endless Loop!! Give the id of the new object as parameter or -1 if you updated all objects or deleted an object.

Parameters:
_identifier id of the object or -1 if refering to all or deleted objects.
_type the type states which part of the object (topology, selection, ..) has to be updated

Definition at line 136 of file BaseInterface.hh.

virtual void BaseInterface::updatedObject ( int   )  [inline, virtual, signal]

An object has been changed or added by this plugin.

Emit this Signal, if you updated any part of an object.
If you changed the element itself (geometry, topology,..) you also have to emit this signal.
Dont emit this Signal in BaseInterface::slotObjectUpdated() as this causes an endless Loop!! Give the id of the new object as parameter or -1 if you updated all objects or deleted an object.

The parameter has to be the id of the object or -1 if refering to all or deleted objects.

Reimplemented in MouseAndKeyPlugin, and SmootherPlugin.

Definition at line 124 of file BaseInterface.hh.

virtual void BaseInterface::updateView (  )  [inline, virtual, signal]

Update current view in Main Application.

Emit this Signal if the viewer widget in the main application should update the current view. If you do an updatedObject the core will trigger an update itself and you don't have to care about it.

Reimplemented in MouseAndKeyPlugin, and SmootherPlugin.

Definition at line 113 of file BaseInterface.hh.

virtual QString BaseInterface::version (  )  [inline, virtual, slot]

Return a version string for your plugin.

This function will be used to determin the current version of your plugin. Should have the form x.x.x ( you do not need to give that many subversions )

Reimplemented in MouseAndKeyPlugin, and SmootherPlugin.

Definition at line 244 of file BaseInterface.hh.

Referenced by Core::loadPlugin().


The documentation for this class was generated from the following file:
Generated on Wed Jun 23 11:35:56 2010 for DeveloperDocumentation by  doxygen 1.6.3