Quantcast

convex_hull and Geometry Concept

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

convex_hull and Geometry Concept

Michael Caisse

The documentation
<http://www.boost.org/doc/libs/1_47_0/libs/geometry/doc/html/geometry/reference/algorithms/convex_hull.html>
for the convex_hull algorithm identifies that the geometry must fulfill
"a Geometry Concept".

It appears that convex_hull doesn't like Box Concept (which I assume is
a Geometry Concept). Granted, the convex_hull of a box type isn't very
interesting; however, generic programming requires a lot of
uninteresting things  (o;

I might be missing something with the term "Geometry Concept". The
follow little program demonstrates the problem.

Thanks -
michael

btw - results with 1.47 or trunk. With clang it actually fails the
ConvexHullStrategy concept check. gcc just fails at the time of the
dispatch::convex_hull.



#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/box.hpp>

namespace bg = boost::geometry;


int main()
{
    typedef bg::model::point<int,2,bg::cs::cartesian> point_type;
    bg::model::box<point_type> box( point_type(1,1), point_type(2,2) );
    bg::model::box<point_type> hull;

    bg::convex_hull( box, hull );

    return 1;
}




--

Michael Caisse
Object Modeling Designs
www.objectmodelingdesigns.com

_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convex_hull and Geometry Concept

Barend
Hi Michael,

On 19-8-2011 4:15, Michael Caisse wrote:

>
> The documentation
> <http://www.boost.org/doc/libs/1_47_0/libs/geometry/doc/html/geometry/reference/algorithms/convex_hull.html>
> for the convex_hull algorithm identifies that the geometry must
> fulfill "a Geometry Concept".
>
> It appears that convex_hull doesn't like Box Concept (which I assume
> is a Geometry Concept). Granted, the convex_hull of a box type isn't
> very interesting; however, generic programming requires a lot of
> uninteresting things  (o;
>
> I might be missing something with the term "Geometry Concept". The
> follow little program demonstrates the problem.

Yes, you are right. It will be added. Thanks for the message.
For a "point" we probably get an even more uninteresting and invalid hull...

Regards, Barend


_______________________________________________
ggl mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/ggl
Loading...