+ remove explicit keyword

+ make width and height 'optional' - default init (0)
+ change members order
This commit is contained in:
artemp 2012-07-09 10:18:41 +01:00
parent cde0c0217d
commit 20d935ea1e
2 changed files with 14 additions and 14 deletions

View file

@ -49,9 +49,14 @@ struct MAPNIK_DECL markers_symbolizer :
public symbolizer_with_image, public symbolizer_base public symbolizer_with_image, public symbolizer_base
{ {
public: public:
explicit markers_symbolizer(); markers_symbolizer();
markers_symbolizer(path_expression_ptr const& filename); markers_symbolizer(path_expression_ptr const& filename);
markers_symbolizer(markers_symbolizer const& rhs); markers_symbolizer(markers_symbolizer const& rhs);
void set_width(expression_ptr const& width);
expression_ptr const& get_width() const;
void set_height(expression_ptr const& height);
expression_ptr const& get_height() const;
void set_ignore_placement(bool ignore_placement); void set_ignore_placement(bool ignore_placement);
bool get_ignore_placement() const; bool get_ignore_placement() const;
void set_allow_overlap(bool overlap); void set_allow_overlap(bool overlap);
@ -60,10 +65,6 @@ public:
double get_spacing() const; double get_spacing() const;
void set_max_error(double max_error); void set_max_error(double max_error);
double get_max_error() const; double get_max_error() const;
void set_width(expression_ptr const&width);
expression_ptr const& get_width() const;
void set_height(expression_ptr const& height);
expression_ptr const& get_height() const;
void set_fill(color const& fill); void set_fill(color const& fill);
boost::optional<color> get_fill() const; boost::optional<color> get_fill() const;
void set_stroke(stroke const& stroke); void set_stroke(stroke const& stroke);
@ -71,16 +72,15 @@ public:
void set_marker_placement(marker_placement_e marker_p); void set_marker_placement(marker_placement_e marker_p);
marker_placement_e get_marker_placement() const; marker_placement_e get_marker_placement() const;
private: private:
expression_ptr width_;
expression_ptr height_;
bool ignore_placement_; bool ignore_placement_;
bool allow_overlap_; bool allow_overlap_;
double spacing_; double spacing_;
double max_error_; double max_error_;
expression_ptr width_;
expression_ptr height_;
boost::optional<color> fill_; boost::optional<color> fill_;
boost::optional<stroke> stroke_; boost::optional<stroke> stroke_;
marker_placement_e marker_p_; marker_placement_e marker_p_;
}; };
} }

View file

@ -39,34 +39,34 @@ IMPLEMENT_ENUM( marker_placement_e, marker_placement_strings )
markers_symbolizer::markers_symbolizer() markers_symbolizer::markers_symbolizer()
: symbolizer_with_image(path_expression_ptr(new path_expression)), : symbolizer_with_image(path_expression_ptr(new path_expression)),
symbolizer_base(), symbolizer_base(),
width_(),
height_(),
ignore_placement_(false), ignore_placement_(false),
allow_overlap_(false), allow_overlap_(false),
spacing_(100.0), spacing_(100.0),
max_error_(0.2), max_error_(0.2),
width_(boost::make_shared<expr_node>(10.0)),
height_(boost::make_shared<expr_node>(10.0)),
marker_p_(MARKER_LINE_PLACEMENT) {} marker_p_(MARKER_LINE_PLACEMENT) {}
markers_symbolizer::markers_symbolizer(path_expression_ptr const& filename) markers_symbolizer::markers_symbolizer(path_expression_ptr const& filename)
: symbolizer_with_image(filename), : symbolizer_with_image(filename),
symbolizer_base(), symbolizer_base(),
width_(),
height_(),
ignore_placement_(false), ignore_placement_(false),
allow_overlap_(false), allow_overlap_(false),
spacing_(100.0), spacing_(100.0),
max_error_(0.2), max_error_(0.2),
width_(boost::make_shared<expr_node>(10.0)),
height_(boost::make_shared<expr_node>(10.0)),
marker_p_(MARKER_LINE_PLACEMENT) {} marker_p_(MARKER_LINE_PLACEMENT) {}
markers_symbolizer::markers_symbolizer(markers_symbolizer const& rhs) markers_symbolizer::markers_symbolizer(markers_symbolizer const& rhs)
: symbolizer_with_image(rhs), : symbolizer_with_image(rhs),
symbolizer_base(rhs), symbolizer_base(rhs),
width_(rhs.width_),
height_(rhs.height_),
ignore_placement_(rhs.ignore_placement_), ignore_placement_(rhs.ignore_placement_),
allow_overlap_(rhs.allow_overlap_), allow_overlap_(rhs.allow_overlap_),
spacing_(rhs.spacing_), spacing_(rhs.spacing_),
max_error_(rhs.max_error_), max_error_(rhs.max_error_),
width_(rhs.width_),
height_(rhs.height_),
fill_(rhs.fill_), fill_(rhs.fill_),
stroke_(rhs.stroke_), stroke_(rhs.stroke_),
marker_p_(rhs.marker_p_) {} marker_p_(rhs.marker_p_) {}