-
Notifications
You must be signed in to change notification settings - Fork 9
MeshLab Plugin Architecture
Note: these wiki pages are still a work in progress, and some pages may still be missing.
MeshLab is composed of the following components:
- meshlab: the actual MeshLab application which contains rendering and GUI functionalities;
- meshlab-plugins: a large set of independent plugins;
- meshlab-common: a library that provides common functionalities.
MeshLab plugins actually implement all the functionalities of meshlab: from loading the many different file formats, to simple filtering like cleaning and smoothing algorithms to complex interactive tools that directly act over the mesh under the control of the user like the painting tools or the alignment subsystem.
Each plugin focuses only on the functionality that implements, without taking care about GUI and (with the exception of some plugins types) rendering.
A MeshLab plugin is a library file (*.so
on Linux and MacOS, *.dll
on Windows). It could be of one or more of the following types:
-
Filter plugin: this is the most common (and easy to implement) type of plugin. Filter plugins allow to create or process one or multiple meshes in MeshLab. All the filters listed in the
Filters
menu of MeshLab are implemented in one of the loaded plugins; - IO plugin: this type of plugin allows to add one or more supported file formats for loading/saving meshes, rasters or projects into MeshLab;
-
Edit plugin: allows interacive editing of the mesh. All the edit plugins are listed in the
Edit
menu of MeshLab; -
Decorate plugin: this type of plugin allows to render read-only decorators about meshes or any other object; All the decorators are listed inside the
Render
menu. The only exception is theShaders
submenu, which is populated byRender
plugins; - Render plugin: allows to customize some rendering process of a mesh model (e.g. with openGL shaders).
A MeshLab plugin is generally a Qt Plugin class. To be loaded as a MeshLab plugin, a class should implement at least one of the abstract classes associated to the plugin types.
To develop a plugin is quite easy: you just need to inherit from (at least) one of the six base classes of the plugin types and implement some member functions that are required to make the plugin functional. As you can see in the above class scheme, all the plugins inherit from the MeshLabPluginFile
, that requires the implementation of two member functions:
QString vendor() const;
QString pluginName() const;
The vendor()
function should return the name of the organization/developer that developed the plugin, while the pluginName()
should return the just the name of the plugin. The other functions that need to be implemented depends on the type plugin that you want to develop.
For the list of all the other mandatory or optional member functions that a plugin can implement, please refer to the relative wiki of the plugin type.