|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59802 - in sandbox/geometry/libs/geometry: doc/testcases test/algorithms test/algorithms/overlay test/algorithms/overlay/robustness
From: barend.gehrels_at_[hidden]
Date: 2010-02-21 04:12:12
Author: barendgehrels
Date: 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
New Revision: 59802
URL: http://svn.boost.org/trac/boost/changeset/59802
Log:
Added namespaces for svg_mapper in testfiles
Added:
sandbox/geometry/libs/geometry/doc/testcases/assemble.ppt (contents, props changed)
sandbox/geometry/libs/geometry/doc/testcases/buffer.ppt (contents, props changed)
sandbox/geometry/libs/geometry/doc/testcases/dissolve.ppt (contents, props changed)
sandbox/geometry/libs/geometry/doc/testcases/relate.ppt (contents, props changed)
Binary files modified:
sandbox/geometry/libs/geometry/doc/testcases/overlay_cases.ppt
Text files modified:
sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp | 6 ++
sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp | 34 ++++++++++----
sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp | 93 ----------------------------------------
sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp | 10 ++--
sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp | 8 ++
sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp | 61 +++++++++++++------------
sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp | 10 ++--
sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp | 5 +
15 files changed, 88 insertions(+), 153 deletions(-)
Added: sandbox/geometry/libs/geometry/doc/testcases/assemble.ppt
==============================================================================
Binary file. No diff available.
Added: sandbox/geometry/libs/geometry/doc/testcases/buffer.ppt
==============================================================================
Binary file. No diff available.
Added: sandbox/geometry/libs/geometry/doc/testcases/dissolve.ppt
==============================================================================
Binary file. No diff available.
Modified: sandbox/geometry/libs/geometry/doc/testcases/overlay_cases.ppt
==============================================================================
Binary files. No diff available.
Added: sandbox/geometry/libs/geometry/doc/testcases/relate.ppt
==============================================================================
Binary file. No diff available.
Modified: sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -44,6 +44,8 @@
typename boost::geometry::cs_tag<P>::type
>::type side;
+ boost::ignore_unused_variable_warning(side);
+
typedef typename boost::geometry::range_type<Geometry>::type range_type;
typedef typename boost::range_const_iterator<range_type>::type iterator;
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -73,7 +73,7 @@
filename << "assemble_" << id << ".svg";
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename boost::geometry::point_type<Geometry>::type> mapper(svg, 500, 500);
+ bg::svg_mapper<typename bg::point_type<Geometry>::type> mapper(svg, 500, 500);
mapper.add(p);
mapper.add(q);
mapper.map(p, "fill-opacity:0.6;stroke-opacity:0.9;fill:rgb(0,0,255);stroke:rgb(0,0,255);stroke-width:2");
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -45,7 +45,7 @@
filename << "dissolve_" << id << ".svg";
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename boost::geometry::point_type<Geometry>::type> mapper(svg, 500, 500);
+ bg::svg_mapper<typename bg::point_type<Geometry>::type> mapper(svg, 500, 500);
mapper.add(geometry);
mapper.map(geometry, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1");
BOOST_FOREACH(Geometry const& geometry, out)
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -78,7 +78,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename boost::geometry::point_type<G2>::type> mapper(svg, 500, 500);
+ boost::geometry::svg_mapper<typename boost::geometry::point_type<G2>::type> mapper(svg, 500, 500);
mapper.add(g1);
mapper.add(g2);
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -104,7 +104,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<P> mapper(svg, 500, 500);
+ bg::svg_mapper<P> mapper(svg, 500, 500);
mapper.add(bg::make<P>(0, 0));
mapper.add(bg::make<P>(10, 10));
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -98,7 +98,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename bg::point_type<G2>::type> mapper(svg, 500, 500);
+ bg::svg_mapper<typename bg::point_type<G2>::type> mapper(svg, 500, 500);
mapper.add(g1);
mapper.add(g2);
@@ -247,6 +247,10 @@
test_overlay<polygon, polygon, test_get_turns, Tuple>("54ba", boost::make_tuple(13, 0.0, 0.0), case_54[1], case_54[2]);
test_overlay<polygon, polygon, test_get_turns, Tuple>("54bb", boost::make_tuple(13, 0.0, 0.0), case_54[1], case_54[3]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("55", boost::make_tuple(10, 0.0, 0.0), case_55[0], case_55[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("56", boost::make_tuple(8, 0.0, 0.0), case_56[0], case_56[1]);
+
+
// other
test_overlay<polygon, polygon, test_get_turns, Tuple>("many_situations", boost::make_tuple(31, 11.625, 13.875), case_many_situations[0], case_many_situations[1]);
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -210,12 +210,12 @@
// 50, collinear opposite
static std::string case_50[2] = {
- "POLYGON((0 0,0 3,2 3,4 3,4 0,0 0))",
+ "POLYGON((0 0,0 3,2 3,4 3,4 0,0 0))",
"POLYGON((0 3,0 5,5 5,5 0,4 0,4 3,2 3,0 3))" };
// 51, fit
static std::string case_51[2] = {
- "POLYGON((0 0,0 5,5 5,5 0,0 0),(4 1,3 4,1 2,4 1))",
+ "POLYGON((0 0,0 5,5 5,5 0,0 0),(4 1,3 4,1 2,4 1))",
"POLYGON((1 2,3 4,4 1,1 2))" };
// 52, partially equal, touching each other
@@ -223,28 +223,42 @@
"POLYGON((0 0,1 4,3 1,4 4,1 4,5 5,5 0,0 0))",
"POLYGON((0 0,1 4,3 1,4 4,1 4,5 5,4 1,0 0))" };
-// 53, wrapping a box, self-touching
+// 53, wrapping a box, self-touching
static std::string case_53[3] = {
"POLYGON((2 2,2 3,3 3,3 2,2 2))",
// a: self-tangent ext. ring, ST_IsValid=false
- "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,3 2,3 1,4 1,4 4,1 4,1 3,2 3,2 2,0 2))",
+ "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,3 2,3 1,4 1,4 4,1 4,1 3,2 3,2 2,0 2))",
// b: tangent ext/int ring, ST_IsValid=true
- "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 3,2 2,3 2,3 1,4 1,4 4,1 4,1 3))"
+ "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 3,2 2,3 2,3 1,4 1,4 4,1 4,1 3))"
};
static std::string case_54[4] = {
// a: self-tangent ext. ring
- "POLYGON((2 2,2 3,4 3,4 0,1 0,1 2,2 2,2 1,3 1,3 2,2 2))",
+ "POLYGON((2 2,2 3,4 3,4 0,1 0,1 2,2 2,2 1,3 1,3 2,2 2))",
// b: tangent ext/int ring
- "POLYGON((2 2,2 3,4 3,4 0,1 0,1 2,2 2),(2 1,3 1,3 2,2 2,2 1))",
+ "POLYGON((2 2,2 3,4 3,4 0,1 0,1 2,2 2),(2 1,3 1,3 2,2 2,2 1))",
case_53[1],
case_53[2]
// other like in case53
};
static std::string case_55[2] = {
- "POLYGON((2 2,3 3,4 3,4 0,1 0,1 1,2 2),(2 1,3 1,3 2,2 2,2 1))",
- "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 2,3 1,4 1,4 4,1 4,1 3))"
+ "POLYGON((2 2,3 3,4 3,4 0,1 0,1 1,2 2),(2 1,3 1,3 2,2 2,2 1))",
+ "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 2,3 1,4 1,4 4,1 4,1 3))"
+ };
+
+static std::string case_56[2] = {
+ "POLYGON((0 0,0 1,2 3,3 0,4 2,5 0,0 0))",
+ "POLYGON((0 1,0 4,5 4,5 0,3 0,4 1,4 3,2 3,2 1,3 0,0 0))"
+ };
+
+static std::string case_57[2] = {
+ //case_56[0],
+ //"POLYGON((0 2,4 5,5 1,0 2))"
+ //"POLYGON((0 -1,0 1,2 3,3 0,4 2,5 -1,0 -1))",
+ "POLYGON((0 0,0 1,2 3,3 0,4 2,6 0,0 0))",
+ "POLYGON((0 0,4 5,5 0,0 0))"
+
};
@@ -319,4 +333,4 @@
};
*/
-#endif // GEOMETRY_TEST_OVERLAY_CASES_HPP
+#endif // BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -65,7 +65,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<P> mapper(svg, 500, 500);
+ bg::svg_mapper<P> mapper(svg, 500, 500);
mapper.add(bg::make<P>(0, 0));
mapper.add(bg::make<P>(10, 10));
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -32,99 +32,6 @@
#include <test_overlay_p_q.hpp>
-/*
-template <typename OutputType, typename CalculationType, typename G1, typename G2>
-void test_overlay(int seed, int caseid, G1 const& a, G2 const& b, bool svg, double tolerance)
-{
- typedef typename boost::geometry::coordinate_type<G1>::type coordinate_type;
- typedef typename boost::geometry::point_type<G1>::type point_type;
- typedef boost::geometry::detail::intersection::intersection_point<point_type> ip_type;
-
- typedef boost::geometry::strategy_intersection
- <
- typename boost::geometry::cs_tag<point_type>::type,
- G1,
- G2,
- ip_type,
- CalculationType
- > strategy;
-
- std::vector<OutputType> out_i, out_u;
-
-
- CalculationType area_a = boost::geometry::area(a);
- CalculationType area_b = boost::geometry::area(b);
-
- CalculationType area_i = 0;
- CalculationType area_u = 0;
-
- boost::geometry::intersection_inserter<OutputType>(a, b, std::back_inserter(out_i), strategy());
- for (typename std::vector<OutputType>::iterator it = out_i.begin();
- it != out_i.end();
- ++it)
- {
- area_i += boost::geometry::area(*it);
- }
- boost::geometry::union_inserter<OutputType>(a, b, std::back_inserter(out_u), strategy());
- for (typename std::vector<OutputType>::iterator it = out_u.begin();
- it != out_u.end();
- ++it)
- {
- area_u += boost::geometry::area(*it);
- }
-
- double diff = (area_a + area_b) - area_u - area_i;
- if (std::abs(diff) > tolerance)
- {
- svg = true;
- std::cout
- << "type: " << string_from_type<CalculationType>::name()
- << " id: " << caseid
- << " seed: " << seed
- << " area i: " << area_i
- << " area u: " << area_u
- << " area a: " << area_a
- << " area b: " << area_b
- << " diff: " << diff
- << std::endl
- << std::setprecision(20)
- << " a: " << boost::geometry::wkt(a) << std::endl
- << " b: " << boost::geometry::wkt(b) << std::endl
- ;
- }
-
- if(svg)
- {
- std::ostringstream filename;
- filename << "overlay_random_ellipse_stars_" << caseid << "_"
- << string_from_type<coordinate_type>::name()
- << string_from_type<CalculationType>::name()
- << ".svg";
-
- std::ofstream svg(filename.str().c_str());
-
- svg_mapper<point_type> mapper(svg, 500, 500);
-
- mapper.add(a);
- mapper.add(b);
-
- mapper.map(a, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1");
- mapper.map(b, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1");
-
- for (typename std::vector<OutputType>::const_iterator it = out_i.begin();
- it != out_i.end(); ++it)
- {
- mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:3");
- }
- for (typename std::vector<OutputType>::const_iterator it = out_u.begin();
- it != out_u.end(); ++it)
- {
- mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,255);stroke-width:3");
- }
- }
-}
-*/
-
struct star_params
{
int count; // points of ellipse, not of star
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -93,7 +93,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<point_type> mapper(svg, 500, 500);
+ boost::geometry::svg_mapper<point_type> mapper(svg, 500, 500);
mapper.add(p);
mapper.add(q);
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -48,7 +48,7 @@
///boost::geometry::get_intersection_points(geometry, turns);
bg::detail::get_turns::no_interrupt_policy policy;
- boost::geometry::get_turns
+ bg::get_turns
<
bg::detail::overlay::assign_null_policy
>(geometry, turns, policy);
@@ -57,8 +57,8 @@
double x = 0, y = 0;
BOOST_FOREACH(turn_info const& turn, turns)
{
- x += boost::geometry::get<0>(turn.point);
- y += boost::geometry::get<1>(turn.point);
+ x += bg::get<0>(turn.point);
+ y += bg::get<1>(turn.point);
}
int n = boost::size(turns);
if (n > 0)
@@ -78,7 +78,7 @@
if (n > 0)
{
- BOOST_CHECK_EQUAL(boost::geometry::intersects(geometry), true);
+ BOOST_CHECK_EQUAL(bg::intersects(geometry), true);
}
@@ -89,7 +89,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename boost::geometry::point_type<Geometry>::type> mapper(svg, 500, 500);
+ bg::svg_mapper<typename bg::point_type<Geometry>::type> mapper(svg, 500, 500);
mapper.add(geometry);
mapper.map(geometry, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1");
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -135,7 +135,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename bg::point_type<G2>::type> mapper(svg, 500, 500);
+ bg::svg_mapper<typename bg::point_type<G2>::type> mapper(svg, 500, 500);
mapper.add(g1);
mapper.add(g2);
@@ -352,6 +352,8 @@
// 55-60
test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("55", boost::make_tuple(1, 2), case_55[0], case_55[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("56", boost::make_tuple(2, 6), case_56[0], case_56[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("57", boost::make_tuple(2, 1.489899), case_57[0], case_57[1]);
// other
@@ -456,7 +458,9 @@
// 55-60
// 55 is going wrong!
// TODO: implement "node" behaviour which merges nodes
- //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("55", boost::make_tuple(3, 18), case_55[0], case_55[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("55", boost::make_tuple(3, 18), case_55[0], case_55[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("56", boost::make_tuple(3, 18), case_56[0], case_56[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("57", boost::make_tuple(2, 15.510101), case_57[0], case_57[1]);
// other
test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("collinear_overlaps",
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -54,36 +54,36 @@
template <typename OutputType, typename G1, typename G2>
void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2)
{
-
- typedef boost::geometry::detail::intersection::intersection_point
- <typename boost::geometry::point_type<G2>::type> ip;
+ namespace bg = boost::geometry;
+ typedef bg::detail::intersection::intersection_point
+ <typename bg::point_type<G2>::type> ip;
typedef typename boost::range_const_iterator<std::vector<ip> >::type iterator;
typedef std::vector<ip> ip_vector;
ip_vector ips;
- typedef typename boost::geometry::strategy_side
+ typedef typename bg::strategy_side
<
- typename boost::geometry::cs_tag<G1>::type
+ typename bg::cs_tag<G1>::type
>::type strategy_type;
typedef bg::detail::overlay::traversal_turn_info
<
- typename boost::geometry::point_type<G2>::type
+ typename bg::point_type<G2>::type
> turn_info;
typedef typename boost::range_iterator<const std::vector<turn_info> >::type iterator;
std::vector<turn_info> ips;
bg::get_turns<bg::detail::overlay::calculate_distance_policy>(g1, g2, ips);
- boost::geometry::enrich_intersection_points(ips, g1, g2, strategy_type());
+ bg::enrich_intersection_points(ips, g1, g2, strategy_type());
- typedef boost::geometry::linear_ring<typename boost::geometry::point_type<G2>::type> ring_type;
+ typedef bg::linear_ring<typename bg::point_type<G2>::type> ring_type;
typedef std::vector<ring_type> out_vector;
out_vector v;
- boost::geometry::traverse
+ bg::traverse
<
strategy_type,
ring_type
@@ -102,14 +102,12 @@
std::ofstream svg(filename.str().c_str());
// Trick to have this always LongDouble
- //typedef boost::geometry::point_xy<long double> P;
- typedef typename boost::geometry::point_type<G1>::type P;
- //typename boost::geometry::replace_point_type<G1, P>::type rg1;
- //typename boost::geometry::replace_point_type<G2, P>::type rg2;
-
-
+ //typedef bg::point_xy<long double> P;
+ typedef typename bg::point_type<G1>::type P;
+ //typename bg::replace_point_type<G1, P>::type rg1;
+ //typename bg::replace_point_type<G2, P>::type rg2;
- svg_mapper<P> mapper(svg, 1000, 800);
+ bg::svg_mapper<P> mapper(svg, 1000, 800);
mapper.add(g1);
mapper.add(g2);
@@ -128,8 +126,8 @@
mapper.map(*it, "fill-opacity:0.1;stroke-opacity:0.9;"
"fill:rgb(255,0,0);stroke:rgb(255,0,0);stroke-width:5");
- std::cout << boost::geometry::wkt(*it) << std::endl;
- std::cout << boost::geometry::area(*it) << std::endl;
+ std::cout << bg::wkt(*it) << std::endl;
+ std::cout << bg::area(*it) << std::endl;
}
// IP's in orange
@@ -145,15 +143,16 @@
template <typename OutputType, typename G1, typename G2>
void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2)
{
+ namespace bg = boost::geometry;
G1 g1;
- boost::geometry::read_wkt(wkt1, g1);
+ bg::read_wkt(wkt1, g1);
G2 g2;
- boost::geometry::read_wkt(wkt2, g2);
+ bg::read_wkt(wkt2, g2);
- boost::geometry::correct(g1);
- boost::geometry::correct(g2);
- std::cout << "area1 " << boost::geometry::area(g1) << " " << " area2: " << boost::geometry::area(g2) << std::endl;
+ bg::correct(g1);
+ bg::correct(g2);
+ std::cout << "area1 " << bg::area(g1) << " " << " area2: " << bg::area(g2) << std::endl;
test_traverse<OutputType>(caseid, g1, g2);
}
@@ -164,8 +163,9 @@
template <typename P>
void test_traverse_gmp(std::string const& caseid)
{
- typedef boost::geometry::polygon<P> polygon;
- std::cout << typeid(typename boost::geometry::coordinate_type<P>::type).name() << std::endl;
+ namespace bg = boost::geometry;
+ typedef bg::polygon<P> polygon;
+ std::cout << typeid(typename bg::coordinate_type<P>::type).name() << std::endl;
std::cout << std::setprecision(30) << std::numeric_limits<float>::epsilon() << std::endl;
std::cout << std::setprecision(30) << std::numeric_limits<double>::epsilon() << std::endl;
std::cout << std::setprecision(30) << std::numeric_limits<long double>::epsilon() << std::endl;
@@ -188,26 +188,27 @@
int main(int argc, char** argv)
{
+ namespace bg = boost::geometry;
int mode = (argc > 1) ? atol(argv[1]) : 1;
switch(mode)
{
case 1 :
- test_traverse_gmp<boost::geometry::point_xy<float> >("float");
+ test_traverse_gmp<bg::point_xy<float> >("float");
break;
case 2 :
- test_traverse_gmp<boost::geometry::point_xy<double> >("double");
+ test_traverse_gmp<bg::point_xy<double> >("double");
break;
case 3 :
- test_traverse_gmp<boost::geometry::point_xy<long double> >("long double");
+ test_traverse_gmp<bg::point_xy<long double> >("long double");
break;
case 4 :
#if defined(HAVE_GMP)
- test_traverse_gmp<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >("gmp");
+ test_traverse_gmp<bg::point_xy<boost::numeric_adaptor::gmp_value_type> >("gmp");
#endif
break;
case 5 :
#if defined(HAVE_CLN)
- test_traverse_gmp<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >("cln");
+ test_traverse_gmp<bg::point_xy<boost::numeric_adaptor::cln_value_type> >("cln");
#endif
break;
Modified: sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -36,7 +36,7 @@
template <typename OutputType, typename CalculationType, typename G1, typename G2>
double test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2,
- int expected_count = 0, int expected_point_count = 0,
+ std::size_t expected_count = 0, std::size_t expected_point_count = 0,
double expected_length_or_area = 0,
double percentage = 0.0001,
bool make_unique = true)
@@ -97,7 +97,7 @@
#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
if (expected_point_count > 0)
{
- BOOST_CHECK_MESSAGE(int(n) == expected_point_count,
+ BOOST_CHECK_MESSAGE(n == expected_point_count,
"intersection: " << caseid
<< " #points expected: " << expected_point_count
<< " detected: " << n
@@ -107,7 +107,7 @@
if (expected_count > 0)
{
- BOOST_CHECK_MESSAGE(int(clip.size()) == expected_count,
+ BOOST_CHECK_MESSAGE(clip.size() == expected_count,
"intersection: " << caseid
<< " #outputs expected: " << expected_count
<< " detected: " << clip.size()
@@ -130,7 +130,7 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<point_type> mapper(svg, 500, 500);
+ boost::geometry::svg_mapper<point_type> mapper(svg, 500, 500);
mapper.add(g1);
mapper.add(g2);
@@ -153,7 +153,7 @@
template <typename OutputType, typename G1, typename G2>
double test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2,
- int expected_count = 0, int expected_point_count = 0,
+ std::size_t expected_count = 0, std::size_t expected_point_count = 0,
double expected_length_or_area = 0,
double percentage = 0.0001,
bool make_unique = true)
Modified: sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp 2010-02-21 04:12:09 EST (Sun, 21 Feb 2010)
@@ -90,7 +90,10 @@
std::ofstream svg(filename.str().c_str());
- svg_mapper<typename boost::geometry::point_type<G2>::type> mapper(svg, 500, 500);
+ boost::geometry::svg_mapper
+ <
+ typename boost::geometry::point_type<G2>::type
+ > mapper(svg, 500, 500);
mapper.add(g1);
mapper.add(g2);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk