add back AlsoFilter support - re-closes #820

This commit is contained in:
Dane Springmeyer 2011-09-02 13:10:14 +00:00
parent 3c2b154c52
commit 914ad079ec

View file

@ -338,6 +338,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
std::vector<rule*> if_rules;
std::vector<rule*> else_rules;
std::vector<rule*> also_rules;
std::vector<rule> const& rules=style->get_rules();
@ -354,6 +355,10 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
{
else_rules.push_back(const_cast<rule*>(&r));
}
else if (r.has_also_filter())
{
also_rules.push_back(const_cast<rule*>(&r));
}
else
{
if_rules.push_back(const_cast<rule*>(&r));
@ -401,6 +406,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
#endif
bool do_else=true;
bool do_also=false;
if (cache_features)
{
@ -418,6 +424,7 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
#endif
do_else=false;
do_also=true;
rule::symbolizers const& symbols = r->get_symbolizers();
// if the underlying renderer is not able to process the complete set of symbolizers,
@ -461,6 +468,28 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
}
}
}
if (do_also)
{
BOOST_FOREACH( rule * r, also_rules )
{
#if defined(RENDERING_STATS)
feat_processed = true;
#endif
rule::symbolizers const& symbols = r->get_symbolizers();
// if the underlying renderer is not able to process the complete set of symbolizers,
// process one by one.
#ifdef SVG_RENDERER
if(!p.process(symbols,*feature,prj_trans))
#endif
{
BOOST_FOREACH (symbolizer const& sym, symbols)
{
boost::apply_visitor(symbol_dispatch(p,*feature,prj_trans),sym);
}
}
}
}
#if defined(RENDERING_STATS)
if (feat_processed)
feature_processed_count++;