Boost logo

Geometry :

Subject: Re: [geometry] Run-Time specified geometries
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-10-23 11:28:52


On 23 October 2013 08:58, Samuel Debionne
<samuel.debionne_at_[hidden]> wrote:
> Hello all,
> I'm wondering if someone is working on a runtime layer above the actual
> Boost.Geometry. Something in the same vein than GIL's dynamic images
> (any_views and algorithms that accept and dispatch such runtime/variant
> types).
>
> I have done a few experiments with Boost.Variant but before going on I
> would like to make sure that it's not already a work in progress.

As mentioned in this thread about WKB
(http://lists.boost.org/geometry/2013/07/2404.php),
variant or dynamic geometry type has been discussed some time ago.

We started the discussion based on some prototype for "any_geometry" I
made here:

https://github.com/mloskot/boost-geometry-workshop/blob/master/boost_geometry_any.cpp
https://github.com/mloskot/boost-geometry-workshop/blob/master/boost_geometry_any.cpp

Eventually, we agreed to use boost::variant and Bruno proposed it here:

http://svn.boost.org/svn/boost/trunk/boost/geometry/geometries/variant.hpp

In fact, variant geometry type in action is also presented in examples
for the spatial index:

http://www.boost.org/doc/libs/release/libs/geometry/doc/html/geometry/spatial_indexes/rtree_examples/index_of_iterators_of_a_map_storing_variant_geometries.html

So, this is work in progress, indeed.

> If we call dynamic algorithms, an overload that take dynamic geometries
> as inputs, the main difficulty I have encountered with dynamic
> algorithms is that there are instantiated with every possible type the
> variant can take. Some kind of filtering (e.g. types should have same
> dimensions) using traits and tag dispatching must be in place within the
> variant visitor. The other difficulty is with the return type that may
> depends on the input types, but no meta function (think result_of) is
> available.

Yes, so all possible instances need to be available.

> I found out that Bruno submitted some prototype. Is there a place
> (Wiki?) where we could write / discuss about it ?

There is Boost Wiki which I believe could be used for such discussion,
but AFAIK it requires a request for account.

IMHO, this can be discussed here on the mailing list.

Best regards,

-- 
Mateusz  Loskot, http://mateusz.loskot.net

Geometry list run by mateusz at loskot.net