|
Geometry : |
Subject: Re: [geometry] Run-Time specified geometries
From: Samuel Debionne (samuel.debionne_at_[hidden])
Date: 2013-10-25 11:58:51
> I've indeed started the work on variant awareness and migrated a few
> algorithms already. Spent more time on it these last few days. It
> involves some rework to make our algorithm resolution mechanism more
> structured and consistent across algorithms, in order to solve some of
> the challenges you were mentioning. Takes a bit of time but that's all
> going in a direction I like - discussed with Barend and he was also
> positive about it.
That's excellent news ! I think many people are looking for such a
functionality.
> To know which algorithms are migrated, just grep
> boost/geometry/algorithms for "resolve_variant".
For the records :
* append
* area
* buffer
* centroid
* clear
* convert
* convex_hull
* correct
* equals
* length
* num_points
> No API change is expected to happen once an algorithm is migrated (only
> internal refactorings will happen) so I assume you can safely start
> using those that are migrated even though it's not yet documented.
To give it a shot I try to add variant support to "distance" taking
"correct" as an example. Binary operation are more challenging since
support for combinations (variant, variant), (non-variant, variant),
(variant, non-variant) needs to be implemented. Moreover, if the variant
has 2d and 3d points, the dimension of both geometry must be checked to
be the same. That raise the question how to report runtime errors ?
Exception ?
> Regarding support_status: basically if you want to know if an algorithm
> is specialized for your geometry you just have to check whether
> boost::geometry::dispatch::your_algo<your geometries...> derives from
> not_yet_implemented, exactly like support_status.cpp does. BUT that
> doesn't work yet with variants. This is interesting BTW, as I hadn't
> realized that until I read this thread. I'll work on making this
> possible when all algorithms will be migrated.
Does that mean that we can dispatch incompatible variant to a runtime
error using not_yet_implemented ? That would be brilliant !
> Thanks Mateusz BTW for the very accurate history of the topic ;-)
+1 !
Samuel
Geometry list run by mateusz at loskot.net