|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83273 - trunk/libs/geometry/test_extensions/algorithms/buffer
From: barend.gehrels_at_[hidden]
Date: 2013-03-03 07:29:30
Author: barendgehrels
Date: 2013-03-03 07:29:29 EST (Sun, 03 Mar 2013)
New Revision: 83273
URL: http://svn.boost.org/trac/boost/changeset/83273
Log:
[geometry] reorganized buffer strategies (unit tests)
Text files modified:
trunk/libs/geometry/test_extensions/algorithms/buffer/linestring_buffer.cpp | 4 +++-
trunk/libs/geometry/test_extensions/algorithms/buffer/multi_linestring_buffer.cpp | 1 +
trunk/libs/geometry/test_extensions/algorithms/buffer/multi_polygon_buffer.cpp | 3 ++-
trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp | 7 +++++--
4 files changed, 11 insertions(+), 4 deletions(-)
Modified: trunk/libs/geometry/test_extensions/algorithms/buffer/linestring_buffer.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/buffer/linestring_buffer.cpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/buffer/linestring_buffer.cpp 2013-03-03 07:29:29 EST (Sun, 03 Mar 2013)
@@ -164,8 +164,10 @@
test_one<linestring, buf::join_round, polygon>("one_bend", one_bend, 'r', 28.488, 1.5, 1.5);
test_one<linestring, buf::join_miter, polygon>("one_bend", one_bend, 'm', 28.696, 1.5, 1.5);
+ test_one<linestring, buf::join_round_by_divide, polygon>("one_bend", one_bend, 'd', 28.488, 1.5, 1.5);
- test_one<linestring, buf::join_round, polygon>("two_bends", two_bends, 'r', 39.222, 1.5, 1.5);
+ test_one<linestring, buf::join_round, polygon>("two_bends", two_bends, 'r', 39.235, 1.5, 1.5);
+ test_one<linestring, buf::join_round_by_divide, polygon>("two_bends", two_bends, 'd', 39.235, 1.5, 1.5);
test_one<linestring, buf::join_miter, polygon>("two_bends", two_bends, 'm', 39.513, 1.5, 1.5);
test_one<linestring, buf::join_round, polygon>("two_bends_left", two_bends, 'r', 20.028, 1.5, 0.0);
test_one<linestring, buf::join_miter, polygon>("two_bends_left", two_bends, 'm', 20.225, 1.5, 0.0);
Modified: trunk/libs/geometry/test_extensions/algorithms/buffer/multi_linestring_buffer.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/buffer/multi_linestring_buffer.cpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/buffer/multi_linestring_buffer.cpp 2013-03-03 07:29:29 EST (Sun, 03 Mar 2013)
@@ -34,6 +34,7 @@
test_one<multi_linestring_type, buf::join_round, polygon>("simplex", simplex, 'r', 38.2623, 1.5, 1.5);
test_one<multi_linestring_type, buf::join_round, polygon>("two_bends", two_bends, 'r', 64.6217, 1.5, 1.5);
+ test_one<multi_linestring_type, buf::join_round_by_divide, polygon>("two_bends", two_bends, 'd', 64.6217, 1.5, 1.5);
test_one<multi_linestring_type, buf::join_miter, polygon>("two_bends", two_bends, 'm', 65.1834, 1.5, 1.5);
test_one<multi_linestring_type, buf::join_round, polygon>("two_bends_asym", two_bends, 'm', 52.3793, 1.5, 0.75);
}
Modified: trunk/libs/geometry/test_extensions/algorithms/buffer/multi_polygon_buffer.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/buffer/multi_polygon_buffer.cpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/buffer/multi_polygon_buffer.cpp 2013-03-03 07:29:29 EST (Sun, 03 Mar 2013)
@@ -253,7 +253,8 @@
test_one<multi_polygon_type, buf::join_miter, polygon_type>("multi_simplex_20", simplex, 'm', 77.7060, 2.0);
test_one<multi_polygon_type, buf::join_round, polygon_type>("multi_simplex_50", simplex, 'r', 174.46, 5.0);
test_one<multi_polygon_type, buf::join_miter, polygon_type>("multi_simplex_50", simplex, 'm', 298.797, 5.0);
-
+ test_one<multi_polygon_type, buf::join_round_by_divide, polygon_type>("multi_simplex_50", simplex, 'd', 174.46, 5.0);
+
test_one<multi_polygon_type, buf::join_round, polygon_type>("zonethru_05", zonethru, 'r', 67.4627, 0.5);
test_one<multi_polygon_type, buf::join_miter, polygon_type>("zonethru_05", zonethru, 'm', 68.0000, 0.5);
test_one<multi_polygon_type, buf::join_round, polygon_type>("zonethru_10", zonethru, 'r', 93.8508, 1.0, -999, 1);
Modified: trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/buffer/test_buffer.hpp 2013-03-03 07:29:29 EST (Sun, 03 Mar 2013)
@@ -85,15 +85,18 @@
typedef typename bg::coordinate_type<Geometry>::type coordinate_type;
typedef typename bg::point_type<Geometry>::type point_type;
- typedef bg::strategy::buffer::distance_assymetric<coordinate_type> distance;
+ typedef bg::strategy::buffer::distance_asymmetric<coordinate_type> distance;
typedef typename bg::ring_type<GeometryOut>::type ring_type;
typedef typename bg::tag<Geometry>::type tag;
+ // TODO use something different here:
std::string type = boost::is_same<tag, bg::polygon_tag>::value ? "poly"
: boost::is_same<tag, bg::linestring_tag>::value ? "line"
+ : boost::is_same<tag, bg::point_tag>::value ? "point"
: boost::is_same<tag, bg::multi_polygon_tag>::value ? "multipoly"
: boost::is_same<tag, bg::multi_linestring_tag>::value ? "multiline"
+ : boost::is_same<tag, bg::multi_point_tag>::value ? "multipoint"
: ""
;
@@ -138,7 +141,7 @@
join_strategy_type join_strategy;
- typedef bg::strategy::buffer::distance_assymetric<coordinate_type> distance_strategy_type;
+ typedef bg::strategy::buffer::distance_asymmetric<coordinate_type> distance_strategy_type;
distance_strategy_type distance_strategy(distance_left, distance_right);
std::vector<GeometryOut> buffered;
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