Merge branch 'master' into conv_simplify
This commit is contained in:
commit
30f14e0878
7 changed files with 49 additions and 53 deletions
|
@ -26,7 +26,7 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/util/vertex_iterator.hpp>
|
#include <mapnik/util/path_iterator.hpp>
|
||||||
#include <mapnik/util/container_adapter.hpp>
|
#include <mapnik/util/container_adapter.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/util/vertex_iterator.hpp>
|
#include <mapnik/util/path_iterator.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
@ -40,26 +40,26 @@ struct is_container<mapnik::geometry_type const> : mpl::true_ {} ;
|
||||||
template <>
|
template <>
|
||||||
struct container_iterator<mapnik::geometry_type const>
|
struct container_iterator<mapnik::geometry_type const>
|
||||||
{
|
{
|
||||||
typedef mapnik::util::vertex_iterator<double> type;
|
typedef mapnik::util::path_iterator<mapnik::geometry_type> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct begin_container<mapnik::geometry_type const>
|
struct begin_container<mapnik::geometry_type const>
|
||||||
{
|
{
|
||||||
static mapnik::util::vertex_iterator<double>
|
static mapnik::util::path_iterator<mapnik::geometry_type>
|
||||||
call (mapnik::geometry_type const& g)
|
call (mapnik::geometry_type const& g)
|
||||||
{
|
{
|
||||||
return mapnik::util::vertex_iterator<double>(g.data());
|
return mapnik::util::path_iterator<mapnik::geometry_type>(g);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct end_container<mapnik::geometry_type const>
|
struct end_container<mapnik::geometry_type const>
|
||||||
{
|
{
|
||||||
static mapnik::util::vertex_iterator<double>
|
static mapnik::util::path_iterator<mapnik::geometry_type>
|
||||||
call (mapnik::geometry_type const& g)
|
call (mapnik::geometry_type const& g)
|
||||||
{
|
{
|
||||||
return mapnik::util::vertex_iterator<double>();
|
return mapnik::util::path_iterator<mapnik::geometry_type>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/util/vertex_iterator.hpp>
|
#include <mapnik/util/path_iterator.hpp>
|
||||||
#include <mapnik/util/container_adapter.hpp>
|
#include <mapnik/util/container_adapter.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/util/vertex_iterator.hpp>
|
|
||||||
#include <mapnik/util/geometry_svg_generator.hpp>
|
#include <mapnik/util/geometry_svg_generator.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/util/vertex_iterator.hpp>
|
|
||||||
#include <mapnik/util/geometry_wkt_generator.hpp>
|
#include <mapnik/util/geometry_wkt_generator.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/vertex_vector.hpp>
|
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
@ -34,27 +33,26 @@
|
||||||
namespace mapnik { namespace util {
|
namespace mapnik { namespace util {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class vertex_iterator
|
class path_iterator
|
||||||
: public boost::iterator_facade< vertex_iterator<T>,
|
: public boost::iterator_facade< path_iterator<T>,
|
||||||
typename boost::tuple<unsigned,T,T> const,
|
boost::tuple<unsigned,double,double> const,
|
||||||
boost::forward_traversal_tag
|
boost::forward_traversal_tag
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename boost::tuple<unsigned, T, T> value_type;
|
typedef T path_type;
|
||||||
typedef vertex_vector<T> container_type;
|
typedef typename boost::tuple<unsigned, double, double> value_type;
|
||||||
|
|
||||||
vertex_iterator()
|
path_iterator()
|
||||||
: v_(SEG_END,0,0),
|
: v_(mapnik::SEG_END,0,0),
|
||||||
vertices_(),
|
vertices_()
|
||||||
pos_(0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
explicit vertex_iterator(container_type const& vertices)
|
explicit path_iterator(path_type const& vertices)
|
||||||
: vertices_(&vertices),
|
: vertices_(&vertices)
|
||||||
pos_(0)
|
|
||||||
{
|
{
|
||||||
|
vertices_->rewind(0);
|
||||||
increment();
|
increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,10 +61,10 @@ private:
|
||||||
|
|
||||||
void increment()
|
void increment()
|
||||||
{
|
{
|
||||||
boost::get<0>(v_) = vertices_->get_vertex(pos_++, &boost::get<1>(v_), &boost::get<2>(v_));
|
boost::get<0>(v_) = vertices_->vertex( &boost::get<1>(v_), &boost::get<2>(v_));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool equal( vertex_iterator const& other) const
|
bool equal( path_iterator const& other) const
|
||||||
{
|
{
|
||||||
return boost::get<0>(v_) == boost::get<0>(other.v_);
|
return boost::get<0>(v_) == boost::get<0>(other.v_);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +75,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
value_type v_;
|
value_type v_;
|
||||||
container_type const *vertices_;
|
const path_type *vertices_;
|
||||||
unsigned pos_;
|
unsigned pos_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/util/geometry_wkt_generator.hpp>
|
#include <mapnik/util/geometry_wkt_generator.hpp>
|
||||||
#include <mapnik/util/vertex_iterator.hpp>
|
#include <mapnik/util/path_iterator.hpp>
|
||||||
#include <mapnik/util/container_adapter.hpp>
|
#include <mapnik/util/container_adapter.hpp>
|
||||||
|
|
||||||
namespace mapnik { namespace util {
|
namespace mapnik { namespace util {
|
||||||
|
|
Loading…
Reference in a new issue