Boost logo

Geometry :

Subject: [ggl] Polygon concept change and Boost.Polygon
From: Simonson, Lucanus J (lucanus.j.simonson)
Date: 2010-12-13 13:30:56


An iterator pair is a range, so there is no problem converting bewteen iterator and range semantics. Your issue seems to be that you want reference semantics. I'm not really concerned about the specific details of the polygon data types I provide, whether they supply access by reference to their internals or not, but rather the concept. It would be best if a general adaptor between any model of a Boost.Polygon polygon_concept_type can be adapted to the GGL polygon concept with the same code. That way we can write it once and make it work transparently.

I agree that solution 4 discussed in the blog is the best solution.

________________________________
From: ggl-bounces_at_[hidden] [mailto:ggl-bounces_at_[hidden]] On Behalf Of barend
Sent: Sunday, December 12, 2010 5:49 AM
To: ggl_at_[hidden]
Subject: [ggl] Polygon concept change and Boost.Polygon

hi list,

With respect to geometries, the namespace renaming I've doing (-> model::), and this point from the review results:

Concepts: more refinement needs to be done for the existing concepts. At
least 2 users claimed to not have been able to adapt their data structures
to the existing scheme.

... I have adapted several Boost.Polygon geometries to Boost.Geometry.

This needed thusfar one change in our concept, because we returned rings (parts of polygons) by reference, which is not possible for any geometry not containing ranges. So it is now agnostic with respect to return type, so by-value and by-reference are both permitted.

More information in my recent blog about this:
http://barendgehrels.blogspot.com/2010/12/range-return-types-and-references.html

Many thanks to Bruno for the off-list chats last few days about this.

Note that the concepts need to be worked-at a little further for modification of adapted geometries. But I'm glad with the current results that Boost.Polygon polygons can be used for Boost.Geometry's algorithms accepting const geometries.

For your convenience:
http://bit.ly/hjuZZw with adaption sources
http://bit.ly/gOf0P4 with test project

I currently did the adaption in the boost::geometry::adapt::bp namespace. It is possible to do things in the boost::polygon namespace (with as side effect that Boost.Polygon's polygons can be used as ranges). But I leave that to Luke if he wants that.

Regards, Barend

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20101213/01ec4771/attachment.html


Geometry list run by mateusz at loskot.net