more fixes (dependent names etc)

This commit is contained in:
artemp 2015-04-10 14:17:36 +02:00
parent 61f42b229d
commit d5f9a14b58
2 changed files with 28 additions and 28 deletions

View file

@ -37,7 +37,7 @@ void render(mapnik::geometry::multi_polygon<double> const& geom,
mapnik::box2d<double> const& extent, mapnik::box2d<double> const& extent,
std::string const& name) std::string const& name)
{ {
using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::geometry::polygon_vertex_adapter>; using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::geometry::polygon_vertex_adapter<double>>;
using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>; using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>;
using renderer = agg::renderer_scanline_aa_solid<ren_base>; using renderer = agg::renderer_scanline_aa_solid<ren_base>;
mapnik::image_rgba8 im(256,256); mapnik::image_rgba8 im(256,256);
@ -54,7 +54,7 @@ void render(mapnik::geometry::multi_polygon<double> const& geom,
agg::rasterizer_scanline_aa<> ras; agg::rasterizer_scanline_aa<> ras;
for (auto const& poly : geom) for (auto const& poly : geom)
{ {
mapnik::geometry::polygon_vertex_adapter va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
path_type path(tr,va,prj_trans); path_type path(tr,va,prj_trans);
ras.add_path(path); ras.add_path(path);
} }
@ -69,7 +69,7 @@ class test1 : public benchmark::test_case
mapnik::box2d<double> extent_; mapnik::box2d<double> extent_;
std::string expected_; std::string expected_;
public: public:
using conv_clip = agg::conv_clip_polygon<mapnik::geometry::polygon_vertex_adapter>; using conv_clip = agg::conv_clip_polygon<mapnik::geometry::polygon_vertex_adapter<double>>;
test1(mapnik::parameters const& params, test1(mapnik::parameters const& params,
std::string const& wkt_in, std::string const& wkt_in,
mapnik::box2d<double> const& extent) mapnik::box2d<double> const& extent)
@ -95,7 +95,7 @@ public:
return false; return false;
} }
mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom); mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom);
mapnik::geometry::polygon_vertex_adapter va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
conv_clip clipped(va); conv_clip clipped(va);
@ -180,7 +180,7 @@ public:
{ {
unsigned count = 0; unsigned count = 0;
mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom); mapnik::geometry::polygon<double> const& poly = mapnik::util::get<mapnik::geometry::polygon<double>>(geom);
mapnik::geometry::polygon_vertex_adapter va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
conv_clip clipped(va); conv_clip clipped(va);
clipped.clip_box( clipped.clip_box(
extent_.minx(), extent_.minx(),
@ -212,7 +212,7 @@ class test2 : public benchmark::test_case
mapnik::box2d<double> extent_; mapnik::box2d<double> extent_;
std::string expected_; std::string expected_;
public: public:
using poly_clipper = agg::conv_clipper<mapnik::geometry::polygon_vertex_adapter, agg::path_storage>; using poly_clipper = agg::conv_clipper<mapnik::geometry::polygon_vertex_adapter<double>, agg::path_storage>;
test2(mapnik::parameters const& params, test2(mapnik::parameters const& params,
std::string const& wkt_in, std::string const& wkt_in,
mapnik::box2d<double> const& extent) mapnik::box2d<double> const& extent)
@ -244,7 +244,7 @@ public:
ps.line_to(extent_.maxx(), extent_.maxy()); ps.line_to(extent_.maxx(), extent_.maxy());
ps.line_to(extent_.maxx(), extent_.miny()); ps.line_to(extent_.maxx(), extent_.miny());
ps.close_polygon(); ps.close_polygon();
mapnik::geometry::polygon_vertex_adapter va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
poly_clipper clipped(va,ps, poly_clipper clipped(va,ps,
agg::clipper_and, agg::clipper_and,
agg::clipper_non_zero, agg::clipper_non_zero,
@ -313,7 +313,7 @@ public:
for (unsigned i=0;i<iterations_;++i) for (unsigned i=0;i<iterations_;++i)
{ {
unsigned count = 0; unsigned count = 0;
mapnik::geometry::polygon_vertex_adapter va(poly); mapnik::geometry::polygon_vertex_adapter<double> va(poly);
poly_clipper clipped(va,ps, poly_clipper clipped(va,ps,
agg::clipper_and, agg::clipper_and,
agg::clipper_non_zero, agg::clipper_non_zero,
@ -368,7 +368,7 @@ public:
mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom); mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom);
mapnik::geometry::correct(poly); mapnik::geometry::correct(poly);
std::deque<mapnik::geometry::polygon<double> > result; std::deque<mapnik::geometry::polygon<double> > result;
mapnik::geometry::bounding_box bbox(extent_.minx(),extent_.miny(),extent_.maxx(),extent_.maxy()); mapnik::geometry::bounding_box<double> bbox(extent_.minx(),extent_.miny(),extent_.maxx(),extent_.maxy());
boost::geometry::intersection(bbox,poly,result); boost::geometry::intersection(bbox,poly,result);
std::string expect = expected_+".png"; std::string expect = expected_+".png";
std::string actual = expected_+"_actual.png"; std::string actual = expected_+"_actual.png";
@ -407,7 +407,7 @@ public:
} }
mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom); mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom);
mapnik::geometry::correct(poly); mapnik::geometry::correct(poly);
mapnik::geometry::bounding_box bbox(extent_.minx(),extent_.miny(),extent_.maxx(),extent_.maxy()); mapnik::geometry::bounding_box<double> bbox(extent_.minx(),extent_.miny(),extent_.maxx(),extent_.maxy());
bool valid = true; bool valid = true;
for (unsigned i=0;i<iterations_;++i) for (unsigned i=0;i<iterations_;++i)
{ {
@ -416,7 +416,7 @@ public:
unsigned count = 0; unsigned count = 0;
for (auto const& geom : result) for (auto const& geom : result)
{ {
mapnik::geometry::polygon_vertex_adapter va(geom); mapnik::geometry::polygon_vertex_adapter<double> va(geom);
unsigned cmd; unsigned cmd;
double x,y; double x,y;
while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) { while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) {
@ -567,7 +567,7 @@ public:
} }
mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom); mapnik::geometry::polygon<double> & poly = mapnik::util::get<mapnik::geometry::polygon<double> >(geom);
mapnik::geometry::correct(poly); mapnik::geometry::correct(poly);
mapnik::geometry::bounding_box bbox(extent_.minx(),extent_.miny(),extent_.maxx(),extent_.maxy()); mapnik::geometry::bounding_box<double> bbox(extent_.minx(),extent_.miny(),extent_.maxx(),extent_.maxy());
bool valid = true; bool valid = true;
for (unsigned i=0;i<iterations_;++i) for (unsigned i=0;i<iterations_;++i)
{ {
@ -576,7 +576,7 @@ public:
unsigned count = 0; unsigned count = 0;
for (auto const& geom : result) for (auto const& geom : result)
{ {
mapnik::geometry::polygon_vertex_adapter va(geom); mapnik::geometry::polygon_vertex_adapter<double> va(geom);
unsigned cmd; unsigned cmd;
double x,y; double x,y;
while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) { while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) {

View file

@ -113,8 +113,8 @@ struct geometry_equal_visitor
for(auto const& p : zip_crange(ls1, ls2)) for(auto const& p : zip_crange(ls1, ls2))
{ {
REQUIRE(p.get<0>().x == Approx(p.get<1>().x)); REQUIRE(p.template get<0>().x == Approx(p.template get<1>().x));
REQUIRE(p.get<0>().y == Approx(p.get<1>().y)); REQUIRE(p.template get<0>().y == Approx(p.template get<1>().y));
} }
} }
@ -130,7 +130,7 @@ struct geometry_equal_visitor
for (auto const& p : zip_crange(p1.interior_rings, p2.interior_rings)) for (auto const& p : zip_crange(p1.interior_rings, p2.interior_rings))
{ {
(*this)(static_cast<line_string<T> const&>(p.get<0>()),static_cast<line_string<T> const&>(p.get<1>())); (*this)(static_cast<line_string<T> const&>(p.template get<0>()),static_cast<line_string<T> const&>(p.template get<1>()));
} }
} }
@ -150,7 +150,7 @@ struct geometry_equal_visitor
for (auto const& ls : zip_crange(mls1, mls2)) for (auto const& ls : zip_crange(mls1, mls2))
{ {
(*this)(ls.get<0>(),ls.get<1>()); (*this)(ls.template get<0>(),ls.template get<1>());
} }
} }
@ -164,7 +164,7 @@ struct geometry_equal_visitor
for (auto const& poly : zip_crange(mpoly1, mpoly2)) for (auto const& poly : zip_crange(mpoly1, mpoly2))
{ {
(*this)(poly.get<0>(),poly.get<1>()); (*this)(poly.template get<0>(),poly.template get<1>());
} }
} }
@ -180,7 +180,7 @@ struct geometry_equal_visitor
for (auto const& g : zip_crange(c1, c2)) for (auto const& g : zip_crange(c1, c2))
{ {
assert_g_equal(g.get<0>(),g.get<1>()); assert_g_equal(g.template get<0>(),g.template get<1>());
} }
} }
@ -194,7 +194,7 @@ struct geometry_equal_visitor
for (auto const& g : zip_crange(c1, c2)) for (auto const& g : zip_crange(c1, c2))
{ {
assert_g_equal(g.get<0>(),g.get<1>()); assert_g_equal(g.template get<0>(),g.template get<1>());
} }
} }
}; };