Subject: [geometry] one more variation to "transform"/"convert"/"for_each_point"
From: Volker Schöch (vschoech_at_[hidden])
Date: 2012-02-15 11:36:55
I am aware of the transform, convert, and for_each_point algorithms. However, as far as I can see, none of these can be used to achieve the following: I want to copy one (multi-)polygon to another while applying a transform operator to its points. In particular, the result point type of the transformation is different from the input point type. See this code for an illustration:
That's how I currently solve this, but a generic function along the lines of boost::adaptors::transform would seem the natural way to do it, offering the user a way to apply a point-wise operator while hiding the internal data structures of the specific geometry. Such a transform operation could also be generically applied, allowing to supply the specific geometry type as a template parameter.
Do you have something like that available, and I just missed it? If not, may I suggest that as a future extension to the GGL?
Thanks and have a nice day
-- Volker Schöch | vschoech_at_[hidden] Senior Software Engineer think-cell Software GmbH | Chausseestr. 8/E | 10115 Berlin | Germany http://www.think-cell.com | phone +49 30 666473-10 | US phone +1 800 891 8091 Amtsgericht Berlin-Charlottenburg, HRB 85229 | European Union VAT Id DE813474306 Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl
Geometry list run by mateusz at loskot.net