finish moving symbolizers out of rule
This commit is contained in:
parent
bf5ffd04f4
commit
20a317860d
10 changed files with 20 additions and 19 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <mapnik/expression_string.hpp>
|
||||
|
||||
using mapnik::rule;
|
||||
using mapnik::symbolizers;
|
||||
using mapnik::expr_node;
|
||||
using mapnik::expression_ptr;
|
||||
using mapnik::Feature;
|
||||
|
@ -62,8 +63,8 @@ void export_rule()
|
|||
implicitly_convertible<text_symbolizer,symbolizer>();
|
||||
implicitly_convertible<markers_symbolizer,symbolizer>();
|
||||
|
||||
class_<rule::symbolizers>("Symbolizers",init<>("TODO"))
|
||||
.def(vector_indexing_suite<rule::symbolizers>())
|
||||
class_<symbolizers>("Symbolizers",init<>("TODO"))
|
||||
.def(vector_indexing_suite<symbolizers>())
|
||||
;
|
||||
|
||||
class_<rule>("Rule",init<>("default constructor"))
|
||||
|
|
|
@ -323,7 +323,7 @@ StyleModel::StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent)
|
|||
for ( ; itr2 != rules.end();++itr2)
|
||||
{
|
||||
node* rule_n = style_n->add_child(new node(rule_node(QString("Rule"),*itr2),style_n));
|
||||
mapnik::rule::symbolizers::const_iterator itr3 = (*itr2).begin();
|
||||
mapnik::symbolizers::const_iterator itr3 = (*itr2).begin();
|
||||
for ( ; itr3 !=itr2->end();++itr3)
|
||||
{
|
||||
rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
feature_impl & feature,
|
||||
proj_transform const& prj_trans);
|
||||
|
||||
inline bool process(rule::symbolizers const& /*syms*/,
|
||||
inline bool process(symbolizers const& /*syms*/,
|
||||
mapnik::feature_impl & /*feature*/,
|
||||
proj_transform const& /*prj_trans*/)
|
||||
{
|
||||
|
|
|
@ -220,8 +220,8 @@ public:
|
|||
template <typename RuleType>
|
||||
void operator() (RuleType const& r)
|
||||
{
|
||||
typename RuleType::symbolizers const& symbols = r.get_symbolizers();
|
||||
typename RuleType::symbolizers::const_iterator symIter=symbols.begin();
|
||||
symbolizers const& symbols = r.get_symbolizers();
|
||||
symbolizers::const_iterator symIter=symbols.begin();
|
||||
symbolizer_attributes s_attr(names_);
|
||||
while (symIter != symbols.end())
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
void process(markers_symbolizer const& sym,
|
||||
mapnik::feature_impl & feature,
|
||||
proj_transform const& prj_trans);
|
||||
inline bool process(rule::symbolizers const& /*syms*/,
|
||||
inline bool process(symbolizers const& /*syms*/,
|
||||
mapnik::feature_impl & /*feature*/,
|
||||
proj_transform const& /*prj_trans*/)
|
||||
{
|
||||
|
|
|
@ -398,9 +398,9 @@ void feature_style_processor<Processor>::apply_to_layer(layer const& lay, Proces
|
|||
ds->type() == datasource::Raster &&
|
||||
ds->params().get<double>("filter_factor",0.0) == 0.0)
|
||||
{
|
||||
rule::symbolizers const& symbols = r.get_symbolizers();
|
||||
rule::symbolizers::const_iterator symIter = symbols.begin();
|
||||
rule::symbolizers::const_iterator symEnd = symbols.end();
|
||||
symbolizers const& symbols = r.get_symbolizers();
|
||||
symbolizers::const_iterator symIter = symbols.begin();
|
||||
symbolizers::const_iterator symEnd = symbols.end();
|
||||
while (symIter != symEnd)
|
||||
{
|
||||
// if multiple raster symbolizers, last will be respected
|
||||
|
@ -548,7 +548,7 @@ void feature_style_processor<Processor>::render_style(
|
|||
|
||||
do_else=false;
|
||||
do_also=true;
|
||||
rule::symbolizers const& symbols = r->get_symbolizers();
|
||||
symbolizers const& symbols = r->get_symbolizers();
|
||||
|
||||
// if the underlying renderer is not able to process the complete set of symbolizers,
|
||||
// process one by one.
|
||||
|
@ -577,7 +577,7 @@ void feature_style_processor<Processor>::render_style(
|
|||
|
||||
p.painted(true);
|
||||
|
||||
rule::symbolizers const& symbols = r->get_symbolizers();
|
||||
symbolizers const& symbols = r->get_symbolizers();
|
||||
// if the underlying renderer is not able to process the complete set of symbolizers,
|
||||
// process one by one.
|
||||
if(!p.process(symbols,*feature,prj_trans))
|
||||
|
@ -599,7 +599,7 @@ void feature_style_processor<Processor>::render_style(
|
|||
|
||||
p.painted(true);
|
||||
|
||||
rule::symbolizers const& symbols = r->get_symbolizers();
|
||||
symbolizers const& symbols = r->get_symbolizers();
|
||||
// if the underlying renderer is not able to process the complete set of symbolizers,
|
||||
// process one by one.
|
||||
if(!p.process(symbols,*feature,prj_trans))
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
void process(markers_symbolizer const& sym,
|
||||
mapnik::feature_impl & feature,
|
||||
proj_transform const& prj_trans);
|
||||
inline bool process(rule::symbolizers const& /*syms*/,
|
||||
inline bool process(symbolizers const& /*syms*/,
|
||||
mapnik::feature_impl & /*feature*/,
|
||||
proj_transform const& /*prj_trans*/)
|
||||
{
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
* @brief Overload that process the whole set of symbolizers of a rule.
|
||||
* @return true, meaning that this renderer can process multiple symbolizers.
|
||||
*/
|
||||
bool process(rule::symbolizers const& syms,
|
||||
bool process(symbolizers const& syms,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
|
||||
|
|
|
@ -543,8 +543,8 @@ void serialize_rule( ptree & style_node, const rule & r, bool explicit_defaults)
|
|||
max_scale.put_value( r.get_max_scale() );
|
||||
}
|
||||
|
||||
rule::symbolizers::const_iterator begin = r.get_symbolizers().begin();
|
||||
rule::symbolizers::const_iterator end = r.get_symbolizers().end();
|
||||
symbolizers::const_iterator begin = r.get_symbolizers().begin();
|
||||
symbolizers::const_iterator end = r.get_symbolizers().end();
|
||||
serialize_symbolizer serializer( rule_node, explicit_defaults);
|
||||
std::for_each( begin, end , boost::apply_visitor( serializer ));
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
namespace mapnik {
|
||||
|
||||
template <typename OutputIterator>
|
||||
bool svg_renderer<OutputIterator>::process(rule::symbolizers const& syms,
|
||||
bool svg_renderer<OutputIterator>::process(symbolizers const& syms,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ bool svg_renderer<OutputIterator>::process(rule::symbolizers const& syms,
|
|||
return true;
|
||||
};
|
||||
|
||||
template bool svg_renderer<std::ostream_iterator<char> >::process(rule::symbolizers const& syms,
|
||||
template bool svg_renderer<std::ostream_iterator<char> >::process(symbolizers const& syms,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue