MEPP2 Project
How to make a Qt visualization plugin out of an existing filter

MEPP2 provides a reference Qt plugin directory to be used as scafolding tool. The following describes the step by step process you should follow in order to easily "wrap" an given existing filter

Caveat emptor : in the following, mind the lowercase/uppercase difference between  <YourFilterName>  (as for directory name and class name) and the corresponding  <your_filter_name>  for file name and function name. This distinction is due to respect the coding style.

Directory/files creation

  • Copy the folder  Visualization/PluginFilters/Helloworld  to a new directory  Visualization/PluginFilters/<YourFilterName> .
  • Within  Visualization/PluginFilters/<YourFilterName>  directory and its  Dialogs  subdirectory rename the files  helloworld*  to  <your_filter_name>* 

Editing plugin files

Reminder : watch out case sensitivity.

  • Edit all files in  Visualization/PluginFilters/<YourFilterName>  directory and its  Dialogs  subdirectory
    • replace  <Helloworld>  by  <YourFilterName> 
    • replace  <helloworld>  by  <your_filter_name> 

Adding the new plugin to the plugins building list

  • add this line to the file  Visualization/PluginFilters/PluginFilters.cmake  (in alphabetical order please):
     include( "${CMAKE_CURRENT_LIST_DIR}/<YourFilterName>/<your_filter_name>.cmake" ) 

Call your filter from the plugin

  • Within  <YourFilterName>/<your_filter_name>_plugin.h 
    • find the comment line
        // A) include the header of the filter corresponding to your operation 
      and change the  #include  directive with the header of your filter
    • find the comment line
       // B) call the filter corresponding to your operation 
      and change the function call with the function call of your filter