On Tue, 2008-11-25 at 08:26 +0100, Marco Steinacher wrote:
- Where would you ideally add the code for this feature? Currently I
have added four functions sp_remove_transparency*() to splivarot.cpp. I chose this file because of the relation to sp_selected_path_intersect(). Also, I have copied some code from sp_selected_path_boolop() to get the intersection shapes and I suggest to put the common code in a more generic boolean operation function in order to avoid duplicate code.
I would recommend subclassing Inkscape::Extention::Effect and putting it in it's own effect. Most of the internal effects live in /src/extensions/internal.
There are a few advantages of doing it this way. One, the code is very componentized so that as you work on it folks are unlikely to run into you. It creates the menu items, the verbs and all the GUI wrappers for you. All that you need to do is add the item to the menu skeleton and everything else is happy-happy. You also get live preview for free.
I would recommend leaving this as an effect rather than an output filter because I think it could have useful results for a variety of formats and also that it's likely an artist would want to tweak the results after the automatic script has run.
Cool stuff.
--Ted