00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef AGG_RENDERER_HPP
00026 #define AGG_RENDERER_HPP
00027
00028
00029 #include <mapnik/config.hpp>
00030 #include <mapnik/feature_style_processor.hpp>
00031 #include <mapnik/font_engine_freetype.hpp>
00032 #include <mapnik/label_collision_detector.hpp>
00033 #include <mapnik/placement_finder.hpp>
00034 #include <mapnik/map.hpp>
00035
00036
00037 #include <boost/utility.hpp>
00038 #include <boost/scoped_ptr.hpp>
00039
00040 namespace mapnik {
00041
00042 class rasterizer;
00043
00044 template <typename T>
00045 class MAPNIK_DECL agg_renderer : public feature_style_processor<agg_renderer<T> >,
00046 private boost::noncopyable
00047 {
00048
00049 public:
00050 agg_renderer(Map const& m, T & pixmap, unsigned offset_x=0, unsigned offset_y=0);
00051 ~agg_renderer();
00052 void start_map_processing(Map const& map);
00053 void end_map_processing(Map const& map);
00054 void start_layer_processing(Layer const& lay);
00055 void end_layer_processing(Layer const& lay);
00056 void process(point_symbolizer const& sym,
00057 Feature const& feature,
00058 proj_transform const& prj_trans);
00059 void process(line_symbolizer const& sym,
00060 Feature const& feature,
00061 proj_transform const& prj_trans);
00062 void process(line_pattern_symbolizer const& sym,
00063 Feature const& feature,
00064 proj_transform const& prj_trans);
00065 void process(polygon_symbolizer const& sym,
00066 Feature const& feature,
00067 proj_transform const& prj_trans);
00068 void process(polygon_pattern_symbolizer const& sym,
00069 Feature const& feature,
00070 proj_transform const& prj_trans);
00071 void process(raster_symbolizer const& sym,
00072 Feature const& feature,
00073 proj_transform const& prj_trans);
00074 void process(shield_symbolizer const& sym,
00075 Feature const& feature,
00076 proj_transform const& prj_trans);
00077 void process(text_symbolizer const& sym,
00078 Feature const& feature,
00079 proj_transform const& prj_trans);
00080 void process(building_symbolizer const& sym,
00081 Feature const& feature,
00082 proj_transform const& prj_trans);
00083 void process(markers_symbolizer const& sym,
00084 Feature const& feature,
00085 proj_transform const& prj_trans);
00086 private:
00087 T & pixmap_;
00088 unsigned width_;
00089 unsigned height_;
00090 CoordTransform t_;
00091 freetype_engine font_engine_;
00092 face_manager<freetype_engine> font_manager_;
00093 label_collision_detector4 detector_;
00094 boost::scoped_ptr<rasterizer> ras_ptr;
00095 };
00096 }
00097
00098 #endif //AGG_RENDERER_HPP