mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-09 23:24:02 +00:00
Fixed for removal of registration macro
[SVN r71625]
This commit is contained in:
parent
d92dbecb6a
commit
d667803da4
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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; };
|
||||
}}}
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user