// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // This file was modified by Oracle on 2014, 2017. // Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle #include "test_crosses.hpp" template void test_pl() { typedef bg::model::multi_point

mpt; typedef bg::model::linestring

ls; typedef bg::model::multi_linestring mls; test_geometry("MULTIPOINT(1 0,1 1)", "LINESTRING(0 0,1 0,3 3)", true); test_geometry("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 0,3 3)", false); test_geometry("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 1,3 3)", false); test_geometry("MULTIPOINT(0 0,3 0)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", true); test_geometry("MULTIPOINT(0 0,1 1)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", false); } template void test_pa() { typedef bg::model::multi_point

mpt; typedef bg::model::polygon

poly; typedef bg::model::multi_polygon mpoly; test_geometry("MULTIPOINT(1 1,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); test_geometry("MULTIPOINT(0 0,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); test_geometry("MULTIPOINT(0 0,1 1)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); test_geometry("MULTIPOINT(0 0,1 1)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 9,9 9,9 5,5 5)))", false); test_geometry("MULTIPOINT(1 1,1 6)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 9,9 9,9 5,5 5)))", true); } template void test_ll() { typedef bg::model::linestring

ls; typedef bg::model::multi_linestring mls; test_geometry("LINESTRING(0 0,2 2,4 4)", "LINESTRING(0 1,2 1,3 1)", true); test_geometry("LINESTRING(0 0,2 2)", "LINESTRING(0 1,2 1)", true); test_geometry("LINESTRING(0 0,2 2,4 4)", "LINESTRING(0 1,1 1,2 2,3 2)", false); test_geometry("LINESTRING(0 0,2 2,4 4)", "MULTILINESTRING((0 1,4 1),(0 2,4 2))", true); test_geometry("MULTILINESTRING((0 1,4 1),(0 2,4 2))", "LINESTRING(0 0,2 2,4 4)", true); test_geometry("MULTILINESTRING((0 0,2 2,4 4),(3 0,3 4))", "MULTILINESTRING((0 1,4 1),(0 2,4 2))", true); // spike - boundary and interior on the same point test_geometry("LINESTRING(3 7, 8 8, 2 6)", "LINESTRING(5 7, 10 7, 0 7)", true); } template void test_la() { typedef bg::model::linestring

ls; typedef bg::model::multi_linestring mls; typedef bg::model::ring

ring; typedef bg::model::polygon

poly; typedef bg::model::multi_polygon mpoly; test_geometry("LINESTRING(0 0, 10 10)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); test_geometry("LINESTRING(0 0, 10 10)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); test_geometry("LINESTRING(0 0, 10 10)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))", true); test_geometry("LINESTRING(0 0, 10 0)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); test_geometry("LINESTRING(1 1, 5 5)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); test_geometry("MULTILINESTRING((1 1, 5 5),(6 6,7 7))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); test_geometry("MULTILINESTRING((1 1, 5 5),(6 6,7 7))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); test_geometry("MULTILINESTRING((1 1, 5 5),(6 6,7 7))", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))", true); } template void test_2d() { test_pl

(); test_pa

(); test_ll

(); test_la

(); } int test_main( int , char* [] ) { test_2d >(); test_2d >(); #if defined(HAVE_TTMATH) test_2d >(); #endif //test_3d >(); return 0; }