+ use vertex_converters
This commit is contained in:
parent
738ff501fe
commit
e513b4772d
1 changed files with 15 additions and 6 deletions
|
@ -28,7 +28,7 @@
|
||||||
#include <mapnik/marker.hpp>
|
#include <mapnik/marker.hpp>
|
||||||
#include <mapnik/marker_cache.hpp>
|
#include <mapnik/marker_cache.hpp>
|
||||||
#include <mapnik/expression_evaluator.hpp>
|
#include <mapnik/expression_evaluator.hpp>
|
||||||
|
#include <mapnik/vertex_converters.hpp>
|
||||||
// agg
|
// agg
|
||||||
#include "agg_basics.h"
|
#include "agg_basics.h"
|
||||||
#include "agg_rendering_buffer.h"
|
#include "agg_rendering_buffer.h"
|
||||||
|
@ -129,19 +129,28 @@ void agg_renderer<T>::process(polygon_pattern_symbolizer const& sym,
|
||||||
|
|
||||||
span_gen_type sg(img_src, offset_x, offset_y);
|
span_gen_type sg(img_src, offset_x, offset_y);
|
||||||
renderer_type rp(renb,sa, sg);
|
renderer_type rp(renb,sa, sg);
|
||||||
|
|
||||||
//metawriter_with_properties writer = sym.get_metawriter();
|
//metawriter_with_properties writer = sym.get_metawriter();
|
||||||
|
|
||||||
|
box2d<double> inflated_extent = query_extent_ * 1.1;
|
||||||
|
typedef boost::mpl::vector<clip_poly_tag,transform_tag> conv_types;
|
||||||
|
vertex_converter<box2d<double>,rasterizer,polygon_pattern_symbolizer, proj_transform, CoordTransform,conv_types>
|
||||||
|
converter(inflated_extent,*ras_ptr,sym,t_,prj_trans);
|
||||||
|
|
||||||
|
//if (sym.clip())
|
||||||
|
converter.set<clip_poly_tag>(); //optional clip (default: true)
|
||||||
|
converter.set<transform_tag>(); //always transform
|
||||||
|
//if (sym.smooth() > 0.0) converter.set<smooth_tag>(); // optional smooth converter
|
||||||
|
|
||||||
for (unsigned i=0;i<num_geometries;++i)
|
for (unsigned i=0;i<num_geometries;++i)
|
||||||
{
|
{
|
||||||
geometry_type & geom = feature->get_geometry(i);
|
geometry_type & geom = feature->get_geometry(i);
|
||||||
if (geom.num_points() > 2)
|
if (geom.num_points() > 2)
|
||||||
{
|
{
|
||||||
clipped_geometry_type clipped(geom);
|
converter.apply(geom);
|
||||||
clipped.clip_box(query_extent_.minx(),query_extent_.miny(),query_extent_.maxx(),query_extent_.maxy());
|
|
||||||
path_type path(t_,clipped,prj_trans);
|
|
||||||
ras_ptr->add_path(path);
|
|
||||||
//if (writer.first) writer.first->add_polygon(path, *feature, t_, writer.second);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
agg::render_scanlines(*ras_ptr, sl, rp);
|
agg::render_scanlines(*ras_ptr, sl, rp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue