I have an existing geometric structure, and i try to make it usable with boost geometry. I read the documentation for a similar problem but i did not success http://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/geometry/examples/example__adapting_a_legacy_geometry_object_model.html
My Ring structure is very simple :
typedef std::vector< Point > Points;
struct Ring
{
Points points;
};
void f()
{
boost::geometry::concept::check< Geom::Ring >();
}
show failure since apparently my range does not support a clear() method correctly.
however i think i implemented correctly the range adaption
namespace boost/geometry/traints
template<> struct tag< Geom::Ring > { typedef ring_tag type; };
namespace Geom
inline Geom::Points::iterator
range_begin(Ring & ring) { return ring.points.begin(); }
inline Geom::Points::iterator
range_end(Ring & ring) { return ring.points.end(); }
inline Geom::Points::const_iterator
range_begin(const Ring & ring) { return ring.points.begin(); }
inline Geom::Points::const_iterator
range_end(const Ring & ring) { return ring.points.end(); }
and in namespace boost
template <>
struct range_mutable_iterator< Geom::Ring >
{ typedef Geom::Points::iterator type; };
// i tried also with range_iterator
template<>
struct range_const_iterator< Geom::Ring >
{ typedef Geom::Points::const_iterator type;
};
I am a bit lost. Did i missed something obvious ?
Thanks,
Renaud