Developer Documentation

Public Slots | Public Member Functions | List of all members
BaseInterface Class Referenceabstract

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

`#include <OpenFlipper/BasePlugin/BaseInterface.hh>`

Inheritance diagram for BaseInterface:

## Public Slots
virtual void | exit ()

## Public Member Functions
virtual void | noguiSupported ()
virtual | ~BaseInterface ()
| Destructor.

## Initialization
virtual void | initializePlugin ()
| Initialize Plugin. More...
virtual void | pluginsInitialized ()
| Initialize Plugin step 2. More...
virtual void | pluginsInitialized (QVector< QPair< QString, QString >> const &_pluginOptions)
| Initialize Plugin step 2 alternative. More...

## Object/View updates
virtual void | slotObjectUpdated (int _identifier)
| An object has been updated by another plugin. More...
virtual void | slotObjectUpdated (int _identifier, const UpdateType &_type)
| An object has been updated by another plugin. More...
virtual void | slotAllCleared ()
| Called if the whole scene is cleared. More...
virtual void | slotObjectSelectionChanged (int _identifier)
| The active object has changed. More...
virtual void | slotVisibilityChanged (int _identifier)
| An object has been shown or hidden. More...
virtual void | slotObjectPropertiesChanged (int _identifier)
| Object properties have been changed. More...
virtual void | slotViewChanged ()
| View has changed. More...
virtual void | slotSceneDrawn ()
| triggered after a scene has been drawn More...
virtual void | slotDrawModeChanged (int _viewerId)
| A viewer changed its draw mode. More...
virtual void | updateView ()
| Update current view in Main Application. More...
virtual void | blockScenegraphUpdates (bool _block)
| Tell the core to prevent scenegraph updates. More...
virtual void | updatedObject (int _objectId)
| An object has been changed or added by this plugin. More...
virtual void | updatedObject (int _identifier, const UpdateType &_type)
| An object has been changed or added by this plugin. More...
virtual void | nodeVisibilityChanged (int _identifier)
| A scenegraph node has been shown or hidden. More...

## Plugin identification
virtual void | setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
| Set a description for a public slot. More...
virtual QString | name ()=0
| Return a name for the plugin. More...
virtual QString | description ()=0
| Return a description of what the plugin is doing. More...
virtual QString | version ()
| Return a version string for your plugin. More...

## Renderer control
virtual void | setRenderer (unsigned int _viewer, QString _rendererName)
| Set a renderer for the given viewer. More...
virtual void | getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
| Get the current renderer for the given viewer. More...

## 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. A detailed description of this interface can be found in the Base Interface .

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 65 of file BaseInterface.hh.

## Member Function Documentation

## ◆ blockScenegraphUpdates()

virtual void BaseInterface::blockScenegraphUpdates | ( | bool | _block | ) |
| inline virtual

Tell the core to prevent scenegraph updates.

Emit this Signal if you want to skip scenegraph updates. E.g. if you add a large number of objects or modify them it's much more efficient to block scenegraph updates until you finished and then do only one update run.

The function itself is counting the number of blocks internally to allow multiple plugins for concurrent blocks. The function is queued to ensure that it is processed in line with load save operations.

Definition at line 133 of file BaseInterface.hh.

## ◆ description()

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 PolyLinePlugin, MeshObjectSelectionPlugin, MovePlugin, FileVTKPlugin, SplatCloudObjectSelectionPlugin, SkeletonEditingPlugin, DecimaterPlugin, TextureControlPlugin, VolumeMeshSelectionPlugin, PropertyVisPlugin, BSplineCurveSelectionPlugin, BSplineSurfaceSelectionPlugin, BackupPlugin, ObjectSelectionPlugin, PolyLineSelectionPlugin, SubdividerPlugin, FileOBJPlugin, TypeLightPlugin, SkeletalAnimationPlugin, DataControlPlugin, InfoMeshObjectPlugin, ViewControlPlugin, TypeSplatCloudPlugin, SmootherPlugin, FilePTSPlugin, ComponentsPlugin, FileOFFPlugin, InfoSkeletonObjectPlugin, IsotropicRemesherPlugin, RemesherPlugin, TypeBSplineCurvePlugin, TypeBSplineSurfacePlugin, FileBundlePlugin, FileOpenVolumeMeshPlugin, TypePolyhedralMeshPlugin, SplatCloudRenderingControlPlugin, HoleFillerPlugin, MeshRepairPlugin, TypeHexahedralMeshPlugin, TopologyPlugin, TypeTetrahedralMeshPlugin, FilePLYPlugin, ColorPlugin, DeserializeScreenshotMetadataPlugin, FileSTLPlugin, FileOMPlugin, SelectionBasePlugin, InfoVolumeMeshObjectPlugin, ScriptingPlugin, MeshComparePlugin, FileBVHPlugin, VsiPlugin, TypeSkeletonPlugin, MeanCurvaturePlugin, PrimitivesGeneratorPlugin, FilePolyLinePlugin, RulerPlugin, MaterialPicker, TypeCameraPlugin, MergePlugin, SmootherPlugin, FileSKLPlugin, FileSPHPlugin, FilePlaPlugin, TypePolyLinePlugin, FileHeightFieldPNGPlugin, TypeSpherePlugin, FileViewPlugin, TypePolyMeshPlugin, TypeTriangleMeshPlugin, TypePolyLineCollectionPlugin, TypeQtWidgetPlugin, MeshConvertPlugin, FileScriptPlugin, TypePlanePlugin, FileLightPlugin, GaussCurvaturePlugin, SlicePlugin, TypeCoordsysPlugin, INIPlugin, Renderer, LaplaceLengthPlugin, DepthPeeling, DepthPeelingPlugin, SSAOPlugin, Renderer, PrintPlugin, MemInfoPlugin, PluginAlignMeshes, TestPlugin, PostProcessorGrayscalePlugin, PostProcessorSobelPlugin, ToonRenderer, MouseAndKeyPlugin, PostProcessorDepthImagePlugin, NormalRenderer, PostProcessorAnaglyphPlugin, PostProcessorPhilipsStereoPlugin, RenderPickingPlugin, SmootherPlugin, and SimplePlugin.

## ◆ exit

virtual void BaseInterface::exit | ( |  | ) |
| inline 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...

Reimplemented in ComponentsPlugin.

Definition at line 337 of file BaseInterface.hh.

## ◆ getCurrentRenderer()

virtual void BaseInterface::getCurrentRenderer | ( | unsigned int | _viewer,
|  | QString & | _rendererName
| ) |  |
| inline virtual

Get the current renderer for the given viewer.

Parameters

  _viewer | Id of the viewer to set the renderer for
  _rendererName | Name of the renderer that is currently active

Definition at line 328 of file BaseInterface.hh.

## ◆ initializePlugin

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 FileVTKPlugin, FileOBJPlugin, FileOFFPlugin, HoleFillerPlugin, FileBVHPlugin, FileSTLPlugin, FilePLYPlugin, FilePolyLinePlugin, FileOMPlugin, FileSKLPlugin, FileSPHPlugin, FilePlaPlugin, FileViewPlugin, FileHeightFieldPNGPlugin, and FileLightPlugin.

Definition at line 83 of file BaseInterface.hh.

## ◆ name()

virtual QString BaseInterface::name | ( |  | ) |
| pure virtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implemented in PolyLinePlugin, MovePlugin, FileVTKPlugin, SplatCloudObjectSelectionPlugin, SkeletonEditingPlugin, TextureControlPlugin, DecimaterPlugin, VolumeMeshSelectionPlugin, PropertyVisPlugin, BackupPlugin, BSplineCurveSelectionPlugin, BSplineSurfaceSelectionPlugin, SubdividerPlugin, FileOBJPlugin, ObjectSelectionPlugin, PolyLineSelectionPlugin, TypeLightPlugin, SkeletalAnimationPlugin, DataControlPlugin, ViewControlPlugin, TypeSplatCloudPlugin, InfoMeshObjectPlugin, FilePTSPlugin, ComponentsPlugin, SmootherPlugin, FileOFFPlugin, IsotropicRemesherPlugin, InfoSkeletonObjectPlugin, RemesherPlugin, TypeBSplineCurvePlugin, TypeBSplineSurfacePlugin, FileBundlePlugin, SplatCloudRenderingControlPlugin, HoleFillerPlugin, FileOpenVolumeMeshPlugin, TopologyPlugin, TypePolyhedralMeshPlugin, MeshRepairPlugin, FilePLYPlugin, TypeHexahedralMeshPlugin, ColorPlugin, FileSTLPlugin, TypeTetrahedralMeshPlugin, FileOMPlugin, SelectionBasePlugin, DeserializeScreenshotMetadataPlugin, ScriptingPlugin, InfoVolumeMeshObjectPlugin, MeshComparePlugin, FileBVHPlugin, TypeSkeletonPlugin, VsiPlugin, MeanCurvaturePlugin, PrimitivesGeneratorPlugin, FilePolyLinePlugin, RulerPlugin, MaterialPicker, TypeCameraPlugin, MergePlugin, SmootherPlugin, FileSKLPlugin, FileSPHPlugin, FilePlaPlugin, TypePolyLinePlugin, FileHeightFieldPNGPlugin, TypeSpherePlugin, FileViewPlugin, TypePolyMeshPlugin, TypeTriangleMeshPlugin, TypePolyLineCollectionPlugin, TypeQtWidgetPlugin, MeshConvertPlugin, FileScriptPlugin, TypePlanePlugin, FileLightPlugin, GaussCurvaturePlugin, SlicePlugin, TypeCoordsysPlugin, Renderer, LaplaceLengthPlugin, DepthPeeling, DepthPeelingPlugin, SSAOPlugin, Renderer, PrintPlugin, MemInfoPlugin, PluginAlignMeshes, TestPlugin, PostProcessorGrayscalePlugin, PostProcessorSobelPlugin, ToonRenderer, MouseAndKeyPlugin, PostProcessorDepthImagePlugin, NormalRenderer, PostProcessorAnaglyphPlugin, PostProcessorPhilipsStereoPlugin, RenderPickingPlugin, SmootherPlugin, and SimplePlugin.

## ◆ nodeVisibilityChanged()

virtual void BaseInterface::nodeVisibilityChanged | ( | int | _identifier | ) |
| inline virtual

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 169 of file BaseInterface.hh.

## ◆ noguiSupported()

virtual void BaseInterface::noguiSupported | ( |  | ) |
| inline virtual

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 don't have to do anything in this function.

Reimplemented in RemesherPlugin, FileVTKPlugin, IsotropicRemesherPlugin, FileOBJPlugin, FileOFFPlugin, FileBVHPlugin, FileSTLPlugin, FilePLYPlugin, FilePolyLinePlugin, FileOMPlugin, FileSKLPlugin, FileSPHPlugin, FilePlaPlugin, FileViewPlugin, FileHeightFieldPNGPlugin, and FileLightPlugin.

Definition at line 343 of file BaseInterface.hh.

## ◆ pluginsInitialized() [1/2]

virtual void BaseInterface::pluginsInitialized | ( |  | ) |
| inline private virtual

Initialize Plugin step 2.

This slot is called if all plugins are loaded and the core is ready. Afterwards you can already send signals to other plugins and the core (e.g. adding global textures).

Note
  Do not create objects via addEmpty or load objects in this slot, as the rendering system is not ready yet.

Reimplemented in TypeLightPlugin, ComponentsPlugin, HoleFillerPlugin, and TypeCameraPlugin.

Definition at line 91 of file BaseInterface.hh.

## ◆ pluginsInitialized() [2/2]

virtual void BaseInterface::pluginsInitialized | ( | QVector< QPair< QString, QString >> const & | _pluginOptions | ) |
| inline private virtual

Initialize Plugin step 2 alternative.

This slot is similar to the vanilla version without parameters but additionally passes plugin command line options as key-value pairs. For passing command line options, use e.g.: OpenFlipper -o key1=value1 -p key2=value2 or OpenFlipper –pluginoptions key1=value1;key2=value2

Definition at line 101 of file BaseInterface.hh.

## ◆ setRenderer

virtual void BaseInterface::setRenderer | ( | unsigned int | _viewer,
|  | QString | _rendererName
| ) |  |
| inline virtual signal

Set a renderer for the given viewer.

Parameters

  _viewer | Id of the viewer to set the renderer for
  _rendererName | Name of the renderer to be used

Definition at line 321 of file BaseInterface.hh.

## ◆ setSlotDescription

virtual void BaseInterface::setSlotDescription | ( | QString | _slotName,
|  | QString | _slotDescription,
|  | QStringList | _parameters,
|  | QStringList | _descriptions
| ) |  |
| inline virtual signal

Set a description for a public slot.

public slots of each plugin are automatically 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 305 of file BaseInterface.hh.

## ◆ slotAllCleared()

virtual void BaseInterface::slotAllCleared | ( |  | ) |
| inline private virtual

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.

Reimplemented in TypeLightPlugin.

Definition at line 208 of file BaseInterface.hh.

## ◆ slotDrawModeChanged()

virtual void BaseInterface::slotDrawModeChanged | ( | int | _viewerId | ) |
| inline private virtual

A viewer changed its draw mode.

Parameters

  _viewerId | Id of the viewer that changed its draw mode

Definition at line 262 of file BaseInterface.hh.

## ◆ slotObjectPropertiesChanged()

virtual void BaseInterface::slotObjectPropertiesChanged | ( | int | _identifier | ) |
| inline private virtual

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 235 of file BaseInterface.hh.

## ◆ slotObjectSelectionChanged()

virtual void BaseInterface::slotObjectSelectionChanged | ( | int | _identifier | ) |
| inline private virtual

The active object has changed.

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

Definition at line 217 of file BaseInterface.hh.

## ◆ slotObjectUpdated [1/2]

virtual void BaseInterface::slotObjectUpdated | ( | int | _identifier | ) |
| inline private virtual slot

An object has been updated by another plugin.

This slot is called by the main application 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!
Don't emit BaseInterface::updatedObject(int) in this slot as this causes an endless Loop!! You don't need to call updateView as the core triggers a redraw itself.
This slot will be executed on the main thread.

Parameters

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

Definition at line 185 of file BaseInterface.hh.

## ◆ slotObjectUpdated() [2/2]

virtual void BaseInterface::slotObjectUpdated | ( | int | _identifier,
|  | const UpdateType & | _type
| ) |  |
| inline private virtual

An object has been updated by another plugin.

This slot is called by the main application 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!
Don't emit BaseInterface::updatedObject(int) in this slot as this causes an endless Loop!! You don't need to call updateView as the core triggers a redraw itself.
This slot will be executed on the main thread.

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 200 of file BaseInterface.hh.

## ◆ slotSceneDrawn()

virtual void BaseInterface::slotSceneDrawn | ( |  | ) |
| inline private virtual

triggered after a scene has been drawn

This slot will be triggered every time, the OpenGl draw of one frame is completed. Every time you emit an updateView, a scene redraw will be triggered (except, if the minimal time between two frames is not yet reached). After drawing the scene, the core will call this slot to inform the plugins, that a new view is visible.

You can use this slot, if you need to control special updates in your plugin, that react on the fps.

Definition at line 256 of file BaseInterface.hh.

## ◆ slotViewChanged()

virtual void BaseInterface::slotViewChanged | ( |  | ) |
| inline private virtual

View has changed.

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

Definition at line 244 of file BaseInterface.hh.

## ◆ slotVisibilityChanged()

virtual void BaseInterface::slotVisibilityChanged | ( | int | _identifier | ) |
| inline private virtual

An object has been shown or hidden.

This slot is called if an object 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 226 of file BaseInterface.hh.

## ◆ updatedObject() [1/2]

virtual void BaseInterface::updatedObject | ( | int | _objectId | ) |
| inline virtual

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.
Don't 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. For performance reasons try to always give the id and not -1!
This signal can be called from any thread.

Parameters

  _objectId | Id of the object or -1 if referring to all or deleted objects.

Definition at line 146 of file BaseInterface.hh.

## ◆ updatedObject() [2/2]

virtual void BaseInterface::updatedObject | ( | int | _identifier,
|  | const UpdateType & | _type
| ) |  |
| inline virtual

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.
Don't 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. For performance reasons try to always give the id and not -1!
This signal can be called from any thread.

Parameters

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

Definition at line 160 of file BaseInterface.hh.

## ◆ updateView

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.
This signal can be called from any thread.

Definition at line 122 of file BaseInterface.hh.

## ◆ version

virtual QString BaseInterface::version | ( |  | ) |
| inline virtual slot

Return a version string for your plugin.

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

Returns
  The version string of the plugin

Reimplemented in INIPlugin.

Definition at line 291 of file BaseInterface.hh.

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

- OpenFlipper/BasePlugin/BaseInterface.hh