Fixed for removal of registration macro

[SVN r71625]
This commit is contained in:
Barend Gehrels 2011-04-30 14:58:29 +00:00
parent d92dbecb6a
commit d667803da4
5 changed files with 22 additions and 14 deletions

View File

@ -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 @@ BOOST_GEOMETRY_REGISTER_POINT_2D(gps_point, double, cs::geographic<degree>, long
// 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()

View File

@ -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 @@ struct triangle : public boost::array<boost::geometry::model::d2::point_xy<doubl
};
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

View File

@ -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 @@ struct triangle : public boost::array<P, 3>
{
};
// Register triangle<P> as a ring
namespace boost { namespace geometry {
template <typename P> struct tag<triangle<P> > { typedef ring_tag type; }
}}
// 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 { namespace dispatch {

View File

@ -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 @@ struct my_polygon
// 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; };
}}}

View File

@ -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 @@ template<> struct resize<my_polygon>
// 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