2014-06-25 20:35 GMT+02:00 Johan Engelen <jbc.engelen@...2592...>:
Hi Krzysz, I was thinking about some Visitor pattern for traversing a Path's Curves, e.g. to get rid of all the dynamic_casting going on when converting curves to svgd. What do you think?
PathSink is a visitor object. We would only need to add a virtual method called sink(PathSink &) to each Curve. This looks like a good suggestion and would simplify the implementation of the methods that feed a path or pathvector to the sink.
BTW, 2Geom doesn't have any code to actually write svgd strings, only to parse them. There is such code in Inkscape, but it needs to be rewritten in terms of a PathSink and improved so that the last non-linear segment before a closepath command is always written out using absolute coordinates, to fix this bug: https://bugs.launchpad.net/inkscape/+bug/515237
Regards, Krzysztof