MEPP2 Project
|
The recommended way for adding a new mesh processing filter is to duplicate the generic "HelloWorld" example that is located in the Examples/Generic/HelloWorld subdirectory. Because the HelloWorld example is generic, notice that the Examples/Generic/HelloWorld
only holds templated code.
This is in particular true for the template< typename MeshT > int helloworld_main(int argc, const char **argv)
function. That template function thus needs to be instantiated with a concrete (mesh) data type which is done e.g. in Examples/OpenMesh/helloworld_filter_openmesh.cpp for the OpenMesh data structure or in Examples/AIF/helloworld_filter_aif.cpp for the AIF data structure.
First duplicate the Examples/Generic/HelloWorld sub-directory (that implements a trivial Hello World filter) and rename it to e.g. MyExample . This goes:
Then proceed with editing the myexample_filter.hpp and myexample_main.hpp files and change every occurrence of helloworld to become myexample .
In opposition to the definition of a filter (that is generic over a concept based wrapper), a concrete example cannot be generic and requires the usage of a concrete mesh data structure.
Picking up the ad-hoc mesh data structure of course depends on your specific needs. For example, in addition to complying with some surface oriented concepts, your algorithm might also impose some (algorithmic) complexity constraints or the usage of some specific filter (mesh treatment) implementation that are only available for a specific implementation (i.e. some mesh data structure).
Hence you thus first need to collect your specific requirements in order to make the ad-hoc choice among the MEPP2 compatible mesh data structures. You thus get to choose among
For the purpose MyExample
(that has no known specific need) we are free to choose whatever mesh data structure available within MEPP2. We here (arbitrarily) choose to use the "Linear Cell Complex" implementation (a.k.a. CGAL-LCC).
Proceed with doing a similar process (copy and adapt) with the instantiated version of your newly created MyExample
generic code. That is
This task limits itself to editing the Examples/CGAL/LCC/CMakeLists.txt file to add this section at the end:
Your can now fold back to the build stage of the MEPP2 installation instructions. Because you want to build the CGAL-LCC example you will need to set cmake's BUILD_USE_CGAL
build flag to ON
.
When working on Linux or OSX, you should find the binary that you build within the Bin/Examples/CGAL/HelloWorld/
sub-directory of your building directory (here taken as being Bin
). In order to run it try something like
You might also find useful to walk around the FEVV/Filters
directory in order get acquainted with the available filters (and possibly read some code for further inspiration).
The Datastructure specific filter and plugin page gives some hints about writing data-structure specific (aka non-generic) filters and plugins.