+ move opacity parameter to the base class

(symbolizer_with_image)
+ rename opacity to text_opacity in text_symbolizer
  to avoid name clashing
This commit is contained in:
Artem Pavlenko 2010-06-15 12:27:42 +00:00
parent bb6fafad42
commit 9826cf98c5
5 changed files with 16 additions and 29 deletions

View file

@ -38,11 +38,8 @@ struct MAPNIK_DECL point_symbolizer :
point_symbolizer(point_symbolizer const& rhs);
void set_allow_overlap(bool overlap);
bool get_allow_overlap() const;
void set_opacity(float opacity);
float get_opacity() const;
private:
float opacity_;
bool overlap_;
};
}

View file

@ -42,11 +42,14 @@ public:
void set_filename(path_expression_ptr filename);
void set_transform(transform_type const& );
transform_type const& get_transform() const;
void set_opacity(float opacity);
float get_opacity() const;
protected:
symbolizer_with_image(path_expression_ptr filename);
symbolizer_with_image(symbolizer_with_image const& rhs);
path_expression_ptr image_filename_;
transform_type matrix_;
transform_type matrix_;
float opacity_;
};
}

View file

@ -151,8 +151,8 @@ struct MAPNIK_DECL text_symbolizer
double get_minimum_distance() const;
void set_allow_overlap(bool overlap);
bool get_allow_overlap() const;
void set_opacity(double opacity);
double get_opacity() const;
void set_text_opacity(double opacity);
double get_text_opacity() const;
bool get_wrap_before() const; // wrap text at wrap_char immediately before current work
void set_wrap_before(bool wrap_before);
void set_horizontal_alignment(horizontal_alignment_e valign);
@ -186,7 +186,7 @@ private:
bool avoid_edges_;
double minimum_distance_;
bool overlap_;
double opacity_;
double text_opacity_;
bool wrap_before_;
horizontal_alignment_e halign_;
justify_alignment_e jalign_;

View file

@ -34,17 +34,14 @@ namespace mapnik
{
point_symbolizer::point_symbolizer()
: symbolizer_with_image(path_expression_ptr(new path_expression)), // FIXME
opacity_(1.0),
overlap_(false) {}
point_symbolizer::point_symbolizer(path_expression_ptr file)
: symbolizer_with_image(file),
opacity_(1.0),
overlap_(false) {}
point_symbolizer::point_symbolizer(point_symbolizer const& rhs)
: symbolizer_with_image(rhs),
opacity_(rhs.opacity_),
overlap_(rhs.overlap_)
{}
@ -58,15 +55,5 @@ bool point_symbolizer::get_allow_overlap() const
return overlap_;
}
void point_symbolizer::set_opacity(float opacity)
{
opacity_ = opacity;
}
float point_symbolizer::get_opacity() const
{
return opacity_;
}
}

View file

@ -105,7 +105,7 @@ text_symbolizer::text_symbolizer(expression_ptr name, std::string const& face_na
avoid_edges_(false),
minimum_distance_(0.0),
overlap_(false),
opacity_(1.0),
text_opacity_(1.0),
wrap_before_(false),
halign_(H_MIDDLE),
jalign_(J_MIDDLE) {}
@ -135,7 +135,7 @@ text_symbolizer::text_symbolizer(expression_ptr name, unsigned size, color const
avoid_edges_(false),
minimum_distance_(0.0),
overlap_(false),
opacity_(1.0),
text_opacity_(1.0),
wrap_before_(false),
halign_(H_MIDDLE),
jalign_(J_MIDDLE) {}
@ -166,7 +166,7 @@ text_symbolizer::text_symbolizer(text_symbolizer const& rhs)
avoid_edges_(rhs.avoid_edges_),
minimum_distance_(rhs.minimum_distance_),
overlap_(rhs.overlap_),
opacity_(rhs.opacity_),
text_opacity_(rhs.text_opacity_),
wrap_before_(rhs.wrap_before_),
halign_(rhs.halign_),
jalign_(rhs.jalign_) {}
@ -200,7 +200,7 @@ text_symbolizer& text_symbolizer::operator=(text_symbolizer const& other)
avoid_edges_ = other.avoid_edges_;
minimum_distance_ = other.minimum_distance_;
overlap_ = other.overlap_;
opacity_ = other.opacity_;
text_opacity_ = other.text_opacity_;
wrap_before_ = other.wrap_before_;
halign_ = other.halign_;
jalign_ = other.jalign_;
@ -477,14 +477,14 @@ bool text_symbolizer::get_allow_overlap() const
return overlap_;
}
void text_symbolizer::set_opacity(double opacity)
void text_symbolizer::set_text_opacity(double text_opacity)
{
opacity_ = opacity;
text_opacity_ = text_opacity;
}
double text_symbolizer::get_opacity() const
double text_symbolizer::get_text_opacity() const
{
return opacity_;
return text_opacity_;
}
void text_symbolizer::set_horizontal_alignment(horizontal_alignment_e halign)