This commit is contained in:
Dane Springmeyer 2013-01-03 23:54:04 -08:00
parent 5c0e52b979
commit 0812ac871d
4 changed files with 17 additions and 15 deletions

View file

@ -83,29 +83,29 @@ expression_ptr expression_format::get_expression(xml_node const& xml, std::strin
}
void expression_format::apply(char_properties const& p, const Feature &feature, processed_text &output) const
void expression_format::apply(char_properties const& p, const feature_impl &feature, processed_text &output) const
{
char_properties new_properties = p;
if (face_name) new_properties.face_name =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *face_name).to_string();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *face_name).to_string();
if (text_size) new_properties.text_size =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *text_size).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *text_size).to_double();
if (character_spacing) new_properties.character_spacing =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *character_spacing).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *character_spacing).to_double();
if (line_spacing) new_properties.line_spacing =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *line_spacing).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *line_spacing).to_double();
if (text_opacity) new_properties.text_opacity =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *text_opacity).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *text_opacity).to_double();
if (wrap_before) new_properties.wrap_before =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *wrap_before).to_bool();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *wrap_before).to_bool();
if (wrap_char) new_properties.wrap_char =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *character_spacing).to_unicode()[0];
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *character_spacing).to_unicode()[0];
// if (fill) new_properties.fill =
// boost::apply_visitor(evaluate<Feature,value_type>(feature), *fill).to_color();
// boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *fill).to_color();
// if (halo_fill) new_properties.halo_fill =
// boost::apply_visitor(evaluate<Feature,value_type>(feature), *halo_fill).to_color();
// boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *halo_fill).to_color();
if (halo_radius) new_properties.halo_radius =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *halo_radius).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *halo_radius).to_double();
if (child_) {
child_->apply(new_properties, feature, output);

View file

@ -22,6 +22,7 @@
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/formatting/format.hpp>
#include <mapnik/ptree_helpers.hpp>
#include <mapnik/xml_node.hpp>
@ -77,7 +78,7 @@ node_ptr format_node::from_xml(xml_node const& xml)
}
void format_node::apply(char_properties const& p, const Feature &feature, processed_text &output) const
void format_node::apply(char_properties const& p, const feature_impl &feature, processed_text &output) const
{
char_properties new_properties = p;
if (face_name) new_properties.face_name = *face_name;

View file

@ -22,6 +22,7 @@
// mapnik
#include <mapnik/formatting/list.hpp>
#include <mapnik/feature.hpp>
// boost
#include <boost/foreach.hpp>
@ -42,7 +43,7 @@ void list_node::to_xml(boost::property_tree::ptree & xml) const
}
void list_node::apply(char_properties const& p, Feature const& feature, processed_text &output) const
void list_node::apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
BOOST_FOREACH(node_ptr const& node, children_)
{

View file

@ -50,9 +50,9 @@ node_ptr text_node::from_xml(xml_node const& xml)
return boost::make_shared<text_node>(xml.get_value<expression_ptr>());
}
void text_node::apply(char_properties const& p, Feature const& feature, processed_text &output) const
void text_node::apply(char_properties const& p, feature_impl const& feature, processed_text &output) const
{
UnicodeString text_str = boost::apply_visitor(evaluate<Feature,value_type>(feature), *text_).to_unicode();
UnicodeString text_str = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *text_).to_unicode();
if (p.text_transform == UPPERCASE)
{
text_str = text_str.toUpper();