Boost.Geometry (aka GGL, Generic Geometry Library) Boost.Geometry (and more) OGC – Boost.Geometry. Boost Geometry - Point in triangle test available? > > Does Boost.Geometry have a pre-canned 'point in triangle' test > > available? I could come up with one myself easily, but asking might > > allow me to stay lazy :-P > > There is point in polygon, of course. I'm not sure of the syntax > required, however. For the sake of simplicity, I implemented this function for my use case: // check, whether (x, y) is inside the triangle spanned by // [(x1, y1), (x2, y2), (x3, y3)] inline bool is_point_in_triangle(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3) { namespace bg = boost::geometry; typedef bg::model::point_xy<double> /*_ll_deg*/ point_type; // typedef bg::longitude<double> longitude; // typedef bg::latitude<double> latitude; bg::model::polygon<point_type> poly; poly.outer().push_back(point_type(x1, y1/*longitude(x1), latitude(y1)*/)); poly.outer().push_back(point_type(x2, y2/*longitude(x2), latitude(y2)*/)); poly.outer().push_back(point_type(x3, y3/*longitude(x3), latitude(y3)*/));
User/CustomGeometryTypes – Boost.Geometry. Inspired by the Custom polygons thread, this article is dedicated to end-user examples on defining custom geometry containers and explains how to use them with GGL functions and algorithms. Point ¶ Line ¶ TBD - extend example typedef std::vector<my_custom_point> my_linestring; Polygon ¶ Requirements: You have to assign it the ring tag. TBD - provide working example. User – Boost.Geometry. Boost.Geometry. NOTE that this page is old and Boost.Geometry is now part of Boost. Documentation is now there. (also known as GGL, Generic Geometry Library) Boost.Geometry provides a generic implementation of geometry algorithms, working with geometry types provided by the library itself as well as user-defined types.
The library is implemented in C++ programming language with extensive use of elements of template metaprogramming like class (type) templates, static polymorphism and compile-time execution. Consequently, Boost.Geometry is built upon foundation of C++ Standard Library and Boost C++ Libraries. The main purpose of this Trac website is to collect bug reports, patches and enhancements submitted by developers and users as well as it integrates Wiki pages. January 4, 2012 - Mailing list migrated to lists.boost.org server under new name geometryJuly 12, 2011 - Boost.Geometry is Released!
Boost.Geometry defines concepts for geometries and implements some algorithms on such geometries.