BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.87k stars 128 forks source link

Making your own PSM? #24

Closed akrodger closed 2 years ago

akrodger commented 2 years ago

Hi, I find the Pluggable Software Module feature quite useful. I'd like to customize the Delaunay PSM to also include the features from the Restricted Voronoi Diagram implementation. Is there a straightforward way to go about this?

BrunoLevy commented 2 years ago

There is some documentation about PSMs here. It is in theory possible to create a PSM for Restricted Voronoi Diagram, but in practice it will pull a lot of classes: Delaunay plus Mesh plus Restricted Voronoi Diagram, the result will probably have hundreds thousand lines, and it is maybe not reasonable for a single-file library...

akrodger commented 2 years ago

Thank you for the prompt reply! I see, that does make sense. I did try to follow that documentation page and ended up with a file which was multiple MB. What about making a few PSMs in separate cpp files? For my purposes, it would also be acceptable to create a few .cpp files and a few .h files I can make into an archive named something like libdelaunay_custom.a out of the current Delaunay PSM, a new Mesh PSM, and a new RVD PSM. If you can provide some pointers on how to browse the documentation to find headers/sources for the mesh and RVD files which would need to go into a PSM for each, then I think this would work as an alternative. If possible, I would like to avoid using all of Geogram since it is much more functionality than I need.

BrunoLevy commented 2 years ago

The Mesh class (required by RVD) pulls a significant part of geogram as dependencies (for instance, the attributes subsystem, that pulls in turn some serialization etc...), so I do not think it will gain much as compared to compiling and linking with geogram (it is why I did not create a "Mesh_PSM"). Note that the compiled geogram lib does not weight more than 5 or 6 Mbs, and the graphic part is in a separate library (geogram_gfx).

akrodger commented 2 years ago

I see, this clarifies things for me. Thanks.