
Geometry : 
Subject: [ggl] changes for consistency
From: Barend Gehrels (Barend.Gehrels)
Date: 20091021 10:03:48
Hi,
1) The access traits class has been modified to avoid indirection and to
be consistent with indexed_access. The change is that the Dimension
template parameter is now the second template parameter of the struct,
instead of a member template parameter of the set/get functions.
All point structures, registration macro's, tests and examples are
updated with this respect. Probably your code does not need to change.
However, if you specialized your traits class yourself, you have to change:
from: template <> struct access<mypoint> { template <int Dimension>
static double get(...) {...} /and also set/ };
to: template<std::size_t Dimension> struct access<mypoint, Dimension> {
static double get(...) {...} /and also set/ };
The old construct was rather old and could be a bit unhandy in case of
specializing for e.g. .x and .y. This needed earlier either an
'accessor', second specialized struct, or it could be implemented using
an if(Dimension == 0) etc, which is an inferior solution. The new
construct can be specialized per dimension, or for one dimension
forwarding to e.g. boost.tuples.
If there are any questions I'll be helpful.
2) For consistency, I propose also to modify the strategies to have an
"apply" method by default, instead of operator(). The operator() was to
enable functors (C functions) but they cannot be used anyway, in
(nearly) all cases, because there are type definitions expected by the
enclosing code. It was decided to have "apply" everywhere, so also here.
The simplifystrategy did not have an operator() but a method "simplify"
which is now also renamed to "apply" (besides some other enhancements)
3) Related to this I also added "concept checking" files for the
strategies (distance & simplify now).
4) simplify with an output iterator is now renamed to simplify_inserter
(like convex_hull_inserter, and like std::back_inserter). This also
solves the fact that it didn't work for linestringtolinestring, that
is working now again.
Besides all these I'm slowly adding tests and updating documentation.
Test and example folders have a Jamfile now (as expected) and can be
tested using bjam
Regards, Barend
 next part 
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20091021/16ed1320/attachment.html
Geometry list run by mateusz at loskot.net