Just an observation:
On Sat, Aug 24, 2013 at 11:07 AM, Lepere Renaud
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/example...
My Ring structure is very simple : typedef std::vector< Point > Points; struct Ring { Points points; };
I'm not sure you're making it more complex than it needs to be. It seems like a Ring *IS* a Vector of Points. And/or the *application* of that type. So why not run with the type you've already defined? typedef std::vector<Point> points_vector; //... points_vector my_ring; Or: typedefin std::vector<Point> ring_type; Then you don't have to implement anything else, no other iterators: vector is already done for you. Good luck!
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
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users