// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
//
-// This file was modified by Oracle on 2017, 2018.
-// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2017-2021.
+// Modifications copyright (c) 2017-2021 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
//
// Use, modification and distribution is subject to the Boost Software License,
#include <algorithms/test_overlay.hpp>
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/detail/partition.hpp>
+#include <boost/geometry/algorithms/equals.hpp>
+#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/algorithms/intersects.hpp>
-#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/multi_point.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/register/point.hpp>
-#include <boost/geometry/algorithms/detail/partition.hpp>
-
-#include <boost/geometry/io/wkt/wkt.hpp>
-
#if defined(TEST_WITH_SVG)
# include <boost/geometry/io/svg/svg_mapper.hpp>
#endif
+#include <boost/geometry/io/wkt/wkt.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_int.hpp>
std::vector<sample> boxes;
int index = 1;
- BOOST_FOREACH(std::string const& wkt, wkt_boxes)
+ for (std::string const& wkt : wkt_boxes)
{
boxes.push_back(sample(index++, wkt));
}
bg::read_wkt(wkt2, mp2);
int id = 1;
- BOOST_FOREACH(point_item& p, mp1)
+ for (point_item& p : mp1)
{ p.id = id++; }
id = 1;
- BOOST_FOREACH(point_item& p, mp2)
+ for (point_item& p : mp2)
{ p.id = id++; }
point_visitor visitor;
// Test equality in quadratic loop
int expected_count = 0;
- BOOST_FOREACH(point_item const& item1, mp1)
+ for (point_item const& item1 : mp1)
{
- BOOST_FOREACH(point_item const& item2, mp2)
+ for (point_item const& item2 : mp2)
{
if (bg::equals(item1, item2))
{
BOOST_CHECK_EQUAL(visitor.count, expected_count);
#if defined(TEST_WITH_SVG)
- BOOST_FOREACH(point_item const& item, mp1)
+ for (point_item const& item : mp1)
{
mapper.map(item, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8);
}
- BOOST_FOREACH(point_item const& item, mp2)
+ for (point_item const& item : mp2)
{
mapper.map(item, "fill:rgb(0,128,255);stroke:rgb(0,0,100);stroke-width:1", 4);
}
// Test equality in quadratic loop
int expected_count = 0;
double expected_area = 0.0;
- BOOST_FOREACH(box_item<box_type> const& item1, boxes)
+ for (box_item<box_type> const& item1 : boxes)
{
- BOOST_FOREACH(box_item<box_type> const& item2, boxes)
+ for (box_item<box_type> const& item2 : boxes)
{
if (item1.id < item2.id)
{
p.x = size + 1; p.y = size + 1; mapper.add(p);
}
- BOOST_FOREACH(box_item<box_type> const& item, boxes)
+ for (box_item<box_type> const& item : boxes)
{
mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1");
}
// Get expectations in quadratic loop
int expected_count = 0;
double expected_area = 0.0;
- BOOST_FOREACH(box_item<box_type> const& item1, boxes1)
+ for (box_item<box_type> const& item1 : boxes1)
{
- BOOST_FOREACH(box_item<box_type> const& item2, boxes2)
+ for (box_item<box_type> const& item2 : boxes2)
{
if (bg::intersects(item1.box, item2.box))
{
p.x = size + 1; p.y = size + 1; mapper.add(p);
}
- BOOST_FOREACH(box_item<box_type> const& item, boxes1)
+ for (box_item<box_type> const& item : boxes1)
{
mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1");
}
- BOOST_FOREACH(box_item<box_type> const& item, boxes2)
+ for (box_item<box_type> const& item : boxes2)
{
mapper.map(item.box, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1");
}
// Get expectations in quadratic loop
int expected_count = 0;
- BOOST_FOREACH(point_item const& point, points)
+ for (point_item const& point : points)
{
- BOOST_FOREACH(box_item<box_type> const& box_item, boxes)
+ for (box_item<box_type> const& box_item : boxes)
{
if (bg::within(point, box_item.box))
{
p.x = size + 1; p.y = size + 1; mapper.add(p);
}
- BOOST_FOREACH(point_item const& point, points)
+ for (point_item const& point : points)
{
mapper.map(point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8);
}
- BOOST_FOREACH(box_item<box_type> const& item, boxes)
+ for (box_item<box_type> const& item : boxes)
{
mapper.map(item.box, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1");
}