2013/8/7 Eric Greveson <eric@...3003...>:
- While I expect I'll be able to fix the current unstable behaviour
(occasional copying of topmost path's coords into bottom-most path during difference operations, for too-small paths that "fall through" the quantization grid), the whole requirement for quantization in livarot is a bit unsatisfactory. Longer-term, it might be nice to switch to a path-intersection algorithm without the quantization restriction, and that deals better with degenerate cases - perhaps something like the CGAL 2D intersection methods (http://www.cgal.org/Manual/beta/doc_html/cgal_manual/packages.html#part_VIII... I believe this part of CGAL is GPL licensed, is this an issue? Thoughts?
The main issues with CGAL are: 1. In many distributions, it has a hard dependency on Boost.Thread and Qt - we do not want these as dependencies. 2. It is written in a super-generic style and rather hard to use.
The best solution would be to fork the parts of CGAL that implement the boolops algorithms and integrate them within 2Geom.
When writing new code, I'd much prefer to use smart pointers, e.g.
{ std::unique_ptr<Thing> t(new Thing()); ... do stuff with t ... }
Obviously things like std::unique_ptr and std::shared_ptr require (part of) C++11. I note that parts of inkscape use boost::shared_ptr - is use of boost the way to go in this case, to keep support for older (non-C++11) compilers?
I think the use of C++11 was not discussed yet. It would definitely simplify a lot of things, though compiler support is not yet universal.
In 95% of cases you can use std::auto_ptr or boost::scoped_ptr instead. All header-only parts of Boost are already an accepted dependency. The only differences are the behavior when copying: 1) boost::scoped_ptr is noncopyable, 2) std::auto_ptr always transfers pointer ownership to the copy, 3) std::unique_ptr is noncopyable, but has an rvalue reference constructor that transfers ownership (so e.g. you can put it in a container).
Regards, Krzysztof