// Boost.Geometry Index // Unit Test // Copyright (c) 2016 Adam Wulkiewicz, Lodz, Poland. // 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) #include #include #include template void test_all() { typedef bg::model::box Box; typedef bg::model::segment Seg; typedef bg::model::ring Ring; typedef bg::model::polygon Poly; typedef bg::model::multi_polygon MPoly; typedef bg::model::linestring Ls; typedef bg::model::multi_linestring MLs; typedef bg::model::multi_point MPt; bgi::rtree rt; std::vector found; rt.query(bgi::intersects(Point()), back_inserter(found)); rt.query(bgi::intersects(Seg()), back_inserter(found)); rt.query(bgi::intersects(Box()), back_inserter(found)); rt.query(bgi::intersects(Ring()), back_inserter(found)); rt.query(bgi::intersects(Poly()), back_inserter(found)); rt.query(bgi::intersects(MPoly()), back_inserter(found)); rt.query(bgi::intersects(Ls()), back_inserter(found)); rt.query(bgi::intersects(MLs()), back_inserter(found)); rt.query(bgi::intersects(MPt()), back_inserter(found)); } int test_main(int, char* []) { typedef bg::model::d2::point_xy Pt; typedef bg::model::box Box; test_all< Pt, Pt, bgi::linear<16> >(); test_all< Pt, Pt, bgi::quadratic<4> >(); test_all< Pt, Pt, bgi::rstar<4> >(); test_all< Box, Pt, bgi::linear<16> >(); test_all< Box, Pt, bgi::quadratic<4> >(); test_all< Box, Pt, bgi::rstar<4> >(); return 0; }