Changeset 701
- Timestamp:
- 06/29/08 06:40:08 (8 weeks ago)
- Location:
- trunk
- Files:
-
- 1 added
- 32 modified
-
SConstruct (modified) (5 diffs)
-
agg/include/agg_config.h (modified) (1 diff)
-
bindings/python/SConscript (modified) (1 diff)
-
demo/c++/rundemo.cpp (modified) (2 diffs)
-
demo/python/rundemo.py (modified) (1 diff)
-
demo/viewer/main.cpp (modified) (1 diff)
-
demo/viewer/mainwindow.cpp (modified) (1 diff)
-
demo/viewer/mapwidget.cpp (modified) (17 diffs)
-
demo/viewer/mapwidget.hpp (modified) (3 diffs)
-
demo/viewer/viewer.pro (modified) (3 diffs)
-
include/mapnik/agg_renderer.hpp (modified) (1 diff)
-
include/mapnik/ctrans.hpp (modified) (1 diff)
-
include/mapnik/font_engine_freetype.hpp (modified) (12 diffs)
-
include/mapnik/font_set.hpp (added)
-
include/mapnik/image_view.hpp (modified) (2 diffs)
-
include/mapnik/map.hpp (modified) (4 diffs)
-
include/mapnik/octree.hpp (modified) (1 diff)
-
include/mapnik/png_io.hpp (modified) (1 diff)
-
include/mapnik/text_symbolizer.hpp (modified) (4 diffs)
-
include/mapnik/unicode.hpp (modified) (1 diff)
-
plugins/input/gdal/SConscript (modified) (1 diff)
-
plugins/input/postgis/SConscript (modified) (1 diff)
-
plugins/input/raster/SConscript (modified) (1 diff)
-
plugins/input/shape/SConscript (modified) (1 diff)
-
plugins/input/shape/dbffile.hpp (modified) (1 diff)
-
src/SConscript (modified) (1 diff)
-
src/agg_renderer.cpp (modified) (8 diffs)
-
src/cairo_renderer.cpp (modified) (1 diff)
-
src/load_map.cpp (modified) (9 diffs)
-
src/map.cpp (modified) (5 diffs)
-
src/text_symbolizer.cpp (modified) (5 diffs)
-
src/unicode.cpp (modified) (1 diff)
-
utils/shapeindex/SConscript (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r679 r701 46 46 opts.Add(PathOption('PNG_INCLUDES', 'Search path for libpng include files', '/usr/include')) 47 47 opts.Add(PathOption('PNG_LIBS','Search path for libpng include files','/usr/' + LIBDIR_SCHEMA)) 48 opts.Add(PathOption('JPEG_INCLUDES', 'Search path for libjpeg include files', '/usr/ include'))49 opts.Add(PathOption('JPEG_LIBS', 'Search path for libjpeg library files', '/usr/ ' + LIBDIR_SCHEMA))48 opts.Add(PathOption('JPEG_INCLUDES', 'Search path for libjpeg include files', '/usr/local/include')) 49 opts.Add(PathOption('JPEG_LIBS', 'Search path for libjpeg library files', '/usr/local/' + LIBDIR_SCHEMA)) 50 50 opts.Add(PathOption('TIFF_INCLUDES', 'Search path for libtiff include files', '/usr/include')) 51 51 opts.Add(PathOption('TIFF_LIBS', 'Search path for libtiff library files', '/usr/' + LIBDIR_SCHEMA)) 52 52 opts.Add(PathOption('PGSQL_INCLUDES', 'Search path for PostgreSQL include files', '/usr/include')) 53 53 opts.Add(PathOption('PGSQL_LIBS', 'Search path for PostgreSQL library files', '/usr/' + LIBDIR_SCHEMA)) 54 opts.Add(PathOption('PROJ_INCLUDES', 'Search path for PROJ.4 include files', '/ usr/local/include'))55 opts.Add(PathOption('PROJ_LIBS', 'Search path for PROJ.4 library files', '/ usr/local/' + LIBDIR_SCHEMA))54 opts.Add(PathOption('PROJ_INCLUDES', 'Search path for PROJ.4 include files', '/opt/proj4/include')) 55 opts.Add(PathOption('PROJ_LIBS', 'Search path for PROJ.4 library files', '/opt/proj4/' + LIBDIR_SCHEMA)) 56 56 opts.Add(PathOption('GDAL_INCLUDES', 'Search path for GDAL include files', '/usr/include')) 57 57 opts.Add(PathOption('GDAL_LIBS', 'Search path for GDAL library files', '/usr/' + LIBDIR_SCHEMA)) 58 58 opts.Add(PathOption('PYTHON','Python executable', sys.executable)) 59 opts.Add(ListOption('INPUT_PLUGINS','Input drivers to include','all',['postgis','shape','raster','gdal' ]))59 opts.Add(ListOption('INPUT_PLUGINS','Input drivers to include','all',['postgis','shape','raster','gdal','osm'])) 60 60 opts.Add(ListOption('BINDINGS','Language bindings to build','all',['python'])) 61 61 opts.Add(BoolOption('DEBUG', 'Compile a debug version of mapnik', 'False')) … … 155 155 156 156 BOOST_LIBSHEADERS = [ 157 #['system', 'boost/system/system_error.hpp', True], # uncomment this on Darwin + boost_1_35157 ['system', 'boost/system/system_error.hpp', True], # uncomment this on Darwin + boost_1_35 158 158 ['filesystem', 'boost/filesystem/operations.hpp', True], 159 159 ['regex', 'boost/regex.hpp', True], … … 179 179 else: 180 180 env['BOOST_APPEND']='' 181 181 182 182 183 for count, libinfo in enumerate(BOOST_LIBSHEADERS): 183 184 if env['THREADING'] == 'multi' : 184 if not conf.CheckLibWithHeader('boost_%s%s%s' % (libinfo[0], env['BOOST_APPEND'],thread_suffix), libinfo[1], 'C++') and libinfo[2] :185 if not conf.CheckLibWithHeader('boost_%s%s%s' % (libinfo[0],thread_suffix,env['BOOST_APPEND']), libinfo[1], 'C++') and libinfo[2] : 185 186 color_print(1,'Could not find header or shared library for boost %s, exiting!' % libinfo[0]) 186 187 Exit(1) … … 204 205 205 206 # Build shapeindex and remove its dependency from the LIBS 206 if 'boost_program_options%s%s' % (env['BOOST_APPEND'],thread_suffix) in env['LIBS']: 207 # if 'boost_program_options%s%s-1_35' % (env['BOOST_APPEND'],thread_suffix) in env['LIBS']: 208 if 'boost_program_options-mt-1_35' in env['LIBS']: 207 209 SConscript('utils/shapeindex/SConscript') 208 env['LIBS'].remove('boost_program_options %s%s' % (env['BOOST_APPEND'],thread_suffix))210 env['LIBS'].remove('boost_program_options-mt-1_35') 209 211 210 212 # Build the input plug-ins 213 211 214 if 'postgis' in inputplugins and 'pq' in env['LIBS']: 212 215 SConscript('plugins/input/postgis/SConscript') … … 222 225 SConscript('plugins/input/gdal/SConscript') 223 226 224 if ' gigabase' in inputplugins and 'gigabase_r' in env['LIBS']:225 SConscript('plugins/input/ gigabase/SConscript')227 if 'osm' in inputplugins : 228 SConscript('plugins/input/osm/SConscript') 226 229 227 230 # Build the Python bindings. -
trunk/agg/include/agg_config.h
r525 r701 34 34 // such as blur, image filtering: 35 35 36 #define AGG_RENDERING_BUFFER row_ptr_cache<int8u>36 //#define AGG_RENDERING_BUFFER row_ptr_cache<int8u> 37 37 // 38 38 // Provides cheaper creation and destruction (no mem allocs): -
trunk/bindings/python/SConscript
r668 r701 41 41 libraries = ['mapnik','png','jpeg'] 42 42 if env['THREADING'] == 'multi': 43 libraries.append('boost_python%s%s' % (env['BOOST_APPEND'],thread_suffix)) 44 else : 45 libraries.append('boost_python%s' % env['BOOST_APPEND']) 43 #libraries.append('boost_python%s%s-1_35' % (env['BOOST_APPEND'],thread_suffix)) 44 libraries.append('boost_python%s-1_35' % (thread_suffix)) 45 #else : 46 # libraries.append('boost_python%s' % env['BOOST_APPEND']) 46 47 47 48 if env['PLATFORM'] == 'Darwin': 49 libraries.append(env['LIBS']) 48 50 libraries.append('icuuc') 49 51 libraries.append('icudata') 50 if env['THREADING'] == 'multi': 51 libraries.append('boost_regex%s%s' % (env['BOOST_APPEND'],thread_suffix)) 52 else : 53 libraries.append('boost_regex%s' % env['BOOST_APPEND']) 54 if env['THREADING'] == 'multi': 55 libraries.append('boost_thread%s%s' % (env['BOOST_APPEND'],thread_suffix)) 52 #if env['THREADING'] == 'multi': 53 # libraries.append('boost_regex%s%s' % (env['BOOST_APPEND'],thread_suffix)) 54 #else : 55 # libraries.append('boost_regex%s' % env['BOOST_APPEND']) 56 57 #if env['THREADING'] == 'multi': 58 # libraries.append('boost_thread%s%s' % (env['BOOST_APPEND'],thread_suffix)) 56 59 if '-DHAVE_PYCAIRO' in env['CXXFLAGS']: 57 60 libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) -
trunk/demo/c++/rundemo.cpp
r620 r701 29 29 #include <mapnik/font_engine_freetype.hpp> 30 30 #include <mapnik/agg_renderer.hpp> 31 #include <mapnik/cairo_renderer.hpp> 31 32 #include <mapnik/filter_factory.hpp> 32 33 #include <mapnik/color_factory.hpp> … … 53 54 54 55 Map m(800,600); 55 m.set_background(color_factory::from_string("white"));56 56 57 // create styles 57 mapnik::load_map(m,"/Users/artem/projects/openstreetmap/mapnik/openstreetmap_kleptog.xml"); 58 59 m.zoomToBox(Envelope<double>(-762470.6985688356,4004842.088052442,-761928.349698612,4005328.834769584)); 60 61 //Image32 buf(m.getWidth(),m.getHeight()); 62 //agg_renderer<Image32> ren(m,buf); 63 //ren.apply(); 64 65 //save_to_file<ImageData32>(buf.data(),"demo.jpg","jpeg"); 66 //save_to_file<ImageData32>(buf.data(),"demo.png","png"); 67 //save_to_file<ImageData32>(buf.data(),"demo256.png","png256"); 68 //std::cout << "Three maps have been rendered in the current directory:\n" 69 // "- demo.jpg\n" 70 // "- demo.png\n" 71 // "- demo256.png\n" 72 // "Have a look!\n"; 58 73 59 // Provinces (polygon) 60 feature_type_style provpoly_style; 61 62 rule_type provpoly_rule_on; 63 provpoly_rule_on.set_filter(create_filter("[NAME_EN] = 'Ontario'")); 64 provpoly_rule_on.append(polygon_symbolizer(Color(250, 190, 183))); 65 provpoly_style.add_rule(provpoly_rule_on); 74 // Cairo renderer 75 76 // Pdf 77 Cairo::RefPtr<Cairo::PdfSurface> pdf = Cairo::PdfSurface::create("mapnik.pdf",m.getWidth(),m.getHeight()); 78 mapnik::cairo_renderer<Cairo::Surface> cairo1(m, pdf); 79 cairo1.apply(); 80 // Svg 81 //Cairo::RefPtr<Cairo::SvgSurface> svg = Cairo::SvgSurface::create("demo.svg",m.getWidth(),m.getHeight()); 82 //mapnik::cairo_renderer<Cairo::Surface> cairo2(m, svg); 83 //cairo2.apply(); 84 // Png 85 //Cairo::RefPtr<Cairo::ImageSurface> image = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32,m.getWidth(),m.getHeight()); 86 //mapnik::cairo_renderer<Cairo::Surface> cairo3(m, image); 87 //cairo3.apply(); 66 88 67 rule_type provpoly_rule_qc; 68 provpoly_rule_qc.set_filter(create_filter("[NAME_EN] = 'Quebec'")); 69 provpoly_rule_qc.append(polygon_symbolizer(Color(217, 235, 203))); 70 provpoly_style.add_rule(provpoly_rule_qc); 89 //std::string filename = "demo_cairo.png"; 90 //image->write_to_png(filename); 71 91 72 m.insert_style("provinces",provpoly_style);73 74 // Provinces (polyline)75 feature_type_style provlines_style;92 // Ps 93 //Cairo::RefPtr<Cairo::PsSurface> ps = Cairo::PsSurface::create("demo.ps",m.getWidth(),m.getHeight()); 94 //mapnik::cairo_renderer<Cairo::Surface> cairo4(m, ps); 95 //cairo4.apply(); 76 96 77 stroke provlines_stk (Color(0,0,0),1.0);78 provlines_stk.add_dash(8, 4);79 provlines_stk.add_dash(2, 2);80 provlines_stk.add_dash(2, 2);81 82 rule_type provlines_rule;83 provlines_rule.append(line_symbolizer(provlines_stk));84 provlines_style.add_rule(provlines_rule);85 86 m.insert_style("provlines",provlines_style);87 88 // Drainage89 feature_type_style qcdrain_style;90 91 rule_type qcdrain_rule;92 qcdrain_rule.set_filter(create_filter("[HYC] = 8"));93 qcdrain_rule.append(polygon_symbolizer(Color(153, 204, 255)));94 qcdrain_style.add_rule(qcdrain_rule);95 96 m.insert_style("drainage",qcdrain_style);97 98 // Roads 3 and 4 (The "grey" roads)99 feature_type_style roads34_style;100 rule_type roads34_rule;101 roads34_rule.set_filter(create_filter("[CLASS] = 3 or [CLASS] = 4"));102 stroke roads34_rule_stk(Color(171,158,137),2.0);103 roads34_rule_stk.set_line_cap(ROUND_CAP);104 roads34_rule_stk.set_line_join(ROUND_JOIN);105 roads34_rule.append(line_symbolizer(roads34_rule_stk));106 roads34_style.add_rule(roads34_rule);107 108 m.insert_style("smallroads",roads34_style);109 110 111 // Roads 2 (The thin yellow ones)112 feature_type_style roads2_style_1;113 rule_type roads2_rule_1;114 roads2_rule_1.set_filter(create_filter("[CLASS] = 2"));115 stroke roads2_rule_stk_1(Color(171,158,137),4.0);116 roads2_rule_stk_1.set_line_cap(ROUND_CAP);117 roads2_rule_stk_1.set_line_join(ROUND_JOIN);118 roads2_rule_1.append(line_symbolizer(roads2_rule_stk_1));119 roads2_style_1.add_rule(roads2_rule_1);120 121 m.insert_style("road-border", roads2_style_1);122 123 feature_type_style roads2_style_2;124 rule_type roads2_rule_2;125 roads2_rule_2.set_filter(create_filter("[CLASS] = 2"));126 stroke roads2_rule_stk_2(Color(255,250,115),2.0);127 roads2_rule_stk_2.set_line_cap(ROUND_CAP);128 roads2_rule_stk_2.set_line_join(ROUND_JOIN);129 roads2_rule_2.append(line_symbolizer(roads2_rule_stk_2));130 roads2_style_2.add_rule(roads2_rule_2);131 132 m.insert_style("road-fill", roads2_style_2);133 134 // Roads 1 (The big orange ones, the highways)135 feature_type_style roads1_style_1;136 rule_type roads1_rule_1;137 roads1_rule_1.set_filter(create_filter("[CLASS] = 1"));138 stroke roads1_rule_stk_1(Color(188,149,28),7.0);139 roads1_rule_stk_1.set_line_cap(ROUND_CAP);140 roads1_rule_stk_1.set_line_join(ROUND_JOIN);141 roads1_rule_1.append(line_symbolizer(roads1_rule_stk_1));142 roads1_style_1.add_rule(roads1_rule_1);143 m.insert_style("highway-border", roads1_style_1);144 145 feature_type_style roads1_style_2;146 rule_type roads1_rule_2;147 roads1_rule_2.set_filter(create_filter("[CLASS] = 1"));148 stroke roads1_rule_stk_2(Color(242,191,36),5.0);149 roads1_rule_stk_2.set_line_cap(ROUND_CAP);150 roads1_rule_stk_2.set_line_join(ROUND_JOIN);151 roads1_rule_2.append(line_symbolizer(roads1_rule_stk_2));152 roads1_style_2.add_rule(roads1_rule_2);153 m.insert_style("highway-fill", roads1_style_2);154 155 // Populated Places156 157 feature_type_style popplaces_style;158 rule_type popplaces_rule;159 text_symbolizer popplaces_text_symbolizer("GEONAME","DejaVu Sans Book",10,Color(0,0,0));160 popplaces_text_symbolizer.set_halo_fill(Color(255,255,200));161 popplaces_text_symbolizer.set_halo_radius(1);162 popplaces_rule.append(popplaces_text_symbolizer);163 popplaces_style.add_rule(popplaces_rule);164 165 m.insert_style("popplaces",popplaces_style );166 167 // Layers168 // Provincial polygons169 {170 parameters p;171 p["type"]="shape";172 p["file"]="../data/boundaries";173 174 Layer lyr("Provinces");175 lyr.set_datasource(datasource_cache::instance()->create(p));176 lyr.add_style("provinces");177 m.addLayer(lyr);178 }179 180 // Drainage181 {182 parameters p;183 p["type"]="shape";184 p["file"]="../data/qcdrainage";185 Layer lyr("Quebec Hydrography");186 lyr.set_datasource(datasource_cache::instance()->create(p));187 lyr.add_style("drainage");188 m.addLayer(lyr);189 }190 191 {192 parameters p;193 p["type"]="shape";194 p["file"]="../data/ontdrainage";195 196 Layer lyr("Ontario Hydrography");197 lyr.set_datasource(datasource_cache::instance()->create(p));198 lyr.add_style("drainage");199 m.addLayer(lyr);200 }201 202 // Provincial boundaries203 {204 parameters p;205 p["type"]="shape";206 p["file"]="../data/boundaries_l";207 Layer lyr("Provincial borders");208 lyr.set_datasource(datasource_cache::instance()->create(p));209 lyr.add_style("provlines");210 m.addLayer(lyr);211 }212 213 // Roads214 {215 parameters p;216 p["type"]="shape";217 p["file"]="../data/roads";218 Layer lyr("Roads");219 lyr.set_datasource(datasource_cache::instance()->create(p));220 lyr.add_style("smallroads");221 lyr.add_style("road-border");222 lyr.add_style("road-fill");223 lyr.add_style("highway-border");224 lyr.add_style("highway-fill");225 226 m.addLayer(lyr);227 }228 // popplaces229 {230 parameters p;231 p["type"]="shape";232 p["file"]="../data/popplaces";233 p["encoding"] = "latin1";234 Layer lyr("Populated Places");235 lyr.set_datasource(datasource_cache::instance()->create(p));236 lyr.add_style("popplaces");237 m.addLayer(lyr);238 }239 240 m.zoomToBox(Envelope<double>(1405120.04127408,-247003.813399447,241 1706357.31328276,-25098.593149577));242 243 Image32 buf(m.getWidth(),m.getHeight());244 agg_renderer<Image32> ren(m,buf);245 ren.apply();246 247 save_to_file<ImageData32>(buf.data(),"demo.jpg","jpeg");248 save_to_file<ImageData32>(buf.data(),"demo.png","png");249 save_to_file<ImageData32>(buf.data(),"demo256.png","png256");250 std::cout << "Three maps have been rendered in the current directory:\n"251 "- demo.jpg\n"252 "- demo.png\n"253 "- demo256.png\n"254 "Have a look!\n";255 97 } 256 98 catch ( const mapnik::config_error & ex ) -
trunk/demo/python/rundemo.py
r666 r701 317 317 images.append('demo.jpg') 318 318 319 save_map(m,'map.xml') 320 319 321 # Render cairo examples 320 322 try: -
trunk/demo/viewer/main.cpp
r579 r701 36 36 freetype_engine::register_font("/opt/mapnik/lib/mapnik/fonts/DejaVuSans-Bold.ttf"); 37 37 freetype_engine::register_font("/opt/mapnik/lib/mapnik/fonts/DejaVuSansMono.ttf"); 38 39 38 freetype_engine::register_font("/System/Library/Fonts/Monaco.dfont"); 39 freetype_engine::register_font("/Users/artem/Desktop/japanese.otf"); 40 freetype_engine::register_font("/Users/artem/Desktop/IPAfont00201/ipagp.ttf"); 41 freetype_engine::register_font("/Users/artem/Desktop/IPAfont00201/ipag.ttf"); 42 40 43 QApplication app( argc, argv ); 41 44 MainWindow window; -
trunk/demo/viewer/mainwindow.cpp
r579 r701 93 93 connect(slider_,SIGNAL(valueChanged(int)),mapWidget_,SLOT(zoomToLevel(int))); 94 94 // 95 connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT( updateMap()));95 connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT(renderMap())); 96 96 connect(layerTab_,SIGNAL(layerSelected(int)), 97 97 mapWidget_,SLOT(layerSelected(int))); -
trunk/demo/viewer/mapwidget.cpp
r544 r701 30 30 #include "mapwidget.hpp" 31 31 #include "info_dialog.hpp" 32 #include <unicode/unistr.h> 32 33 33 34 using mapnik::Image32; … … 80 81 pen_.setCapStyle(Qt::RoundCap); 81 82 pen_.setJoinStyle(Qt::RoundJoin); 83 connect(&thread_, SIGNAL(renderedMap(const QImage &)), 84 this, SLOT(updateMap(const QImage &))); 82 85 } 83 86 … … 122 125 { 123 126 map_->resize(ev->size().width(),ev->size().height()); 124 updateMap();127 renderMap(); 125 128 } 126 129 } … … 172 175 if (itr->second.to_string().length() > 0) 173 176 { 177 UnicodeString unicode = itr->second.to_unicode(); 174 178 info.push_back(QPair<QString,QString>(QString(itr->first.c_str()), 175 itr->second.to_string().c_str()));179 QString((QChar*)unicode.getBuffer(),unicode.length()))); 176 180 } 177 181 } … … 224 228 else if (e->button()==Qt::RightButton) 225 229 { 226 // updateMap();230 //renderMap(); 227 231 } 228 232 } … … 252 256 Envelope<double> box = t.backward(Envelope<double>(start_x_,start_y_,end_x_,end_y_)); 253 257 map_->zoomToBox(box); 254 updateMap();258 renderMap(); 255 259 } 256 260 } … … 265 269 int dy = end_y_ - start_y_; 266 270 map_->pan(cx - dx ,cy - dy); 267 updateMap();271 renderMap(); 268 272 } 269 273 } … … 334 338 { 335 339 map_->zoomToBox(bbox); 336 updateMap();340 renderMap(); 337 341 } 338 342 } … … 344 348 map_->resize(width(),height()); 345 349 map_->zoom_all(); 346 updateMap();350 renderMap(); 347 351 } 348 352 } … … 353 357 { 354 358 map_->zoom(0.5); 355 updateMap();359 renderMap(); 356 360 } 357 361 } … … 362 366 { 363 367 map_->zoom(2.0); 364 updateMap();368 renderMap(); 365 369 } 366 370 } … … 373 377 double cy = 0.5*map_->getHeight(); 374 378 map_->pan(int(cx),int(cy - cy*0.25)); 375 updateMap();379 renderMap(); 376 380 } 377 381 } … … 384 388 double cy = 0.5*map_->getHeight(); 385 389 map_->pan(int(cx),int(cy + cy*0.25)); 386 updateMap();390 renderMap(); 387 391 } 388 392 } … … 395 399 double cy = 0.5*map_->getHeight(); 396 400 map_->pan(int(cx - cx * 0.25),int(cy)); 397 updateMap();401 renderMap(); 398 402 } 399 403 } … … 406 410 double cy = 0.5*map_->getHeight(); 407 411 map_->pan(int(cx + cx * 0.25),int(cy)); 408 updateMap();412 renderMap(); 409 413 } 410 414 } … … 429 433 pt.y + 0.5 * height*res); 430 434 map_->zoomToBox(box); 431 updateMap();435 renderMap(); 432 436 } 433 437 } … … 442 446 443 447 444 void MapWidget::updateMap() 445 { 446 if (map_) 447 { 448 unsigned width=map_->getWidth(); 449 unsigned height=map_->getHeight(); 450 451 Image32 buf(width,height); 452 mapnik::agg_renderer<Image32> ren(*map_,buf); 453 ren.apply(); 454 455 QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32); 456 pix_=QPixmap::fromImage(image.rgbSwapped()); 457 update(); 458 // emit signal to interested widgets 459 emit mapViewChanged(); 460 std::cout << map_->getCurrentExtent() << "\n"; 461 } 448 void MapWidget::renderMap() 449 { 450 thread_.render(map_); 451 } 452 453 void MapWidget::updateMap(QImage const& image) 454 { 455 std::cout << "updateMap called \n"; 456 pix_ = QPixmap::fromImage(image); 457 update(); 458 // emit signal to interested widgets 459 emit mapViewChanged(); 460 std::cout << map_->getCurrentExtent() << "\n"; 462 461 } 463 462 -
trunk/demo/viewer/mapwidget.hpp
r544 r701 32 32 #include <boost/scoped_ptr.hpp> 33 33 #include <mapnik/map.hpp> 34 #include "renderthread.hpp" 34 35 35 36 class MapWidget : public QWidget … … 59 60 QPen pen_; 60 61 int selectedLayer_; 62 RenderThread thread_; 61 63 public: 62 64 MapWidget(QWidget *parent=0); … … 73 75 void panUp(); 74 76 void panDown(); 77 void renderMap(); 75 78 public slots: 76 79 void zoomToLevel(int level); 77 void updateMap( );80 void updateMap(QImage const&); 78 81 void layerSelected(int); 79 82 signals: -
trunk/demo/viewer/viewer.pro
r638
