MEPP2 Project
|
One may sometime need to write a filter that uses some unique feature of a specific datastructure. In this case the filter is datastructure specific. It can not be written in a generic way. This is easily feasible in MEPP2, and there is no runtime overhead compared to writing an independant datastructure-native code.
One must take care to not overuse this facility. The priority remains to write generic code.
To write a datastructure specific filter, simply use specific function/method calls in addition to the generic expressions allowed for generic filters.
Example:
The application must create the datastructure object, then call the filter. There is no restriction upon the datastructure definition, provided it belongs to one of the supported library (CGAL, OpenMesh, AIF, PCL). In particular, there is no limitation on the kernel that can be used with the datastructure.
Example:
A plugin must be written to be able to run the filter inside MEPP2 GUI. One must take care to the following points.
The datastructure kernel can no more be chosen by the user but is enforced by the GUI code, because the GUI is reponsible for creating the datastructure object.
As a consequence, to avoid compilation errors due to kernel issues, the datastructure used in the plugin and the filter must be one of those pre-defined for the GUI:
As the filter contains datastructure specific functions/methods calls, the plugin will fail to compile with other datastructures. In order to avoid compilation errors, the sections of the '..._plugin.h
' file (see How to make a Qt visualization plugin out of an existing filter) calling the 'applyHG()
' function with incompatible datastructures must be commented out.
Example: