From 44538e29d4a9db46a6d0cdc3383c8e97ed6fa02f Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sun, 27 May 2012 09:11:46 +0200 Subject: [PATCH] agg::conv_transform: changed transformer to non-const reference (replaces ba270e0) --- deps/agg/include/agg_conv_transform.h | 15 ++++++--------- include/mapnik/vertex_converters.hpp | 13 +++++++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/deps/agg/include/agg_conv_transform.h b/deps/agg/include/agg_conv_transform.h index 84eb736cc..b57fb07fa 100644 --- a/deps/agg/include/agg_conv_transform.h +++ b/deps/agg/include/agg_conv_transform.h @@ -29,11 +29,8 @@ namespace agg template class conv_transform { public: - explicit conv_transform(VertexSource& source) : - m_source(&source), m_trans() {} - - conv_transform(VertexSource& source, const Transformer& tr) : - m_source(&source), m_trans(tr) {} + conv_transform(VertexSource& source, Transformer& tr) : + m_source(&source), m_trans(&tr) {} void attach(VertexSource& source) { m_source = &source; } @@ -47,14 +44,14 @@ namespace agg unsigned cmd = m_source->vertex(x, y); if(is_vertex(cmd)) { - m_trans.transform(x, y); + m_trans->transform(x, y); } return cmd; } - void transformer(const Transformer& tr) + void transformer(Transformer& tr) { - m_trans = tr; + m_trans = &tr; } private: @@ -63,7 +60,7 @@ namespace agg operator = (const conv_transform&); VertexSource* m_source; - Transformer m_trans; + const Transformer* m_trans; }; diff --git a/include/mapnik/vertex_converters.hpp b/include/mapnik/vertex_converters.hpp index ddfc69728..c6a75f409 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -190,16 +190,21 @@ template struct converter_traits { typedef T geometry_type; - typedef typename agg::conv_transform conv_type; + + struct conv_type : public agg::conv_transform + { + agg::trans_affine trans_; + + conv_type(geometry_type& geom) + : agg::conv_transform(geom, trans_) {} + }; template static void setup(geometry_type & geom, Args & args) { typename boost::mpl::at >::type sym = boost::fusion::at_c<2>(args); - agg::trans_affine tr; boost::array const& m = sym.get_transform(); - tr.load_from(&m[0]); - geom.transformer(tr); + geom.trans_.load_from(&m[0]); } };