From: Nathan H. <nj...@nj...> - 2014-06-16 10:19:15
|
On Mon, Jun 16, 2014 at 01:57:26AM +0200, Krzysztof Kosi??ski wrote: > 2014-06-16 0:01 GMT+02:00 Johan Engelen <jbc...@sw...>: > > Hi all, > > I am reading Modern C++ Design by Andrei Alexandrescu and already > > after the first few pages, I want to start work on 2geom that I've been > > thinking about for a while. Would like to hear your thoughts, > > encouragement or otherwise :-) ... > Furthermore, this would require changing many functions that take > Point to template functions taking Point<Coord>. We would effectively > need to lift most of 2Geom code into headers. Yes, I thought about this when we started, and mental and I discussed this at length. Here are the reasons against: * as Krzysztof says, templates mean everything must be on the compile path for everything. * More complex methods for everything * Ugly error messages * Minor performance cost * Slower compiles (a big issue for me - the slower the compile the slower the development) I couldn't think of any other compelling reasons for (especially when you consider that D2<T> does what you want). > > Point<double> is just the start. My endgoal is to be able to choose > > Path<CubicBezier>: a path for which all functions know that it is just a > > vector with CubicBeziers, allowing SIMD optimization of many operations > > on it. Instead of the Path<Curve> that we have now, that does not allow > > for any of that. > > This would be interesting. Path could also have a second parameter > specifying the underlying structure: vector, list or an > order-statistic tree. I suspect it would be hard to get useful optimisations this way. > Another interesting area of improvement would be to put the node-based > path representation from the node editor in 2Geom, though this would > need extra effort to decouple it from the display and event handling > code. Jaberto is thinking about this a little bit. Perhaps he could say something to this. njh |