added:
1. start/end map/layer handlers 2. some cleanups
This commit is contained in:
parent
bd173527a0
commit
1728bdbc7e
3 changed files with 15 additions and 11 deletions
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "feature_style_processor.hpp"
|
||||
#include <boost/utility.hpp>
|
||||
//#include "agg_font_freetype.h"
|
||||
#include "font_engine_freetype.hpp"
|
||||
|
||||
namespace mapnik
|
||||
|
@ -35,8 +34,8 @@ namespace mapnik
|
|||
agg_renderer(Map const& m, T & pixmap);
|
||||
void start_map_processing();
|
||||
void end_map_processing();
|
||||
void start_layer_processing();
|
||||
void end_layer_processing();
|
||||
void start_layer_processing(Layer const& lay);
|
||||
void end_layer_processing(Layer const& lay);
|
||||
void process(point_symbolizer const& sym,Feature const& feature);
|
||||
void process(line_symbolizer const& sym,Feature const& feature);
|
||||
void process(line_pattern_symbolizer const& sym,Feature const& feature);
|
||||
|
|
|
@ -58,8 +58,10 @@ namespace mapnik
|
|||
void apply()
|
||||
{
|
||||
timer clock;
|
||||
|
||||
Processor & p = static_cast<Processor&>(*this);
|
||||
|
||||
p.start_map_processing();
|
||||
|
||||
std::vector<Layer>::const_iterator itr = m_.layers().begin();
|
||||
while (itr != m_.layers().end())
|
||||
{
|
||||
|
@ -70,11 +72,16 @@ namespace mapnik
|
|||
}
|
||||
++itr;
|
||||
}
|
||||
|
||||
p.end_map_processing();
|
||||
|
||||
clock.stop();
|
||||
|
||||
}
|
||||
private:
|
||||
void apply_to_layer(Layer const& lay,Processor & p)
|
||||
{
|
||||
p.start_layer_processing(lay);
|
||||
datasource *ds=lay.datasource().get();
|
||||
if (ds)
|
||||
{
|
||||
|
@ -87,7 +94,6 @@ namespace mapnik
|
|||
{
|
||||
std::set<std::string> names;
|
||||
attribute_collector<Feature> collector(names);
|
||||
//property_index<Feature> indexer(names);
|
||||
std::vector<rule_type*> if_rules;
|
||||
std::vector<rule_type*> else_rules;
|
||||
|
||||
|
@ -104,10 +110,8 @@ namespace mapnik
|
|||
if (ruleIter->active(scale))
|
||||
{
|
||||
active_rules=true;
|
||||
//filter_ptr& filter=const_cast<filter_ptr&>(ruleIter->get_filter());
|
||||
//filter->accept(collector);
|
||||
ruleIter->accept(collector);
|
||||
//filter->accept(indexer);
|
||||
|
||||
if (ruleIter->has_else_filter())
|
||||
{
|
||||
else_rules.push_back(const_cast<rule_type*>(&(*ruleIter)));
|
||||
|
@ -171,6 +175,7 @@ namespace mapnik
|
|||
}
|
||||
}
|
||||
}
|
||||
p.end_layer_processing(lay);
|
||||
}
|
||||
|
||||
Map const& m_;
|
||||
|
|
|
@ -102,13 +102,13 @@ namespace mapnik
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
void agg_renderer<T>::start_layer_processing()
|
||||
void agg_renderer<T>::start_layer_processing(Layer const& lay)
|
||||
{
|
||||
std::cout << "start layer processing" << std::endl;
|
||||
std::cout << "start layer processing : " << lay.name() << std::endl;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void agg_renderer<T>::end_layer_processing()
|
||||
void agg_renderer<T>::end_layer_processing(Layer const&)
|
||||
{
|
||||
std::cout << "end layer processing" << std::endl;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue