1. start/end map/layer handlers 
2. some cleanups
This commit is contained in:
Artem Pavlenko 2006-02-21 20:17:08 +00:00
parent bd173527a0
commit 1728bdbc7e
3 changed files with 15 additions and 11 deletions

View file

@ -23,7 +23,6 @@
#include "feature_style_processor.hpp" #include "feature_style_processor.hpp"
#include <boost/utility.hpp> #include <boost/utility.hpp>
//#include "agg_font_freetype.h"
#include "font_engine_freetype.hpp" #include "font_engine_freetype.hpp"
namespace mapnik namespace mapnik
@ -35,8 +34,8 @@ namespace mapnik
agg_renderer(Map const& m, T & pixmap); agg_renderer(Map const& m, T & pixmap);
void start_map_processing(); void start_map_processing();
void end_map_processing(); void end_map_processing();
void start_layer_processing(); void start_layer_processing(Layer const& lay);
void end_layer_processing(); void end_layer_processing(Layer const& lay);
void process(point_symbolizer const& sym,Feature const& feature); void process(point_symbolizer const& sym,Feature const& feature);
void process(line_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); void process(line_pattern_symbolizer const& sym,Feature const& feature);

View file

@ -58,8 +58,10 @@ namespace mapnik
void apply() void apply()
{ {
timer clock; timer clock;
Processor & p = static_cast<Processor&>(*this); Processor & p = static_cast<Processor&>(*this);
p.start_map_processing();
std::vector<Layer>::const_iterator itr = m_.layers().begin(); std::vector<Layer>::const_iterator itr = m_.layers().begin();
while (itr != m_.layers().end()) while (itr != m_.layers().end())
{ {
@ -70,11 +72,16 @@ namespace mapnik
} }
++itr; ++itr;
} }
p.end_map_processing();
clock.stop(); clock.stop();
} }
private: private:
void apply_to_layer(Layer const& lay,Processor & p) void apply_to_layer(Layer const& lay,Processor & p)
{ {
p.start_layer_processing(lay);
datasource *ds=lay.datasource().get(); datasource *ds=lay.datasource().get();
if (ds) if (ds)
{ {
@ -87,7 +94,6 @@ namespace mapnik
{ {
std::set<std::string> names; std::set<std::string> names;
attribute_collector<Feature> collector(names); attribute_collector<Feature> collector(names);
//property_index<Feature> indexer(names);
std::vector<rule_type*> if_rules; std::vector<rule_type*> if_rules;
std::vector<rule_type*> else_rules; std::vector<rule_type*> else_rules;
@ -104,10 +110,8 @@ namespace mapnik
if (ruleIter->active(scale)) if (ruleIter->active(scale))
{ {
active_rules=true; active_rules=true;
//filter_ptr& filter=const_cast<filter_ptr&>(ruleIter->get_filter());
//filter->accept(collector);
ruleIter->accept(collector); ruleIter->accept(collector);
//filter->accept(indexer);
if (ruleIter->has_else_filter()) if (ruleIter->has_else_filter())
{ {
else_rules.push_back(const_cast<rule_type*>(&(*ruleIter))); else_rules.push_back(const_cast<rule_type*>(&(*ruleIter)));
@ -171,6 +175,7 @@ namespace mapnik
} }
} }
} }
p.end_layer_processing(lay);
} }
Map const& m_; Map const& m_;

View file

@ -102,13 +102,13 @@ namespace mapnik
} }
template <typename T> 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> 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; std::cout << "end layer processing" << std::endl;
} }