|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71625 - trunk/libs/geometry/example
From: barend.gehrels_at_[hidden]
Date: 2011-04-30 10:58:30
Author: barendgehrels
Date: 2011-04-30 10:58:29 EDT (Sat, 30 Apr 2011)
New Revision: 71625
URL: http://svn.boost.org/trac/boost/changeset/71625
Log:
Fixed for removal of registration macro
Text files modified:
trunk/libs/geometry/example/c03_custom_linestring_example.cpp | 5 +++--
trunk/libs/geometry/example/c04_a_custom_triangle_example.cpp | 6 ++++--
trunk/libs/geometry/example/c04_b_custom_triangle_example.cpp | 10 +++++-----
trunk/libs/geometry/example/c06_custom_polygon_example.cpp | 7 +++++--
trunk/libs/geometry/example/c08_custom_non_std_example.cpp | 6 ++++--
5 files changed, 21 insertions(+), 13 deletions(-)
Modified: trunk/libs/geometry/example/c03_custom_linestring_example.cpp
==============================================================================
--- trunk/libs/geometry/example/c03_custom_linestring_example.cpp (original)
+++ trunk/libs/geometry/example/c03_custom_linestring_example.cpp 2011-04-30 10:58:29 EDT (Sat, 30 Apr 2011)
@@ -16,7 +16,6 @@
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/register/point.hpp>
-#include <boost/geometry/geometries/register/linestring.hpp>
// To register the 'geographic' distance function to calculate distance over the earth:
#include <boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp>
@@ -61,7 +60,9 @@
// Register the track as well, as being a "linestring"
-BOOST_GEOMETRY_REGISTER_LINESTRING(gps_track)
+namespace boost { namespace geometry { namespace traits {
+template <> struct tag<gps_track> { typedef ring_tag type; };
+}}}
int main()
Modified: trunk/libs/geometry/example/c04_a_custom_triangle_example.cpp
==============================================================================
--- trunk/libs/geometry/example/c04_a_custom_triangle_example.cpp (original)
+++ trunk/libs/geometry/example/c04_a_custom_triangle_example.cpp 2011-04-30 10:58:29 EDT (Sat, 30 Apr 2011)
@@ -16,7 +16,6 @@
#include <boost/geometry/algorithms/area.hpp>
#include <boost/geometry/algorithms/centroid.hpp>
-#include <boost/geometry/geometries/register/ring.hpp>
#include <boost/geometry/strategies/strategies.hpp>
#include <boost/geometry/util/write_dsv.hpp>
@@ -30,7 +29,10 @@
};
-BOOST_GEOMETRY_REGISTER_RING(triangle)
+// Register triangle as a ring
+namespace boost { namespace geometry { namespace traits {
+template <> struct tag<triangle> { typedef ring_tag type; };
+}}}
// Specializations of algorithms, where useful. If not specialized the default ones
Modified: trunk/libs/geometry/example/c04_b_custom_triangle_example.cpp
==============================================================================
--- trunk/libs/geometry/example/c04_b_custom_triangle_example.cpp (original)
+++ trunk/libs/geometry/example/c04_b_custom_triangle_example.cpp 2011-04-30 10:58:29 EDT (Sat, 30 Apr 2011)
@@ -18,11 +18,10 @@
#include <boost/geometry/algorithms/area.hpp>
#include <boost/geometry/algorithms/centroid.hpp>
#include <boost/geometry/geometries/adapted/boost_tuple.hpp>
-#include <boost/geometry/geometries/register/ring.hpp>
#include <boost/geometry/strategies/strategies.hpp>
#include <boost/geometry/util/write_dsv.hpp>
-BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian);
+BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
template <typename P>
@@ -30,11 +29,12 @@
{
};
+
// Register triangle<P> as a ring
+namespace boost { namespace geometry { namespace traits {
+template <typename P> struct tag<triangle<P> > { typedef ring_tag type; };
+}}}
-namespace boost { namespace geometry {
-template <typename P> struct tag<triangle<P> > { typedef ring_tag type; }
-}}
namespace boost { namespace geometry { namespace dispatch {
Modified: trunk/libs/geometry/example/c06_custom_polygon_example.cpp
==============================================================================
--- trunk/libs/geometry/example/c06_custom_polygon_example.cpp (original)
+++ trunk/libs/geometry/example/c06_custom_polygon_example.cpp 2011-04-30 10:58:29 EDT (Sat, 30 Apr 2011)
@@ -14,7 +14,6 @@
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/register/point.hpp>
-#include <boost/geometry/geometries/register/ring.hpp>
struct my_point
@@ -49,7 +48,11 @@
// We can conveniently use macro's to register point and ring
BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y)
-BOOST_GEOMETRY_REGISTER_RING(my_ring)
+
+// Register my_ring as a ring
+namespace boost { namespace geometry { namespace traits {
+template <> struct tag<my_ring> { typedef ring_tag type; };
+}}}
Modified: trunk/libs/geometry/example/c08_custom_non_std_example.cpp
==============================================================================
--- trunk/libs/geometry/example/c08_custom_non_std_example.cpp (original)
+++ trunk/libs/geometry/example/c08_custom_non_std_example.cpp 2011-04-30 10:58:29 EDT (Sat, 30 Apr 2011)
@@ -20,7 +20,6 @@
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/register/point.hpp>
-#include <boost/geometry/geometries/register/ring.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
// Sample point, having x/y
@@ -215,7 +214,10 @@
// 4) register with Boost.Geometry
BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y)
-BOOST_GEOMETRY_REGISTER_RING(my_polygon)
+
+namespace boost { namespace geometry { namespace traits {
+template <> struct tag<my_polygon> { typedef ring_tag type; };
+}}}
// end adaption
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