1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2014, Oracle and/or its affiliates
6 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
12 //` Checks whether a geometry is simple
16 #include <boost/geometry.hpp>
17 #include <boost/geometry/geometries/point_xy.hpp>
18 #include <boost/geometry/geometries/linestring.hpp>
19 #include <boost/geometry/geometries/multi_linestring.hpp>
20 /*<-*/ #include "create_svg_one.hpp" /*->*/
24 typedef boost::geometry::model::d2::point_xy
<double> point_type
;
25 typedef boost::geometry::model::linestring
<point_type
> linestring_type
;
26 typedef boost::geometry::model::multi_linestring
<linestring_type
> multi_linestring_type
;
28 multi_linestring_type multi_linestring
;
29 boost::geometry::read_wkt("MULTILINESTRING((0 0,0 10,10 10,10 0,0 0),(10 10,20 20))", multi_linestring
);
31 std::cout
<< "is simple? "
32 << (boost::geometry::is_simple(multi_linestring
) ? "yes" : "no")
34 /*<-*/ create_svg("is_simple_example.svg", multi_linestring
); /*->*/
46 [$img/algorithms/is_simple_example.png]