diff --git a/bindings/python/mapnik_line_symbolizer.cpp b/bindings/python/mapnik_line_symbolizer.cpp index 93f96e693..f1ac4c419 100644 --- a/bindings/python/mapnik_line_symbolizer.cpp +++ b/bindings/python/mapnik_line_symbolizer.cpp @@ -43,20 +43,11 @@ void export_line_symbolizer() { using namespace boost::python; - enumeration_("line_rasterizer") - .value("FULL",RASTERIZER_FULL) - .value("FAST",RASTERIZER_FAST) - ; - class_("LineSymbolizer", init<>("Default LineSymbolizer - 1px solid black")) .def(init("TODO")) .def(init()) .def_pickle(line_symbolizer_pickle_suite()) - .add_property("rasterizer", - &line_symbolizer::get_rasterizer, - &line_symbolizer::set_rasterizer, - "Set/get the rasterization method of the line of the point") .add_property("stroke",make_function (&line_symbolizer::get_stroke, return_value_policy()), diff --git a/include/mapnik/line_symbolizer.hpp b/include/mapnik/line_symbolizer.hpp index c95541ce0..0c089c937 100644 --- a/include/mapnik/line_symbolizer.hpp +++ b/include/mapnik/line_symbolizer.hpp @@ -31,37 +31,23 @@ namespace mapnik { -enum line_rasterizer_enum { - RASTERIZER_FULL, // agg::renderer_scanline_aa_solid - RASTERIZER_FAST, // agg::rasterizer_outline_aa, twice as fast but only good for thin lines - line_rasterizer_enum_MAX -}; - -DEFINE_ENUM( line_rasterizer_e, line_rasterizer_enum ); - struct MAPNIK_DECL line_symbolizer : public symbolizer_base { explicit line_symbolizer() : symbolizer_base(), stroke_(), - rasterizer_p_(RASTERIZER_FULL), - smooth_(0.0), offset_(0.0) {} - + line_symbolizer(stroke const& stroke) : symbolizer_base(), stroke_(stroke), - rasterizer_p_(RASTERIZER_FULL), - smooth_(0.0), offset_(0.0) {} line_symbolizer(color const& pen,float width=1.0) : symbolizer_base(), stroke_(pen,width), - rasterizer_p_(RASTERIZER_FULL), - smooth_(0.0), offset_(0.0) {} @@ -74,27 +60,7 @@ struct MAPNIK_DECL line_symbolizer : public symbolizer_base { stroke_ = stk; } - - void set_rasterizer(line_rasterizer_e rasterizer_p) - { - rasterizer_p_ = rasterizer_p; - } - - line_rasterizer_e get_rasterizer() const - { - return rasterizer_p_; - } - - void set_smooth(double smooth) - { - smooth_ = smooth; - } - - double smooth() const - { - return smooth_; - } - + void set_offset(double val) { offset_ = val; @@ -107,8 +73,6 @@ struct MAPNIK_DECL line_symbolizer : public symbolizer_base private: stroke stroke_; - line_rasterizer_e rasterizer_p_; - double smooth_; double offset_; }; } diff --git a/include/mapnik/polygon_pattern_symbolizer.hpp b/include/mapnik/polygon_pattern_symbolizer.hpp index 84370afa7..3c13d2268 100644 --- a/include/mapnik/polygon_pattern_symbolizer.hpp +++ b/include/mapnik/polygon_pattern_symbolizer.hpp @@ -50,13 +50,10 @@ struct MAPNIK_DECL polygon_pattern_symbolizer : double get_gamma() const; void set_gamma_method(gamma_method_e gamma_method); gamma_method_e get_gamma_method() const; - void set_smooth(double smooth); - double smooth() const; private: pattern_alignment_e alignment_; double gamma_; gamma_method_e gamma_method_; - double smooth_; }; } diff --git a/include/mapnik/polygon_symbolizer.hpp b/include/mapnik/polygon_symbolizer.hpp index 2367d095a..8295c9a77 100644 --- a/include/mapnik/polygon_symbolizer.hpp +++ b/include/mapnik/polygon_symbolizer.hpp @@ -44,14 +44,11 @@ struct MAPNIK_DECL polygon_symbolizer : public symbolizer_base double get_gamma() const; void set_gamma_method(gamma_method_e gamma_method); gamma_method_e get_gamma_method() const; - void set_smooth(double smooth); - double smooth() const; private: color fill_; double opacity_; double gamma_; gamma_method_e gamma_method_; - double smooth_; bool clip_; }; diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 42707854f..5c72e98a6 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -103,6 +103,8 @@ public: std::string get_transform_string() const; void set_clip(bool clip); bool clip() const; + void set_smooth(double smooth); + double smooth() const; private: metawriter_properties properties_; metawriter_properties properties_complete_; @@ -111,6 +113,7 @@ private: boost::optional comp_op_; transform_type affine_transform_; bool clip_; + double smooth_value_; }; diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index 4d31894d4..30a8ff548 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -59,13 +59,10 @@ void agg_renderer::process(line_symbolizer const& sym, unsigned g=col.green(); unsigned b=col.blue(); unsigned a=col.alpha(); - - - agg::rendering_buffer buf(current_buffer_->raw_data(),width_,height_, width_ * 4); - + ras_ptr->reset(); set_gamma_method(stroke_, ras_ptr); - //metawriter_with_properties writer = sym.get_metawriter(); + typedef boost::mpl::vector conv_types; vertex_converter,rasterizer,line_symbolizer, proj_transform, CoordTransform,conv_types> converter(query_extent_,*ras_ptr,sym,t_,prj_trans,scale_factor_); diff --git a/src/line_symbolizer.cpp b/src/line_symbolizer.cpp index 51fef9670..97cc2cc1a 100644 --- a/src/line_symbolizer.cpp +++ b/src/line_symbolizer.cpp @@ -26,15 +26,6 @@ namespace mapnik { - -static const char * line_rasterizer_strings[] = { - "full", - "fast", - "" -}; - - -IMPLEMENT_ENUM( line_rasterizer_e, line_rasterizer_strings ) - +// } diff --git a/src/load_map.cpp b/src/load_map.cpp index 679002902..be0a382b4 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -96,7 +96,7 @@ private: void parse_style(Map & map, xml_node const& sty); void parse_layer(Map & map, xml_node const& lay); void parse_metawriter(Map & map, xml_node const& lay); - void parse_metawriter_in_symbolizer(symbolizer_base &sym, xml_node const& pt); + void parse_symbolizer_base(symbolizer_base &sym, xml_node const& pt); void parse_fontset(Map & map, xml_node const & fset); bool parse_font(font_set & fset, xml_node const& f); @@ -819,7 +819,7 @@ void map_parser::parse_rule(feature_type_style & style, xml_node const& r) } } -void map_parser::parse_metawriter_in_symbolizer(symbolizer_base &sym, xml_node const &pt) +void map_parser::parse_symbolizer_base(symbolizer_base &sym, xml_node const &pt) { optional comp_op_name = pt.get_opt_attr("comp-op"); if (comp_op_name) @@ -856,6 +856,10 @@ void map_parser::parse_metawriter_in_symbolizer(symbolizer_base &sym, xml_node c optional clip = pt.get_opt_attr("clip"); if (clip) sym.set_clip(*clip); + // smooth value + optional smooth = pt.get_opt_attr("smooth"); + if (smooth) sym.set_smooth(*smooth); + optional writer = pt.get_opt_attr("meta-writer"); if (!writer) return; optional output = pt.get_opt_attr("meta-output"); @@ -949,7 +953,7 @@ void map_parser::parse_point_symbolizer(rule & rule, xml_node const & sym) } } } - parse_metawriter_in_symbolizer(symbol, sym); + parse_symbolizer_base(symbol, sym); rule.append(symbol); } catch (const config_error & ex) @@ -1075,7 +1079,7 @@ void map_parser::parse_markers_symbolizer(rule & rule, xml_node const& sym) marker_type_e marker_type = sym.get_attr("marker-type", dfl_marker_type); symbol.set_marker_type(marker_type); - parse_metawriter_in_symbolizer(symbol, sym); + parse_symbolizer_base(symbol, sym); rule.append(symbol); } catch (const config_error & ex) @@ -1111,7 +1115,7 @@ void map_parser::parse_line_pattern_symbolizer(rule & rule, xml_node const & sym } line_pattern_symbolizer symbol(expr); - parse_metawriter_in_symbolizer(symbol, sym); + parse_symbolizer_base(symbol, sym); rule.append(symbol); } catch (image_reader_exception const & ex) @@ -1175,11 +1179,7 @@ void map_parser::parse_polygon_pattern_symbolizer(rule & rule, optional gamma_method = sym.get_opt_attr("gamma-method"); if (gamma_method) symbol.set_gamma_method(*gamma_method); - // smooth value - optional smooth = sym.get_opt_attr("smooth"); - if (smooth) symbol.set_smooth(*smooth); - - parse_metawriter_in_symbolizer(symbol, sym); + parse_symbolizer_base(symbol, sym); rule.append(symbol); } catch (image_reader_exception const & ex) @@ -1222,7 +1222,7 @@ void map_parser::parse_text_symbolizer(rule & rule, xml_node const& sym) } text_symbolizer text_symbol = text_symbolizer(placement_finder); - parse_metawriter_in_symbolizer(text_symbol, sym); + parse_symbolizer_base(text_symbol, sym); rule.append(text_symbol); } catch (const config_error & ex) @@ -1304,7 +1304,7 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym) shield_symbol.set_unlock_image(* unlock_image); } - parse_metawriter_in_symbolizer(shield_symbol, sym); + parse_symbolizer_base(shield_symbol, sym); std::string image_file = sym.get_attr("file"); optional base = sym.get_opt_attr("base"); @@ -1426,21 +1426,13 @@ void map_parser::parse_line_symbolizer(rule & rule, xml_node const & sym) stroke strk; parse_stroke(strk,sym); line_symbolizer symbol = line_symbolizer(strk); - - // rasterizer method - line_rasterizer_e rasterizer = sym.get_attr("rasterizer", RASTERIZER_FULL); - //optional rasterizer_method = sym.get_opt_attr("full"); - symbol.set_rasterizer(rasterizer); - // smooth value - optional smooth = sym.get_opt_attr("smooth"); - if (smooth) symbol.set_smooth(*smooth); // offset value optional offset = sym.get_opt_attr("offset"); if (offset) symbol.set_offset(*offset); // meta-writer - parse_metawriter_in_symbolizer(symbol, sym); + parse_symbolizer_base(symbol, sym); rule.append(symbol); } catch (const config_error & ex) @@ -1468,11 +1460,8 @@ void map_parser::parse_polygon_symbolizer(rule & rule, xml_node const & sym) // gamma method optional gamma_method = sym.get_opt_attr("gamma-method"); if (gamma_method) poly_sym.set_gamma_method(*gamma_method); - // smooth value - optional smooth = sym.get_opt_attr("smooth"); - if (smooth) poly_sym.set_smooth(*smooth); - parse_metawriter_in_symbolizer(poly_sym, sym); + parse_symbolizer_base(poly_sym, sym); rule.append(poly_sym); } catch (const config_error & ex) @@ -1498,7 +1487,7 @@ void map_parser::parse_building_symbolizer(rule & rule, xml_node const & sym) optional height = sym.get_opt_attr("height"); if (height) building_sym.set_height(*height); - parse_metawriter_in_symbolizer(building_sym, sym); + parse_symbolizer_base(building_sym, sym); rule.append(building_sym); } catch (const config_error & ex) diff --git a/src/polygon_pattern_symbolizer.cpp b/src/polygon_pattern_symbolizer.cpp index 449d5b40f..4a2e60c31 100644 --- a/src/polygon_pattern_symbolizer.cpp +++ b/src/polygon_pattern_symbolizer.cpp @@ -38,15 +38,13 @@ polygon_pattern_symbolizer::polygon_pattern_symbolizer(path_expression_ptr file) : symbolizer_with_image(file), symbolizer_base(), alignment_(LOCAL_ALIGNMENT), gamma_(1.0), - gamma_method_(GAMMA_POWER), - smooth_(0.0) {} + gamma_method_(GAMMA_POWER) {} polygon_pattern_symbolizer::polygon_pattern_symbolizer(polygon_pattern_symbolizer const& rhs) : symbolizer_with_image(rhs), symbolizer_base(rhs), alignment_(rhs.alignment_), gamma_(rhs.gamma_), - gamma_method_(rhs.gamma_method_), - smooth_(rhs.smooth_) {} + gamma_method_(rhs.gamma_method_) {} pattern_alignment_e polygon_pattern_symbolizer::get_alignment() const { @@ -78,15 +76,5 @@ gamma_method_e polygon_pattern_symbolizer::get_gamma_method() const return gamma_method_; } -void polygon_pattern_symbolizer::set_smooth(double smooth) -{ - smooth_ = smooth; -} - -double polygon_pattern_symbolizer::smooth() const -{ - return smooth_; -} - } diff --git a/src/polygon_symbolizer.cpp b/src/polygon_symbolizer.cpp index 4ca4e423b..be75b87a5 100644 --- a/src/polygon_symbolizer.cpp +++ b/src/polygon_symbolizer.cpp @@ -39,8 +39,7 @@ polygon_symbolizer::polygon_symbolizer(color const& fill) fill_(fill), opacity_(1.0), gamma_(1.0), - gamma_method_(GAMMA_POWER), - smooth_(0.0) + gamma_method_(GAMMA_POWER) {} color const& polygon_symbolizer::get_fill() const @@ -83,14 +82,4 @@ gamma_method_e polygon_symbolizer::get_gamma_method() const return gamma_method_; } -void polygon_symbolizer::set_smooth(double smooth) -{ - smooth_ = smooth; -} - -double polygon_symbolizer::smooth() const -{ - return smooth_; -} - } diff --git a/src/save_map.cpp b/src/save_map.cpp index 17f273205..1f328a53c 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -84,16 +84,6 @@ public: const stroke & strk = sym.get_stroke(); add_stroke_attributes(sym_node, strk); add_metawriter_attributes(sym_node, sym); - - line_symbolizer dfl; - if ( sym.get_rasterizer() != dfl.get_rasterizer() || explicit_defaults_ ) - { - set_attr( sym_node, "rasterizer", sym.get_rasterizer() ); - } - if ( sym.smooth() != dfl.smooth() || explicit_defaults_ ) - { - set_attr( sym_node, "smooth", sym.smooth() ); - } } void operator () ( line_pattern_symbolizer const& sym ) @@ -128,10 +118,6 @@ public: { set_attr( sym_node, "gamma-method", sym.get_gamma_method() ); } - if ( sym.smooth() != dfl.smooth() || explicit_defaults_ ) - { - set_attr( sym_node, "smooth", sym.smooth() ); - } add_metawriter_attributes(sym_node, sym); } diff --git a/src/symbolizer.cpp b/src/symbolizer.cpp index e8d43f90d..644708cba 100644 --- a/src/symbolizer.cpp +++ b/src/symbolizer.cpp @@ -108,6 +108,15 @@ bool symbolizer_base::clip() const return clip_; } +void symbolizer_base::set_smooth(double smooth) +{ + smooth_value_ = smooth; +} + +double symbolizer_base::smooth() const +{ + return smooth_value_; +} /////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/xml_tree.cpp b/src/xml_tree.cpp index 6ff31e7d9..8769dc941 100644 --- a/src/xml_tree.cpp +++ b/src/xml_tree.cpp @@ -461,7 +461,6 @@ compile_get_opt_attr(float); compile_get_opt_attr(double); compile_get_opt_attr(color); compile_get_opt_attr(gamma_method_e); -compile_get_opt_attr(line_rasterizer_e); compile_get_opt_attr(line_join_e); compile_get_opt_attr(line_cap_e); compile_get_opt_attr(text_transform_e); @@ -476,7 +475,6 @@ compile_get_attr(point_placement_e); compile_get_attr(marker_placement_e); compile_get_attr(marker_type_e); compile_get_attr(pattern_alignment_e); -compile_get_attr(line_rasterizer_e); compile_get_attr(colorizer_mode); compile_get_attr(double); compile_get_value(int);