|
Geometry : |
Subject: [geometry] Using Boost.Geometry with a legacy class hierarchy
From: Mats Taraldsvik (mats.taraldsvik_at_[hidden])
Date: 2012-02-11 06:34:28
Hi,
I'm trying to figure out how to adapt our legacy objects to boost
geometry. The first goal is to be able to extract the WKT from every
type of object.
(I am eventually going to use pointers, which is why I chose to adapt
the point similarly to the pointer-to-point example)
I think I've managed to adapt QPoint and QLineString, because the result
of the program is a correct WKT. However, if there are better ways of
defining a boost range for this purpose, I would love to hear about it.
(None of my functions are named "range_value", and since the
documentation states "The type defined by the metafunction
|range_value<...>::type| must fulfill the Point Concept
<http://www.boost.org/doc/libs/1_48_0/libs/geometry/doc/html/geometry/reference/concepts/concept_point.html>",
I guess there is a better way...?)
The next step is to adapt the QRing class. I need to create a single
iterator sequence that loops all of the linestrings contained in the
QRing::lines directly, but -- especially since I'm not sure if the
boost.range part of QLineString is done correctly -- I don't know the
right way to do it. Could you give me any pointers?
I've uploaded the code here [1] for ease of reading.
[1] https://gist.github.com/1798839
Regards,
Mats Taraldsvik
Geometry list run by mateusz at loskot.net