From 72e31d276841400af814643d7280497df0f6aa56 Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 9 Mar 2015 16:57:19 +0100 Subject: [PATCH] update to use mapnik-geometry --- src/cairo/process_line_pattern_symbolizer.cpp | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index 783d84694..b3d0274bd 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -29,9 +29,11 @@ #include #include #include +#include #include #include #include +#include namespace mapnik { @@ -49,9 +51,9 @@ struct cairo_renderer_process_visitor_l width_(width), height_(height) {} - std::shared_ptr operator() (mapnik::marker_null const&) + std::shared_ptr operator() (mapnik::marker_null const&) { - throw std::runtime_error("This should not have been reached."); + throw std::runtime_error("This should not have been reached."); } std::shared_ptr operator() (mapnik::marker_svg const& marker) @@ -101,7 +103,7 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, } mapnik::marker const& marker = marker_cache::instance().find(filename, true); - + if (marker.is()) return; unsigned width = marker.width(); @@ -116,7 +118,7 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, width, height); std::shared_ptr pattern = util::apply_visitor(visit, marker); - + context_.set_line_width(height); pattern->set_extend(CAIRO_EXTEND_REPEAT); @@ -141,12 +143,13 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, using rasterizer_type = line_pattern_rasterizer; rasterizer_type ras(context_, *pattern, width, height); - vertex_converter - converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); + using vertex_converter_type = vertex_converter; + + vertex_converter_type converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -155,18 +158,10 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter -// FIXME -#if 0 - - for (auto const& geom : feature.paths()) - { - if (geom.size() > 1) - { - vertex_adapter va(geom); - converter.apply(va); - } - } -#endif + using apply_vertex_converter_type = detail::apply_vertex_converter; + using vertex_processor_type = new_geometry::vertex_processor; + apply_vertex_converter_type apply(converter); + mapnik::util::apply_visitor(vertex_processor_type(apply), feature.get_geometry()); } template void cairo_renderer::process(line_pattern_symbolizer const&,