Compare commits

...

2 commits

Author SHA1 Message Date
Ben Moores
0a588d044b Experimental pdf output using wxPdfDoc:
- wxpdfdoc patches
 - mapnik patches
 - visual studio build instructions / project files

see /msvc/readme.txt for build instructions

The scons makefiles have not been updated, the new files are in /pdf, /include/pdf, /demo/pdf/, and /bindings/python
2008-04-06 01:26:14 +00:00
Ben Moores
e1a9612885 Branch for experimental pdf output using wxPdfDoc 2008-03-28 22:22:55 +00:00
53 changed files with 23682 additions and 10 deletions

View file

@ -0,0 +1,42 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <boost/python.hpp>
#include <pdf/pdf_line_pattern_symbolizer.hpp>
#include <mapnik/line_symbolizer.hpp>
using mapnik::pdf_line_pattern_symbolizer;
using mapnik::stroke;
void export_pdf_line_pattern_symbolizer()
{
using namespace boost::python;
class_<pdf_line_pattern_symbolizer, bases<mapnik::line_pattern_symbolizer>>("PDFLinePatternSymbolizer", init<std::string const&, std::string const&, const double, const unsigned, const unsigned, const double, const double>("Create a new PDF Line Pattern Symbolizer"))
.def (init<mapnik::pdf_line_pattern_symbolizer const&>("Copies a PDF Line Pattern Symbolizer"))
.def (init<mapnik::line_pattern_symbolizer const&, const double, const double, const double>("Creates a PDF Line Pattern Symbolizer from a Line Pattern Symbolizer"))
.def ("set_output_size", &mapnik::pdf_line_pattern_symbolizer::set_output_size, "Sets the output size of the tile in PDF units")
.def ("get_output_width", &mapnik::pdf_line_pattern_symbolizer::get_output_width, "Gets the output width of the tile in PDF units")
.def ("get_output_height", &mapnik::pdf_line_pattern_symbolizer::get_output_height, "Gets the output height of the tile in PDF units")
.add_property("stroke",make_function( &pdf_line_pattern_symbolizer::get_stroke, return_value_policy<copy_const_reference>() ), &pdf_line_pattern_symbolizer::set_stroke )
;
}

View file

@ -0,0 +1,39 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <boost/python.hpp>
#include <pdf/pdf_point_symbolizer.hpp>
void export_pdf_point_symbolizer()
{
using namespace boost::python;
using mapnik::pdf_point_symbolizer;
class_<pdf_point_symbolizer, bases<mapnik::point_symbolizer>>("PDFPointSymbolizer", init<>("Default PDF Point Symbolizer - 1x1 black square"))
.def (init<std::string const&, std::string const&, unsigned, unsigned, double, double>("Create a new PDF Point Symbolizer"))
.def (init<mapnik::pdf_point_symbolizer &>("Copies a PDF Point Symbolizer"))
.def (init<mapnik::point_symbolizer &, double, double>("Creates a PDF point symbolizer from a point symbolizer"))
.def ("set_output_size", &mapnik::pdf_point_symbolizer::set_output_size, "Sets the output size of the symbol in PDF units")
.def ("get_output_width", &mapnik::pdf_point_symbolizer::get_output_width, "Gets the output width of the symbol in PDF units")
.def ("get_output_height", &mapnik::pdf_point_symbolizer::get_output_height, "Gets the output height of the symbol in PDF units")
;
}

View file

@ -0,0 +1,38 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <boost/python.hpp>
#include <pdf/pdf_polygon_pattern_symbolizer.hpp>
void export_pdf_polygon_pattern_symbolizer()
{
using namespace boost::python;
using mapnik::pdf_polygon_pattern_symbolizer;
class_<pdf_polygon_pattern_symbolizer, bases<mapnik::polygon_pattern_symbolizer>>("PDFPolygonPatternSymbolizer", init<std::string const&, std::string const&, const unsigned, const unsigned, const double, const double>("Create a new PDF Polygon Pattern Symbolizer"))
.def (init<mapnik::pdf_polygon_pattern_symbolizer const&>("Copies a PDF Polygon Pattern Symbolizer"))
.def (init<mapnik::polygon_pattern_symbolizer const&, const double, const double>("Creates a PDF Polygon Pattern Symbolizer from a Polygon Pattern Symbolizer"))
.def ("set_output_size", &mapnik::pdf_polygon_pattern_symbolizer::set_output_size, "Sets the output size of the tile in PDF units")
.def ("get_output_width", &mapnik::pdf_polygon_pattern_symbolizer::get_output_width, "Gets the output width of the tile in PDF units")
.def ("get_output_height", &mapnik::pdf_polygon_pattern_symbolizer::get_output_height, "Gets the output height of the tile in PDF units")
;
}

View file

@ -0,0 +1,76 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <boost/python.hpp>
#include <pdf/pdf_renderer.hpp>
#include <pdf/pdf_renderer_layout.hpp>
#include <pdf/pdf_renderer_utility.hpp>
void export_pdf_renderer_layout()
{
using namespace boost::python;
using mapnik::pdf_renderer_layout;
class_<pdf_renderer_layout>("PDFRendererLayout", init<const std::string, const double, const double, const bool>("Default PDF Renderer Layout"))
.def ("set_font", &mapnik::pdf_renderer_layout::set_font, "Set the font to use for overlays")
.def ("set_background_colour", &mapnik::pdf_renderer_layout::set_background_colour, "set the page background colour")
.def ("set_map_area", &mapnik::pdf_renderer_layout::set_map_area, "Set the area of the page to render the map")
.def ("set_map_area_border", &mapnik::pdf_renderer_layout::set_map_area_border, "Set whether to draw a map border")
.def ("set_map_area_border_width", &mapnik::pdf_renderer_layout::set_map_area_border_width, "Set the map border width")
.def ("add_overlay_image", &mapnik::pdf_renderer_layout::add_overlay_image, "Add an overlay image")
.def ("set_map_grid", &mapnik::pdf_renderer_layout::set_map_grid, "Enable/Disable drawing map grid")
.def ("set_border_scales", &mapnik::pdf_renderer_layout::set_border_scales, "Enable/Disable drawing scales around edge of map")
.def ("set_map_grid_approx_spacing", &mapnik::pdf_renderer_layout::set_map_grid_approx_spacing, "Sets the approximate spacing of the grid lines")
.def ("set_border_scale_width", &mapnik::pdf_renderer_layout::set_border_scale_width, "Set width of scale bars around edge of map")
.def ("set_border_scale_linewidth", &mapnik::pdf_renderer_layout::set_border_scale_linewidth, "Set thickness of lines around the grid edge")
.def ("set_map_grid_colour", &mapnik::pdf_renderer_layout::set_map_grid_colour, "Set the colour of the grid across the map")
.def ("set_map_grid_linewidth", &mapnik::pdf_renderer_layout::set_map_grid_linewidth, "Set the map grid line width")
.def ("set_scale_bar", &mapnik::pdf_renderer_layout::set_scale_bar, "Enable/Disable the scale bar")
.def ("set_scale_bar_area", &mapnik::pdf_renderer_layout::set_scale_bar_area, "Set the scale bar size and location")
.def ("set_scale_bar_factor", &mapnik::pdf_renderer_layout::set_scale_bar_factor, "Sets the scale bar scale factor and label")
;
}
void render_to_pdf_1(const mapnik::Map& map, const mapnik::pdf_renderer_layout &layout, const std::string& filename) {
mapnik::render_to_pdf(map, layout, filename);
}
void render_to_pdf_2(const mapnik::Map& map, const mapnik::pdf_renderer_layout &layout, const std::string& filename, const bool compress) {
mapnik::render_to_pdf(map, layout, filename, compress);
}
void export_pdf_renderer()
{
using namespace boost::python;
using mapnik::pdf_renderer;
def("render_to_pdf",&render_to_pdf_1);
def("render_to_pdf",&render_to_pdf_2);
}

View file

@ -0,0 +1,40 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <boost/python.hpp>
#include <pdf/pdf_shield_symbolizer.hpp>
void export_pdf_shield_symbolizer()
{
using namespace boost::python;
using mapnik::pdf_shield_symbolizer;
using mapnik::text_symbolizer;
class_< pdf_shield_symbolizer, bases<mapnik::shield_symbolizer> >("PDFShieldSymbolizer", init< std::string const&, std::string const&, unsigned, mapnik::Color const&, std::string const&, std::string const&, unsigned, unsigned, double, double>("TODO"))
.def (init<mapnik::pdf_shield_symbolizer const&>("Copies a PDF Shield Symbolizer"))
.def (init<mapnik::pdf_shield_symbolizer const&, const double, const double>("Creates a PDF Shield Symbolizer from a Shield Symbolizer"))
.def ("set_output_size", &mapnik::pdf_shield_symbolizer::set_output_size, "Sets the output size of the shield in PDF units")
.def ("get_output_width", &mapnik::pdf_shield_symbolizer::get_output_width, "Gets the output width of the shield in PDF units")
.def ("get_output_height", &mapnik::pdf_shield_symbolizer::get_output_height, "Gets the output height of the shield in PDF units")
;
}

View file

@ -55,6 +55,12 @@ void export_text_symbolizer();
void export_shield_symbolizer();
void export_font_engine();
void export_projection();
void export_pdf_point_symbolizer();
void export_pdf_line_pattern_symbolizer();
void export_pdf_polygon_pattern_symbolizer();
void export_pdf_shield_symbolizer();
void export_pdf_renderer_layout();
void export_pdf_renderer();
#include <mapnik/map.hpp>
#include <mapnik/agg_renderer.hpp>
@ -178,6 +184,13 @@ BOOST_PYTHON_MODULE(_mapnik)
export_projection();
export_coord();
export_map();
export_pdf_point_symbolizer();
export_pdf_line_pattern_symbolizer();
export_pdf_polygon_pattern_symbolizer();
export_pdf_shield_symbolizer();
export_pdf_renderer_layout();
export_pdf_renderer();
def("render_to_file",&render_to_file1);
def("render_to_file",&render_to_file2);

BIN
demo/pdf/images/a.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
demo/pdf/images/b.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

513
demo/pdf/images/c.pdf Normal file

File diff suppressed because one or more lines are too long

624
demo/pdf/main.cpp Normal file
View file

@ -0,0 +1,624 @@
#include <stdio.h>
#include <iostream>
#define DATASOURCEDIR "D:/otm/mapnik/trunk/msvc/Debug/"
#define REGISTEREDFONT "D:/otm/mapnik/trunk/fonts/dejavu-ttf-2.14/DejaVuSans.ttf"
#define DEMODIR "D:/otm/mapnik/trunk/demo/"
#define DEMODATA DEMODIR"data/"
//mapnik
#include <mapnik/map.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/font_engine_freetype.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/filter_factory.hpp>
#include <mapnik/color_factory.hpp>
#include <mapnik/image_util.hpp>
//pdf renderer
#include "pdf/pdf_renderer.hpp"
#include "pdf/pdf_renderer_layout.hpp"
#include "pdf/pdf_renderer_utility.hpp"
#include "pdf/pdf_point_symbolizer.hpp"
#include "pdf/pdf_polygon_pattern_symbolizer.hpp"
#include "pdf/pdf_line_pattern_symbolizer.hpp"
#include "pdf/pdf_shield_symbolizer.hpp"
// WX
#include <wx/pdfdoc.h>
using namespace mapnik;
void demo(void);
void fancy_demo(void);
int main(void) {
demo();
fancy_demo();
return 0;
}
void demo(void) {
std::cout << "demo\n==============================================================\n";
//---------------------------------
//Setup
//register datasources
datasource_cache::instance()->register_datasources(DATASOURCEDIR);
//register the font
// note: pdf output uses its own fonts, which are either the standard
// pdf fonts (arial, courier, times, symbol, zapfDingbats) or external
// fonts (see pdf_text_renderer::set_external_font_options).
freetype_engine::register_font(REGISTEREDFONT);
//---------------------------------
//Map creation
//create an empty map.
// - The dimensions given here are in pixels for the normal renderer,
// and 'pdf-units' for the pdf renderer. See pdf_renderer_layout
// below for more information on the pdf-units.
Map m(150,200);
//background colour
m.set_background(color_factory::from_string("cyan"));
//---------------------------------
//Create styles
// Note: dimensions given here will be interpreted in pdf-units rather
// than pixels for the pdf output. E.g. a line width of '5' cound be
// 5mm, 5in, or 5pt depending on the pdf-units.
// Provinces (polygon)
feature_type_style provpoly_style;
rule_type provpoly_rule_on;
provpoly_rule_on.set_filter(create_filter("[NAME_EN] = 'Ontario'"));
provpoly_rule_on.append(polygon_symbolizer(Color(250, 190, 183)));
provpoly_style.add_rule(provpoly_rule_on);
rule_type provpoly_rule_qc;
provpoly_rule_qc.set_filter(create_filter("[NAME_EN] = 'Quebec'"));
provpoly_rule_qc.append(polygon_symbolizer(Color(217, 235, 203)));
provpoly_style.add_rule(provpoly_rule_qc);
m.insert_style("provinces",provpoly_style);
// Provinces (polyline)
feature_type_style provlines_style;
stroke provlines_stk (Color(0,0,0),0.75);
provlines_stk.add_dash(8, 4);
provlines_stk.add_dash(2, 2);
provlines_stk.add_dash(2, 2);
rule_type provlines_rule;
provlines_rule.append(line_symbolizer(provlines_stk));
provlines_style.add_rule(provlines_rule);
m.insert_style("provlines",provlines_style);
// Drainage
feature_type_style qcdrain_style;
rule_type qcdrain_rule;
qcdrain_rule.set_filter(create_filter("[HYC] = 8"));
qcdrain_rule.append(polygon_symbolizer(Color(153, 204, 255)));
qcdrain_style.add_rule(qcdrain_rule);
m.insert_style("drainage",qcdrain_style);
// Roads 3 and 4 (The "grey" roads)
feature_type_style roads34_style;
rule_type roads34_rule;
roads34_rule.set_filter(create_filter("[CLASS] = 3 or [CLASS] = 4"));
stroke roads34_rule_stk(Color(171,158,137),1.0);
roads34_rule_stk.set_line_cap(ROUND_CAP);
roads34_rule_stk.set_line_join(ROUND_JOIN);
roads34_rule.append(line_symbolizer(roads34_rule_stk));
roads34_style.add_rule(roads34_rule);
m.insert_style("smallroads",roads34_style);
// Roads 2 (The thin yellow ones)
feature_type_style roads2_style_1;
rule_type roads2_rule_1;
roads2_rule_1.set_filter(create_filter("[CLASS] = 2"));
stroke roads2_rule_stk_1(Color(171,158,137),1.8);
roads2_rule_stk_1.set_line_cap(ROUND_CAP);
roads2_rule_stk_1.set_line_join(ROUND_JOIN);
roads2_rule_1.append(line_symbolizer(roads2_rule_stk_1));
roads2_style_1.add_rule(roads2_rule_1);
m.insert_style("road-border", roads2_style_1);
feature_type_style roads2_style_2;
rule_type roads2_rule_2;
roads2_rule_2.set_filter(create_filter("[CLASS] = 2"));
stroke roads2_rule_stk_2(Color(255,250,115),1.5);
roads2_rule_stk_2.set_line_cap(ROUND_CAP);
roads2_rule_stk_2.set_line_join(ROUND_JOIN);
roads2_rule_2.append(line_symbolizer(roads2_rule_stk_2));
roads2_style_2.add_rule(roads2_rule_2);
m.insert_style("road-fill", roads2_style_2);
// Roads 1 (The big orange ones, the highways)
feature_type_style roads1_style_1;
rule_type roads1_rule_1;
roads1_rule_1.set_filter(create_filter("[CLASS] = 1"));
stroke roads1_rule_stk_1(Color(188,149,28),2.2);
roads1_rule_stk_1.set_line_cap(ROUND_CAP);
roads1_rule_stk_1.set_line_join(ROUND_JOIN);
roads1_rule_1.append(line_symbolizer(roads1_rule_stk_1));
roads1_style_1.add_rule(roads1_rule_1);
m.insert_style("highway-border", roads1_style_1);
feature_type_style roads1_style_2;
rule_type roads1_rule_2;
roads1_rule_2.set_filter(create_filter("[CLASS] = 1"));
stroke roads1_rule_stk_2(Color(242,191,36),2.0);
roads1_rule_stk_2.set_line_cap(ROUND_CAP);
roads1_rule_stk_2.set_line_join(ROUND_JOIN);
roads1_rule_2.append(line_symbolizer(roads1_rule_stk_2));
roads1_style_2.add_rule(roads1_rule_2);
m.insert_style("highway-fill", roads1_style_2);
// Populated Places
feature_type_style popplaces_style;
rule_type popplaces_rule;
text_symbolizer popplaces_text_symbolizer("GEONAME","arial",3,Color(50,50,100));
popplaces_text_symbolizer.set_halo_fill(Color(255,255,200));
popplaces_text_symbolizer.set_halo_radius(1);
popplaces_rule.append(popplaces_text_symbolizer);
popplaces_style.add_rule(popplaces_rule);
m.insert_style("popplaces",popplaces_style );
//---------------------------------
//Create Layers and assign styles
// Layers
// Provincial polygons
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"boundaries";
Layer lyr("Provinces");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("provinces");
m.addLayer(lyr);
}
// Drainage
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"qcdrainage";
Layer lyr("Quebec Hydrography");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("drainage");
m.addLayer(lyr);
}
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"ontdrainage";
Layer lyr("Ontario Hydrography");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("drainage");
m.addLayer(lyr);
}
// Provincial boundaries
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"boundaries_l";
Layer lyr("Provincial borders");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("provlines");
m.addLayer(lyr);
}
// Roads
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"roads";
Layer lyr("Roads");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("smallroads");
lyr.add_style("road-border");
lyr.add_style("road-fill");
lyr.add_style("highway-border");
lyr.add_style("highway-fill");
m.addLayer(lyr);
}
// popplaces
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"popplaces";
p["encoding"] = "latin1";
Layer lyr("Populated Places");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("popplaces");
m.addLayer(lyr);
}
//---------------------------------
//Set map visible area
// m.zoom_all();
m.zoomToBox(Envelope<double>(1405120.04127408,-247003.813399447,1706357.31328276,-25098.593149577));
//---------------------------------
//Render to a png (you'll need to change the font in the popplaces style for this to work
/* Image32 buf(m.getWidth(),m.getHeight());
agg_renderer<Image32> ren(m,buf,0,0);
ren.apply();
save_to_file<ImageData32>(buf.data(),"canada2.png","png");
*/
//=================================
//Render to a pdf
//---------------------
//create the page layout for the pdf
//this specifies the units used on the page, and dimensions of the page in those units.
pdf_renderer_layout page_layout("mm", 210, 297);
//set the location of the map within the page
page_layout.set_map_area(25, 40, m.getWidth(), m.getHeight());
page_layout.set_map_area_border(true); //Draw a border around the map
page_layout.set_map_area_border_width(0.75); // - width of the border
page_layout.set_background_colour(Color(255, 255, 255)); // - colour of the border
page_layout.set_map_grid(true); //Draw a grid across the map (on its own layer so it can be turned on/off)
page_layout.set_map_grid_colour(Color(0,128,255,200)); // - Grid colour
page_layout.set_map_grid_linewidth(0.33); // - Grid line width
page_layout.set_border_scales(true); //Draw scales around the map border
page_layout.set_map_grid_approx_spacing(20); // - approximate length of each grid segment, this will be tweaked to get nice units (e.g. 20mm may equate to 5832.78 meters, so it'll be changed to something like 22 to give 6000 meters)
page_layout.set_border_scale_width(3); // - width of the scales around the border
page_layout.set_border_scale_linewidth(0.25); // - line width of the border scales
page_layout.set_scale_bar(true); //Draw a scale bar
page_layout.set_scale_bar_area(Envelope<double>(50,250, 170, 257)); // - position and size of the scale bar. The width will be tweaked to give proper units.
page_layout.set_scale_bar_factor(1,"Meters"); // - Give the scale factor and label. E.g. if the map projection outputs in meters, the scale factor is 1, but if you want kilometers, specify 0.001.
// page_layout.set_scale_bar_factor(0.001,_T("Kilometers"));
// page_layout.set_scale_bar_factor(39.3700787,_T("Inches"));
// page_layout.set_scale_bar_factor(0.000621371192,_T("Miles"));
// page_layout.set_scale_bar_factor(0.546806649,_T("Fathoms"));
// page_layout.set_scale_bar_factor(3.2808399,"Feet");
//---------------------
//render the pdf to a file
render_to_pdf(m, page_layout, "demo.pdf", false);
render_to_pdf(m, page_layout, "demo-compressed.pdf", true);
}
void fancy_demo(void) {
std::cout << "fancy demo\n==============================================================\n";
//---------------------------------
//Setup
//register datasources
datasource_cache::instance()->register_datasources(DATASOURCEDIR);
//register the font
// note: pdf output uses its own fonts, which are either the standard
// pdf fonts (arial, courier, times, symbol, zapfDingbats) or external
// fonts (see pdf_text_renderer::set_external_font_options).
freetype_engine::register_font(REGISTEREDFONT);
//---------------------------------
//Map creation
//create an empty map.
// - The dimensions given here are in pixels for the normal renderer,
// and 'pdf-units' for the pdf renderer. See pdf_renderer_layout
// below for more information on the pdf-units.
Map m(800,500);
//background colour
m.set_background(color_factory::from_string("cyan"));
//---------------------------------
//Create styles
// Note: dimensions given here will be interpreted in pdf-units rather
// than pixels for the pdf output. E.g. a line width of '5' cound be
// 5mm, 5in, or 5pt depending on the pdf-units.
// Provinces (polygon)
feature_type_style provpoly_style;
rule_type provpoly_rule_on;
provpoly_rule_on.set_filter(create_filter("[NAME_EN] = 'Ontario'"));
provpoly_rule_on.append(polygon_symbolizer(Color(250, 190, 183)));
provpoly_style.add_rule(provpoly_rule_on);
rule_type provpoly_rule_qc;
provpoly_rule_qc.set_filter(create_filter("[NAME_EN] = 'Quebec'"));
provpoly_rule_qc.append(polygon_symbolizer(Color(217, 235, 203)));
provpoly_style.add_rule(provpoly_rule_qc);
m.insert_style("provinces",provpoly_style);
// Provinces (polyline)
feature_type_style provlines_style;
stroke provlines_stk (Color(0,0,0),0.75);
provlines_stk.add_dash(8, 4);
provlines_stk.add_dash(2, 2);
provlines_stk.add_dash(2, 2);
rule_type provlines_rule;
provlines_rule.append(line_symbolizer(provlines_stk));
provlines_style.add_rule(provlines_rule);
m.insert_style("provlines",provlines_style);
// Drainage
feature_type_style qcdrain_style;
rule_type qcdrain_rule;
qcdrain_rule.set_filter(create_filter("[HYC] = 8"));
pdf_polygon_pattern_symbolizer psym(DEMODIR"pdf/images/b.png","png",100,100, 10, 10);
qcdrain_rule.append(psym);
qcdrain_style.add_rule(qcdrain_rule);
m.insert_style("drainage",qcdrain_style);
// Roads 3 and 4 (The "grey" roads)
feature_type_style roads34_style;
rule_type roads34_rule;
roads34_rule.set_filter(create_filter("[CLASS] = 3 or [CLASS] = 4"));
stroke roads34_rule_stk(Color(171,158,137),1.0);
roads34_rule_stk.set_line_cap(ROUND_CAP);
roads34_rule_stk.set_line_join(ROUND_JOIN);
roads34_rule.append(line_symbolizer(roads34_rule_stk));
roads34_style.add_rule(roads34_rule);
m.insert_style("smallroads",roads34_style);
// Roads 2 (The thin yellow ones)
feature_type_style roads2_style_1;
rule_type roads2_rule_1;
roads2_rule_1.set_filter(create_filter("[CLASS] = 2"));
stroke roads2_rule_stk_1(Color(171,158,137),1.8);
roads2_rule_stk_1.set_line_cap(ROUND_CAP);
roads2_rule_stk_1.set_line_join(ROUND_JOIN);
roads2_rule_1.append(line_symbolizer(roads2_rule_stk_1));
roads2_style_1.add_rule(roads2_rule_1);
m.insert_style("road-border", roads2_style_1);
feature_type_style roads2_style_2;
rule_type roads2_rule_2;
roads2_rule_2.set_filter(create_filter("[CLASS] = 2"));
stroke roads2_rule_stk_2(Color(255,250,115),1.5);
roads2_rule_stk_2.set_line_cap(ROUND_CAP);
roads2_rule_stk_2.set_line_join(ROUND_JOIN);
roads2_rule_2.append(line_symbolizer(roads2_rule_stk_2));
roads2_style_2.add_rule(roads2_rule_2);
m.insert_style("road-fill", roads2_style_2);
// Roads 1 (The big orange ones, the highways)
feature_type_style roads1_style_1;
rule_type roads1_rule_1;
roads1_rule_1.set_filter(create_filter("[CLASS] = 1"));
stroke roads1_rule_stk_1(Color(188,149,28),4);
roads1_rule_stk_1.set_line_cap(ROUND_CAP);
roads1_rule_stk_1.set_line_join(ROUND_JOIN);
roads1_rule_1.append(line_symbolizer(roads1_rule_stk_1));
roads1_style_1.add_rule(roads1_rule_1);
m.insert_style("highway-border", roads1_style_1);
feature_type_style roads1_style_2;
rule_type roads1_rule_2;
roads1_rule_2.set_filter(create_filter("[CLASS] = 1"));
pdf_line_pattern_symbolizer lsym(DEMODIR"pdf/images/a.png","png",3,100,100,10,10);
roads1_rule_2.append(lsym);
roads1_style_2.add_rule(roads1_rule_2);
m.insert_style("highway-fill", roads1_style_2);
// Populated Places
feature_type_style popplaces_style;
rule_type popplaces_rule;
text_symbolizer popplaces_text_symbolizer("GEONAME","arial",3,Color(50,50,100));
popplaces_text_symbolizer.set_halo_fill(Color(255,255,200));
popplaces_text_symbolizer.set_halo_radius(1);
popplaces_rule.append(popplaces_text_symbolizer);
popplaces_style.add_rule(popplaces_rule);
m.insert_style("popplaces",popplaces_style );
//---------------------------------
//Create Layers and assign styles
// Layers
// Provincial polygons
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"boundaries";
Layer lyr("Provinces");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("provinces");
m.addLayer(lyr);
}
// Drainage
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"qcdrainage";
Layer lyr("Quebec Hydrography");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("drainage");
m.addLayer(lyr);
}
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"ontdrainage";
Layer lyr("Ontario Hydrography");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("drainage");
m.addLayer(lyr);
}
// Provincial boundaries
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"boundaries_l";
Layer lyr("Provincial borders");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("provlines");
m.addLayer(lyr);
}
// Roads
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"roads";
Layer lyr("Roads");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("smallroads");
lyr.add_style("road-border");
lyr.add_style("road-fill");
// lyr.add_style("highway-border");
lyr.add_style("highway-fill");
m.addLayer(lyr);
}
// popplaces
{
parameters p;
p["type"]="shape";
p["file"]=DEMODATA"popplaces";
p["encoding"] = "latin1";
Layer lyr("Populated Places");
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr.add_style("popplaces");
m.addLayer(lyr);
}
//---------------------------------
//Set map visible area
// m.zoom_all();
m.zoomToBox(Envelope<double>(1405120.04127408,-247003.813399447,1706357.31328276,-25098.593149577));
//---------------------------------
//Render to a png (you'll need to change the font in the popplaces style for this to work
/* Image32 buf(m.getWidth(),m.getHeight());
agg_renderer<Image32> ren(m,buf,0,0);
ren.apply();
save_to_file<ImageData32>(buf.data(),"canada2.png","png");
*/
//=================================
//Render to a pdf
//---------------------
//create the page layout for the pdf
//this specifies the units used on the page, and dimensions of the page in those units.
pdf_renderer_layout page_layout("mm", 841, 594);
//set the location of the map within the page
page_layout.set_map_area(20, 40, m.getWidth(), m.getHeight());
page_layout.set_map_area_border(true); //Draw a border around the map
page_layout.set_map_area_border_width(0.75); // - width of the border
page_layout.set_background_colour(Color(200, 200, 225)); //Page background colour
page_layout.set_map_grid(true); //Draw a grid across the map (on its own layer so it can be turned on/off)
page_layout.set_map_grid_colour(Color(0,128,255,200)); // - Grid colour
page_layout.set_map_grid_linewidth(0.33); // - Grid line width
page_layout.set_border_scales(true); //Draw scales around the map border
page_layout.set_map_grid_approx_spacing(20); // - approximate length of each grid segment, this will be tweaked to get nice units (e.g. 20mm may equate to 5832.78 meters, so it'll be changed to something like 22 to give 6000 meters)
page_layout.set_border_scale_width(3); // - width of the scales around the border
page_layout.set_border_scale_linewidth(0.25); // - line width of the border scales
page_layout.set_scale_bar(true); //Draw a scale bar
page_layout.set_scale_bar_area(Envelope<double>(50,555, 150, 567)); // - position and size of the scale bar. The width will be tweaked to give proper units.
// page_layout.set_scale_bar_factor(1,"Meters"); // - Give the scale factor and label. E.g. if the map projection outputs in meters, the scale factor is 1, but if you want kilometers, specify 0.001.
// page_layout.set_scale_bar_factor(0.001,"Kilometers");
// page_layout.set_scale_bar_factor(39.3700787,"Inches");
page_layout.set_scale_bar_factor(0.000621371192,"Miles");
// page_layout.set_scale_bar_factor(0.546806649,"Fathoms");
// page_layout.set_scale_bar_factor(3.2808399,"Feet");
page_layout.add_overlay_image(DEMODIR"pdf/images/c.pdf", 5, 5, 200, 40, 1.2);
page_layout.add_overlay_image(DEMODIR"pdf/images/a.png", 500, 460, 100, 100, -25);
page_layout.add_overlay_image(DEMODIR"pdf/images/b.png", 650, 400, 100, 100, 13.25);
//---------------------
//render the pdf to a file
render_to_pdf(m, page_layout, "fancy_demo.pdf", false);
// render_to_pdf(m, page_layout, "fancy_demo-compressed.pdf", true);
}

View file

@ -47,6 +47,12 @@ namespace mapnik {
{
names_.insert(sym.get_name());
}
#if ENABLE_PDF
void operator () (pdf_shield_symbolizer const &sym)
{
names_.insert(sym.get_name());
}
#endif //ENABLE_PDF
void operator () (shield_symbolizer const& sym)
{
names_.insert(sym.get_name());

View file

@ -142,7 +142,7 @@ namespace mapnik
};
typedef ImageData<unsigned> ImageData32;
typedef ImageData<uint8_t> ImageData8;
typedef ImageData<boost::uint8_t> ImageData8;
}
#endif //IMAGE_DATA_HPP

View file

@ -24,6 +24,7 @@
#ifndef _OCTREE_HPP_
#define _OCTREE_HPP_
#include <boost/cstdint.hpp>
#include <boost/format.hpp>
#include <boost/utility.hpp>
#include <vector>
@ -32,7 +33,7 @@
namespace mapnik {
typedef uint8_t byte ;
typedef boost::uint8_t byte;
struct rgb
{
byte r;
@ -82,7 +83,7 @@ namespace mapnik {
unsigned greens;
unsigned blues;
unsigned count;
uint8_t index;
boost::uint8_t index;
};
struct node_cmp
{
@ -214,9 +215,9 @@ namespace mapnik {
if (itr->count != 0)
{
unsigned count = itr->count;
palette.push_back(rgb(uint8_t(itr->reds/float(count)),
uint8_t(itr->greens/float(count)),
uint8_t(itr->blues/float(count))));
palette.push_back(rgb(boost::uint8_t(itr->reds/float(count)),
boost::uint8_t(itr->greens/float(count)),
boost::uint8_t(itr->blues/float(count))));
itr->index = palette.size() - 1;
}
for (unsigned i=0; i < 8 ;++i)

View file

@ -102,7 +102,7 @@ namespace mapnik {
{
unsigned val = row[x];
mapnik::rgb c((val)&0xff, (val>>8)&0xff, (val>>16) & 0xff);
uint8_t index = tree.quantize(c);
boost::uint8_t index = tree.quantize(c);
row_out[x] = index;
}
}
@ -123,7 +123,7 @@ namespace mapnik {
{
unsigned val = row[x];
mapnik::rgb c((val)&0xff, (val>>8)&0xff, (val>>16) & 0xff);
uint8_t index = tree.quantize(c);
boost::uint8_t index = tree.quantize(c);
if (x%2 > 0) index = index<<4;
row_out[x>>1] |= index;
}

View file

@ -32,6 +32,12 @@
#include <mapnik/shield_symbolizer.hpp>
#include <mapnik/text_symbolizer.hpp>
#include <mapnik/markers_symbolizer.hpp>
#ifdef ENABLE_PDF
#include "pdf/pdf_point_symbolizer.hpp"
#include "pdf/pdf_polygon_pattern_symbolizer.hpp"
#include "pdf/pdf_line_pattern_symbolizer.hpp"
#include "pdf/pdf_shield_symbolizer.hpp"
#endif
#include <mapnik/filter.hpp>
#include <mapnik/filter_visitor.hpp>
@ -110,7 +116,14 @@ namespace mapnik
shield_symbolizer,
text_symbolizer,
building_symbolizer,
markers_symbolizer> symbolizer;
markers_symbolizer
#ifdef ENABLE_PDF
,pdf_point_symbolizer,
pdf_polygon_pattern_symbolizer,
pdf_line_pattern_symbolizer,
pdf_shield_symbolizer
#endif
> symbolizer;
typedef std::vector<symbolizer> symbolizers;

View file

@ -30,7 +30,7 @@
namespace mapnik
{
class symbolizer_with_image {
class MAPNIK_DECL symbolizer_with_image {
public:
boost::shared_ptr<ImageData32> get_image() const;
const std::string & get_filename() const;

View file

@ -29,6 +29,8 @@
#include <boost/utility.hpp>
#include <string>
namespace mapnik {
class transcoder : private boost::noncopyable
{

View file

@ -0,0 +1,172 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef FONT_ENGINE_PDF_HPP
#define FONT_ENGINE_PDF_HPP
// mapnik
#include <mapnik/color.hpp>
#include <mapnik/utils.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/geometry.hpp>
#include <mapnik/text_path.hpp>
// boost
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/mutex.hpp>
// stl
#include <string>
#include <vector>
#include <map>
#include <iostream>
// WX
#include <wx/pdfdoc.h>
namespace mapnik
{
class pdf_text_renderer : private boost::noncopyable
{
private:
//! \brief Records width and height of a character
typedef std::pair<double,double> char_dimension_t;
public:
//! \brief Constructor
//!
//! \param[in] _pdf The PDF document
pdf_text_renderer(wxPdfDocument &_pdf);
//! \brief Sets the options for using external fonts
//!
//! \param[in] externalFontPath Path to the fonts, and the generated xml files.
//! \param[in] enableSubsetting Enables/Disables font subsetting to reduce file size.
void set_external_font_options(const std::wstring& externalFontPath, const bool enableSubsetting);
//! \brief Embeds a new font
//!
//! \param[in] fontName The name to use for the font internally, does not need to be related
//! to the real font name.
//! \param[in] fontXMLFile The xml file generated with the wxpdfdoc makefont utility
//! \return true if successfull, false otherwise
bool add_external_font(const std::wstring& fontName, const std::wstring& fontXMLFile);
//! \brief Set the font to use
//!
//! The font must either be one of the pdf internal fonts (arial, courier, times, symbol, zapfDingbats)
//! or have been loaded with add_external_font(...).
//!
//! \param[in] fontThe name of the font
//! \return True if successfully set, false otherwise
bool set_font(const std::string& font);
//! \brief Set the font to use
//!
//! The font must either be one of the pdf internal fonts (arial, courier, times, symbol, zapfDingbats)
//! or have been loaded with add_external_font(...).
//!
//! \param[in] fontThe name of the font
//! \return True if successfully set, false otherwise
bool set_font(const std::wstring& font);
//! \brief Set the font size
//!
//! \param[in] size The size in pdf units
void set_size(const double size);
//! \brief Set the font colour
//!
//! \param[in] _fill The colour
void set_fill(mapnik::Color const& _fill);
//! \brief Set the halo colour
//!
//! \param[in] _halo The colour
void set_halo_fill(mapnik::Color const& _halo);
//! \brief Set the halo radius
//!
//! \param[in] radius The radius in pdf units
void set_halo_radius( const double radius );
//! \brief Get the dimensions of a character in mm
//!
//! <b>Note:</b> The height of the character is taken to be the
//! height of a capital letter plus the descent height of the font. This
//! should give reasonable results.
//!
//! \param[in] c The character
//! \return The characters dimensions.
pdf_text_renderer::char_dimension_t character_dimensions(const unsigned c);
//! \brief Calculates the dimensions of all the characters and the whole string
//!
//! \param[in] info The string_info to populate
void get_string_info(string_info *info);
//! \brief Prepares to render a whole lot of text
//!
//! This sets the line style and colour in case we are rendering
//! text halos.
void prepare_render(void);
//! \brief Renders a text path
//!
//! This renders the text path calculated by the placement_finder.
//!
//! \param[in] path The path to render
//! \param[in] x0 x offset
//! \param[in] y0 y offset
void render(text_path *path, double x0, double y0);
private:
wxPdfDocument *pdf; //!< The PDF Document
const std::wstring default_font_name; //!< The default font. This must be an internal pdf font (arial, courier, times, symbol, zapfDingbats)
std::wstring font_name; //!< Name of the font
double font_size; //!< Font size in pdf units
const wxPdfFontDescription *font_description; //!< Internal information about a font
mapnik::Color fill; //!< Fill colour
mapnik::Color halo_fill; //!< Halo colour
double halo_radius; //!< Halo radius in pdf units
};
}
#endif //FONT_ENGINE_PDF_HPP

View file

@ -0,0 +1,105 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef PDF_LINE_PATTERN_SYMBOLIZER_HPP
#define PDF_LINE_PATTERN_SYMBOLIZER_HPP
// mapnik
#include <mapnik/line_pattern_symbolizer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/stroke.hpp>
//boost
#include <boost/shared_ptr.hpp>
namespace mapnik
{
class MAPNIK_DECL pdf_line_pattern_symbolizer
: public line_pattern_symbolizer
{
public:
//! \brief constructor
//!
//! \param[in] file The image file
//! \param[in] type The type of the file, e.g. "png"
//! \param[in] line_width The width of the line (in pdf units)
//! \param[in] image_width The width of the image in pixels
//! \param[in] image_height The height of the image in pixels
//! \param[in] _output_width The width of the image tile (in pdf units)
//! \param[in] _output_height The height of the image tile (in pdf units)
pdf_line_pattern_symbolizer(std::string const& file,
std::string const& type,
const double line_width,
const unsigned image_width, const unsigned image_height,
const double _output_width, const double _output_height);
//! \brief constructor
//!
//! Copies the supplied pdf_line_pattern_symbolizer
pdf_line_pattern_symbolizer(pdf_line_pattern_symbolizer const& rhs);
//! \brief constructor
//!
//! Takes a line_pattern_symbolizer and turns it into a pdf_line_pattern_symbolizer
//!
//! \param[in] rhs The line_pattern_symbolizer to start with
//! \param[in] line_width The width of the line (in pdf units)
//! \param[in] _output_width The width of the image tile (in pdf units)
//! \param[in] _output_height The height of the image tile (in pdf units)
pdf_line_pattern_symbolizer(line_pattern_symbolizer const& rhs, const double line_width, const double _output_width, const double _output_height);
//! \brief Sets the output size of the tile
//!
//! \param[in] width Width in pdf units
//! \param[in] height Height in pdf units
void set_output_size(const double width, const double height);
//! \brief Gets the output width of the tile
//!
//! \return The output width of the image in pdf units
double get_output_width(void) const { return output_width; };
//! \brief Gets the output height of the tile
//!
//! \return The output height of the image in pdf units
double get_output_height(void) const { return output_height; };
//! \brief Gets the line stroke
//!
//! \return the line stroke
stroke const& get_stroke() const { return line_stroke; };
//! \brief Sets the line stroke
//!
//! \param[in] stroke The stroke to use
void set_stroke(stroke const& stroke) { line_stroke = stroke; };
private:
double output_width; //!< output width of pattern in pdf units
double output_height; //!< output height of pattern in pdf units
stroke line_stroke; //!< the line stroke
};
}
#endif //PDF_LINE_PATTERN_SYMBOLIZER_HPP

View file

@ -0,0 +1,89 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef PDF_POINT_SYMBOLIZER_HPP
#define PDF_POINT_SYMBOLIZER_HPP
#include <mapnik/graphics.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/point_symbolizer.hpp>
#include <boost/shared_ptr.hpp>
namespace mapnik
{
class MAPNIK_DECL pdf_point_symbolizer
: public point_symbolizer
{
public:
explicit pdf_point_symbolizer();
//! \brief constructor
//!
//! \param[in] file The image file
//! \param[in] type The type of the file, e.g. "png"
//! \param[in] image_width The width of the image in pixels
//! \param[in] image_height The height of the image in pixels
//! \param[in] _output_width The scaled (output) width of the image (in pdf units)
//! \param[in] _output_height The scaled (output) height of the image (in pdf units)
pdf_point_symbolizer( std::string const& file,
std::string const& type,
unsigned image_width, unsigned image_height,
double _output_width, double _output_height);
//! \brief constructor
//!
//! Copies the supplied pdf_point_symbolizer
pdf_point_symbolizer(pdf_point_symbolizer const& rhs);
//! \brief constructor
//!
//! Takes a point_symbolizer and turns it into a pdf_point_symbolizer
//!
//! \param[in] rhs The point_symbolizer to start with
//! \param[in] _output_width The scaled (output) width of the image (in pdf units)
//! \param[in] _output_height The scaled (output) height of the image (in pdf units)
pdf_point_symbolizer(point_symbolizer const& rhs, const double _output_width, const double _output_height);
//! \brief Sets the output size of the image
//!
//! \param[in] width Width in pdf units
//! \param[in] height Height in pdf units
void set_output_size(const double width, const double height);
//! \brief Gets the output width of an image
//!
//! \return The output width of the image in pdf units
double get_output_width(void) const { return output_width; };
//! \brief Gets the output height of an image
//!
//! \return The output height of the image in pdf units
double get_output_height(void) const { return output_height; };
private:
double output_width; //!< output width of image in pdf units
double output_height; //!< output height of image in pdf units
};
}
#endif // PDF_POINT_SYMBOLIZER_HPP

View file

@ -0,0 +1,89 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef PDF_POLYGON_PATTERN_SYMBOLIZER_HPP
#define PDF_POLYGON_PATTERN_SYMBOLIZER_HPP
// mapnik
#include <mapnik/polygon_pattern_symbolizer.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/symbolizer.hpp>
//boost
#include <boost/shared_ptr.hpp>
namespace mapnik
{
class MAPNIK_DECL pdf_polygon_pattern_symbolizer
: public polygon_pattern_symbolizer
{
public:
//! \brief constructor
//!
//! \param[in] file The image file
//! \param[in] type The type of the file, e.g. "png"
//! \param[in] image_width The width of the image in pixels
//! \param[in] image_height The height of the image in pixels
//! \param[in] _output_width The scaled (output) width of the image tile (in pdf units)
//! \param[in] _output_height The scaled (output) height of the image tile (in pdf units)
pdf_polygon_pattern_symbolizer(std::string const& file,
std::string const& type,
unsigned image_width, unsigned image_height,
double _output_width, double _output_height);
//! \brief constructor
//!
//! Copies the supplied pdf_polygon_pattern_symbolizer
pdf_polygon_pattern_symbolizer(pdf_polygon_pattern_symbolizer const& rhs);
//! \brief constructor
//!
//! Takes a polygon_pattern_symbolizer and turns it into a pdf_polygon_pattern_symbolizer
//!
//! \param[in] rhs The polygon_pattern_symbolizer to start with
//! \param[in] _output_width The width of the image tile (in pdf units)
//! \param[in] _output_height The height of the image tile (in pdf units)
pdf_polygon_pattern_symbolizer(polygon_pattern_symbolizer const& rhs, const double _output_width, const double _output_height);
//! \brief Sets the output size of the tile
//!
//! \param[in] width Width in pdf units
//! \param[in] height Height in pdf units
void set_output_size(const double width, const double height);
//! \brief Gets the output width of the tile
//!
//! \return The output width of the image in pdf units
double get_output_width(void) const { return output_width; };
//! \brief Gets the output height of the tile
//!
//! \return The output height of the image in pdf units
double get_output_height(void) const { return output_height; };
private:
double output_width; //!< output width of pattern tile in pdf units
double output_height; //!< output height of pattern tile in pdf units
};
}
#endif //PDF_POLYGON_PATTERN_SYMBOLIZER_HPP

View file

@ -0,0 +1,249 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
//! \file pdf_renderer.hpp
//! \brief PDF renderer for mapnik data
//!
#ifndef PDF_RENDERER_H
#define PDF_RENDERER_H
// pdf renderer
#include "font_engine_pdf.hpp"
namespace mapnik { class pdf_renderer_layout; }
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/feature_style_processor.hpp>
#include <mapnik/font_engine_freetype.hpp>
#include <mapnik/label_collision_detector.hpp>
#include <mapnik/placement_finder.hpp>
#include <mapnik/map.hpp>
#include <mapnik/image_data.hpp>
// boost
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
// WX
#include <wx/pdfdoc.h>
class wxImage;
namespace mapnik {
//! \brief round a number to nearest integer
//!
//! \param[in] x number to round
//! \return number rounded to nearest integer
#define round(x) ( (x)>=0 ? (long)((x)+0.5) : (long)((x)-0.5) )
//class prototypes
class pdf_point_symbolizer;
class pdf_line_pattern_symbolizer;
class pdf_polygon_pattern_symbolizer;
class pdf_shield_symbolizer;
//! \brief Renderer for PDFs
class MAPNIK_DECL pdf_renderer
: public feature_style_processor<pdf_renderer>, private boost::noncopyable
{
public:
//! \brief Constructor
//!
//! \param[in] m The map data
//! \param[in] _pdf The PDF document to populate
//! \param[in] _page_layout Describes the layout of the map page
//! \param[in] offset_x Number of pdf units to offset the map data in x direction
//! \param[in] offset_y Number of pdf units to offset the map data in y direction
pdf_renderer(Map const& m, wxPdfDocument &_pdf, const pdf_renderer_layout &_page_layout, const double offset_x=0.0, const double offset_y=0.0);
//! \brief Sets the options for using external fonts
//!
//! See http://wxcode.sourceforge.net/docs/wxpdfdoc/makefont.html for how
//! to generate the required xml files for external fonts.
//!
//! For example:
//! - ttf2ufm -a trebuc.ttf trebuc
//! - makefont -a trebuc.afm -f trebuc.ttf -e cp1252
//!
//! \param[in] externalFontPath Path to the fonts, and the generated xml files.
//! \param[in] enableSubsetting Enables/Disables font subsetting to reduce file size.
void set_external_font_options(const std::wstring& externalFontPath, const bool enableSubsetting);
//! \brief Embeds a new font
//!
//! See set_external_font_options for how to generate the xml file.
//!
//! \param[in] fontName The name to use for the font internally, does not need to be related
//! to the real font name.
//! \param[in] fontXMLFile The xml file generated with the wxpdfdoc makefont utility
//! \return true if successfull, false otherwise
bool add_external_font(const std::wstring& fontName, const std::wstring& fontXMLFile);
//! \brief Called at the start of map processing
//!
//! \param[in] map The map data
void start_map_processing(Map const& map);
//! \brief Called at the end of map processing
//!
//! \param[in] map The map data
void end_map_processing(Map const& map);
//! \brief Called before each layer is processed
//!
//! \param[in] lay The layer data
void start_layer_processing(Layer const& lay);
//! \brief Called after each layer has been proecssed
//!
//! \param[in] lay The layer data
void end_layer_processing(Layer const& lay);
//! \brief Process point symbolizer
void process(point_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process pdf point symbolizer
void process(pdf_point_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process line symbolizer
void process(line_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process line pattern symbolizer
void process(line_pattern_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process pdf line pattern symbolizer
void process(pdf_line_pattern_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process polygon symbolizer
void process(polygon_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process polygon pattern symbolizer
void process(polygon_pattern_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process pdf polygon pattern symbolizer
void process(pdf_polygon_pattern_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process raster symbolizer
void process(raster_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process shield symbolizer
void process(shield_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process pdf shield symbolizer
void process(pdf_shield_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process text symbolizer
void process(text_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process building symbolizer
void process(building_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief Process marker symbolizer
//!
//! <b> This is not currently supported by the PDF renderer</b>
void process(markers_symbolizer const& sym, Feature const& feature, proj_transform const& prj_trans);
//! \brief convert string to wstring
//!
//! \param[in] str string to convert
//! \return the wide string
static std::wstring convert_string_to_wstring(const std::string str);
private:
//! \brief Creates a wxImage from an ImageData32 image
//!
//! This performs all the pixel format conversions. dst is
//! created by the function, and must be deleted by the
//! caller when no longer required.
//!
//! \param[in] src The source image
//! \param[in] dst Pointer to the wx image pointer that will be created and returned
void create_wximage_from_imagedata(boost::shared_ptr<ImageData32> src, wxImage **dst);
//! \brief Creates a wxImage from an ImageData32 image
//!
//! This performs all the pixel format conversions. dst is
//! created by the function, and must be deleted by the
//! caller when no longer required.
//!
//! \param[in] src The source image
//! \param[in] dst Pointer to the wx image pointer that will be created and returned
void create_wximage_from_imagedata(const ImageData32* src, wxImage **dst);
//! \brief Generates a pdf shape from a transformed path
//!
//! This takes a path (wrapped with a coordinate transform) and converts
//! it into a pdf shape.
//!
//! \param[in] transformed_path The transformed path
//! \param[in] shape The shape to fill
void create_shape_from_path(const coord_transform2<CoordTransform,geometry2d> &transformed_path, wxPdfShape &shape);
//! \brief Get a unique image name
//!
//! This uses unnamed_image_count to generate a unique name
//!
//! \return The name
std::wstring generate_unique_image_name(void);
//! \brief Do all the overlay rendering
//!
//! This parses the page_layout to render all the additional
//! content.
void render_overlays(void);
//! \brief Render overlay images
void render_overlay_images(void);
//! \brief Render the grid
void render_overlay_grid(void);
//! \brief Render the scale bar
void render_overlay_scale_bar(void);
private:
Map const& map; //!< The map being rendered
CoordTransform coord_trans; //!< Converter for moving between map cartesian coordinates and pdf coordinates
pdf_text_renderer text_renderer; //!< Utility for rendering pdf text
label_collision_detector4 detector; //!< Collision detector
wxPdfDocument *pdf; //!< The pdf document being filled
const pdf_renderer_layout &page_layout; //!< The layout of the map page
double line_miter_limit; //!< Line miter limit
unsigned int unnamed_image_count; //!< Counter used for generating unique name for unnamed images (e.g. rasters)
};
}
#endif //PDF_RENDERER_H

View file

@ -0,0 +1,240 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
//! \file pdf_renderer_layout.hpp
//! \brief Describes the paper page layout for the pdf map
//!
#ifndef PDF_RENDERER_LAYOUT_H
#define PDF_RENDERER_LAYOUT_H
// WX
#include <wx/pdfdoc.h>
// STD
#include <vector>
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/color.hpp>
#include <mapnik/envelope.hpp>
namespace mapnik {
//! \brief Describes the layout of the page containing the map
class MAPNIK_DECL pdf_renderer_layout {
friend class pdf_renderer;
public:
//! \brief Structure describing overlay images
typedef struct overlay_image_data {
std::string file; //!< The image file
double x; //!< Top left corner x coordinate
double y; //!< Top left corner y coordinate
double width; //!< Width of the image (0 means scale proportional to height)
double height; //!< Height of the image (0 means scale proportional to width)
double angle; //!< Rotation angle (degrees)
} overlay_image_data;
public:
//! \brief Constructor
//!
//! \param[in] units The units of all the measurements, e.g. "mm","pt","in"
//! \param[in] width The width of the page (in pdf units)
//! \param[in] height The height of the page (in pdf units)
//! \param[in] portrait The orientation of the page, true for portrait, false for landscape
pdf_renderer_layout(const std::string &units, const double width, const double height, const bool portrait = true);
//! \brief Destructor
~pdf_renderer_layout();
//! Get the page width
//! \return The page width
const double get_page_width(void) const {return page_area.width(); };
//! Get the page height
//! \return The page height
const double get_page_height(void) const {return page_area.height(); };
//! Get the page orientation
//! \return The page orientation
const bool get_page_portrait(void) const {return page_portrait; };
//! Get the page units
//! \return The page units
const std::string &get_page_units(void) const {return page_units; };
//----------------------------------------------------------------------------------------------------
// Page layout
//! \brief Set the font to use for overlays
//!
//! \param[in] name The name of the font
void set_font(const std::string font) { font_name = font; };
//! \brief set the page background colour
//!
//! This is separate to the map background colour in the Map class
//!
//! \param[in] colour The background colour
void set_background_colour(const Color &colour) { page_background_colour = colour; };
//! \brief Set the area of the page to render the map
//!
//! \param[in] x Top left corner x coordinate
//! \param[in] y Top left corner y coordinate
//! \param[in] width Width of the area
//! \param[in] height Height of the area
void set_map_area(const double x, const double y, const double width, const double height);
//! \brief Set whether to draw a map border
//!
//! \param[in] drawBorder True for yes, false for no
void set_map_area_border(const bool drawBorder) { map_area_border = drawBorder; };
//! \brief Set the map border width
//!
//! \param[in] width Width of the border
void set_map_area_border_width(const double width) { map_area_border_width = width; };
//----------------------------------------------------------------------------------------------------
// Overlay images
//! \brief Add an overlay image
//!
//! Images added here will be overlaid on the map. You can add
//! png and pdf files.
//!
//! \param[in] image Image filename
//! \param[in] x Top left corner x coordinate
//! \param[in] y Top left corner y coordinate
//! \param[in] width Width of the area
//! \param[in] height Height of the area
//! \param[in] angle Rotation angle (degrees)
void add_overlay_image(const std::string &image, const double x, const double y, const double width, const double height, const double angle);
//----------------------------------------------------------------------------------------------------
// Grids
//! \brief Enable/Disable drawing map grid
//!
//! \param[in] enable True to enable, false to disable
void set_map_grid(const bool enable) { map_grid = enable; };
//! \brief Enable/Disable drawing scales around edge of map
//!
//! \param[in] enable True to enable, false to disable
void set_border_scales(const bool enable) { border_scales = enable; };
//! \brief Sets the approximate spacing of the grid lines
//!
//! This will be tweaked to give nice round numbers to the grid lines.
//!
//! \param[in] spacing The approx spacing of the grid lines
void set_map_grid_approx_spacing(const double spacing) { map_grid_approx_spacing = spacing; };
//! \brief Set width of scale bars around edge of map
//!
//! \param[in] width The thickness of the bars
void set_border_scale_width(const double width) { border_scale_width = width; };
//! \brief Set thickness of lines around the grid edge
//!
//! \param[in] width The thickness of the lines
void set_border_scale_linewidth(const double width) { border_scale_linewidth = width; };
//! \brief Set the colour of the grid across the map
//!
//! \param[in] colour The colour of the grid (with alpha)
void set_map_grid_colour(const Color &colour) { map_grid_colour = colour; };
//! \brief Set the map grid line width
//!
//! \param[in] width The width of the map grid lines
void set_map_grid_linewidth(const double width) { map_grid_linewidth = width; };
//----------------------------------------------------------------------------------------------------
// Scale bar
//! \brief Enable/Disable the scale bar
//!
//! \param[in] enable True to draw the scale bar, false to disable
void set_scale_bar(const bool enable) { scale_bar = enable; };
//! \brief Set the scale bar size and location
//!
//! The width of the scale bar will be adjusted to make sense, but it will be
//! centered on the provided area.
//!
//! \param[in] area The area
void set_scale_bar_area(const Envelope<double> area) { scale_bar_area = area; };
//! \brief Sets the scale bar scale factor and label
//!
//! See scale_bar_factor and scale_bar_unit for details.
//!
//! \param[in] scale_factor The scale factor
void set_scale_bar_factor(const double scale_factor, const std::string &unit) { scale_bar_factor = scale_factor; scale_bar_unit = unit; };
private:
//common parameters
std::string font_name; //!< The name of the font to use for text in the overlays
//page layout
const Envelope<double> page_area; //!< Page area, specified in the constructors pdf document
const std::string page_units; //!< PDF units of measure
bool page_portrait; //!< True if page is portrait, false for landscape
Color page_background_colour; //!< Background page colour (default white)
Envelope<double> map_area; //!< Area of the page that the map will occupy
bool map_area_border; //!< Whether to draw border around map
double map_area_border_width; //!< Thickness of map border (only drawn if no grid/border scales)
//overlay images
std::vector<overlay_image_data *> overlay_images; //!< List of overlay images
typedef std::vector<overlay_image_data *>::iterator OIDitr; //!< overlay image vector iterator
//grids
bool map_grid; //!< True for draw grid across map
bool border_scales; //!< True to draw edge scales, false otherwise
double map_grid_approx_spacing; //!< Approximate spacing between grid. This will be tweaked to give round coordinates
double border_scale_width; //!< Thickness of grid bars bordering map
double border_scale_linewidth; //!< Thickness of the lines around the grid edge (also used in the scale bar)
Color map_grid_colour; //!< Colour to draw the grid
double map_grid_linewidth; //!< Thickness of the map grid lines
//scale bar
bool scale_bar; //!< True to draw scale bar
Envelope<double> scale_bar_area; //!< Where to draw the scale bar. The width will be adjusted to give good units, but it will be centered on the given area.
double scale_bar_factor; //!< The scale factor to convert 1 projection unit into 1 'scale_bar_unit'.
std::string scale_bar_unit; //!< The units of the scale bar, e.g. 'meters' 'kilometers' 'miles'
};
} //namespace mapnik
#endif //PDF_RENDERER_LAYOUT_H

View file

@ -0,0 +1,50 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
//! \file pdf_renderer_utility.hpp
//! \brief PDF renderer utilities
//!
#ifndef PDF_RENDERER_UTILITY_H
#define PDF_RENDERER_UTILITY_H
namespace mapnik {
#include <mapnik/config.hpp>
//class prototypes
class Map;
class pdf_renderer_layout;
//! \brief Render a map to pdf using a layout
//!
//! \param[in] map The map to render
//! \param[in] layout The page layouit
//! \param[in] filename The output file name
//! \param[in] compress Enable/Disable pdf compression
MAPNIK_DECL void render_to_pdf(const mapnik::Map& map, const mapnik::pdf_renderer_layout &layout, const std::string& filename, const bool compress = true);
} //namespace mapnik
#endif //PDF_RENDERER_UTILITY_H

View file

@ -0,0 +1,95 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef PDF_SHIELD_SYMBOLIZER_HPP
#define PDF_SHIELD_SYMBOLIZER_HPP
#include <mapnik/graphics.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/shield_symbolizer.hpp>
#include <boost/shared_ptr.hpp>
namespace mapnik
{
class MAPNIK_DECL pdf_shield_symbolizer
: public shield_symbolizer
{
public:
//! \brief constructor
//!
//! \param[in] name The name of the attribute to use as the label
//! \param[in] face_name The name of the font
//! \param[in] size The size of the font
//! \param[in] fill The font colour
//! \param[in] file The image file
//! \param[in] type The type of the file, e.g. "png"
//! \param[in] image_width The width of the image in pixels
//! \param[in] image_height The height of the image in pixels
//! \param[in] _output_width The scaled (output) width of the image (in pdf units)
//! \param[in] _output_height The scaled (output) height of the image (in pdf units)
pdf_shield_symbolizer(std::string const& name,
std::string const& face_name,
unsigned size,
Color const& fill,
std::string const& file,
std::string const& type,
unsigned image_width, unsigned image_height,
double _output_width, double _output_height);
//! \brief constructor
//!
//! Copies the supplied pdf_shield_symbolizer
pdf_shield_symbolizer(pdf_shield_symbolizer const& rhs);
//! \brief constructor
//!
//! Takes a pdf_shield_symbolizer and turns it into a pdf_shield_symbolizer
//!
//! \param[in] rhs The pdf_shield_symbolizer to start with
//! \param[in] _output_width The width of the image in pdf units
//! \param[in] _output_height The height of the image in pdf units
pdf_shield_symbolizer(shield_symbolizer const& rhs, const double _output_width, const double _output_height);
//! \brief Sets the output size of the image
//!
//! \param[in] width Width in pdf units
//! \param[in] height Height in pdf units
void set_output_size(const double width, const double height);
//! \brief Gets the output width of an image
//!
//! \return The output width of the image in pdf units
double get_output_width(void) const { return output_width; };
//! \brief Gets the output height of an image
//!
//! \return The output height of the image in pdf units
double get_output_height(void) const { return output_height; };
private:
double output_width; //!< output width of image in pdf units
double output_height; //!< output height of image in pdf units
};
}
#endif // PDF_SHIELD_SYMBOLIZER_HPP

758
msvc/agg/agg.vcproj Normal file
View file

@ -0,0 +1,758 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="agg"
ProjectGUID="{3BFF8124-56D1-4722-81B9-8B1810D1825C}"
RootNamespace="agg"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="$(MAPNIKDIR)\agg\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\agg\src\agg_arc.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_arrowhead.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_bezier_arc.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_bspline.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_curves.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_embedded_raster_fonts.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_gsv_text.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_image_filters.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_line_aa_basics.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_line_profile_aa.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_rounded_rect.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_sqrt_tables.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_trans_affine.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_trans_double_path.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_trans_single_path.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_trans_warp_magnifier.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vcgen_bspline.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vcgen_contour.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vcgen_dash.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vcgen_markers_term.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vcgen_smooth_poly1.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vcgen_stroke.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vpgen_clip_polygon.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vpgen_clip_polyline.cpp"
>
</File>
<File
RelativePath="..\..\agg\src\agg_vpgen_segmentator.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\agg\include\agg_alpha_mask_u8.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_arc.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_array.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_arrowhead.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_basics.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_bezier_arc.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_bitset_iterator.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_blur.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_bounding_rect.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_bspline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_clip_liang_barsky.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_color_gray.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_color_rgba.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_config.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_adaptor_vcgen.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_adaptor_vpgen.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_bspline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_clip_polygon.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_clip_polyline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_close_polygon.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_concat.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_contour.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_curve.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_dash.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_gpc.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_marker.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_marker_adaptor.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_segmentator.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_shorten_path.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_smooth_poly1.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_stroke.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_transform.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_conv_unclose_polygon.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_curves.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_dda_line.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_ellipse.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_ellipse_bresenham.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_embedded_raster_fonts.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_font_cache_manager.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_gamma_functions.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_gamma_lut.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_glyph_raster_bin.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_gradient_lut.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_gsv_text.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_image_accessors.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_image_filters.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_line_aa_basics.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_math.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_math_stroke.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_path_length.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_path_storage.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_path_storage_integer.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pattern_filters_rgba.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pixfmt_amask_adaptor.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pixfmt_gray.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pixfmt_rgb.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pixfmt_rgb_packed.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pixfmt_rgba.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_pixfmt_transposer.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rasterizer_cells_aa.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rasterizer_compound_aa.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rasterizer_outline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rasterizer_outline_aa.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rasterizer_scanline_aa.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rasterizer_sl_clip.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_base.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_markers.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_mclip.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_outline_aa.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_outline_image.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_primitives.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_raster_text.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_renderer_scanline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rendering_buffer.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rendering_buffer_dynarow.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_rounded_rect.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_scanline_bin.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_scanline_boolean_algebra.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_scanline_p.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_scanline_storage_aa.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_scanline_storage_bin.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_scanline_u.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_shorten_path.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_simul_eq.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_allocator.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_converter.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_gouraud.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_gouraud_gray.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_gouraud_rgba.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_gradient.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_gradient_alpha.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_image_filter.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_image_filter_gray.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_image_filter_rgb.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_image_filter_rgba.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_interpolator_adaptor.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_interpolator_linear.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_interpolator_persp.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_interpolator_trans.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_pattern_gray.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_pattern_rgb.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_pattern_rgba.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_solid.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_span_subdiv_adaptor.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_affine.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_bilinear.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_double_path.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_lens.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_perspective.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_single_path.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_viewport.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_trans_warp_magnifier.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_bspline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_contour.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_dash.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_markers_term.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_smooth_poly1.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_stroke.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vcgen_vertex_sequence.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vertex_sequence.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vpgen_clip_polygon.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vpgen_clip_polyline.h"
>
</File>
<File
RelativePath="..\..\agg\include\agg_vpgen_segmentator.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -0,0 +1,356 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="binding_python"
ProjectGUID="{D4904853-B226-4142-B5AD-871BEE3C497B}"
RootNamespace="binding_python"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(PYTHONDIR)\include&quot;;&quot;$(MAPNIKDIR)\bindings\python&quot;;&quot;$(MAPNIKDIR)\include&quot;;&quot;$(MAPNIKDIR)\thirdparty\freetype-2.3.2\include&quot;;&quot;$(MAPNIKDIR)\agg\include&quot;;&quot;$(MAPNIKDIR)\thirdparty\jpeglib\&quot;;&quot;$(MAPNIKDIR)\thirdparty\zlib&quot;;&quot;$(MAPNIKDIR)\thirdparty\libpng&quot;;&quot;$(MAPNIKDIR)\thirdparty\icu\include\&quot;;&quot;$(WXPDFDIR)\include&quot;;&quot;$(WXDIR)/include/msvc/&quot;;&quot;$(WXDIR)/include/&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;MAPNIK_IMPORTS;XMD_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuuc.lib"
AdditionalLibraryDirectories="&quot;$(ICUDIR)/lib/&quot;;&quot;$(WXPDFDIR)/lib/&quot;;&quot;$(WXDIR)/lib/vc_lib&quot;"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="true"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy &quot;$(TargetPath)&quot;"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(TargetDir)/_mapnik.pyd&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(PYTHONDIR)/Lib/site-packages/mapnik/_mapnik.pyd&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\bindings\python\mapnik_color.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_coord.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_datasource.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_datasource_cache.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_envelope.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_feature.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_featureset.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_filter.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_font_engine.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_image.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_image_view.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_layer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_line_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_line_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_map.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_parameters.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_pdf_line_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_pdf_point_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_pdf_polygon_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_pdf_renderer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_pdf_shield_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_point_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_polygon_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_polygon_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_projection.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_python.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_query.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_raster_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_rule.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_shield_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_stroke.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_style.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\mapnik_text_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\bindings\python\python_cairo.cpp"
>
</File>
<File
RelativePath="..\..\src\stroke.cpp"
>
</File>
<File
RelativePath="..\..\src\text_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\unicode.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\bindings\python\mapnik_enumeration.hpp"
>
</File>
<File
RelativePath="..\..\bindings\python\python_optional.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\unicode.hpp"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\debug\agg.lib"
>
</File>
<File
RelativePath="..\Debug\mapnik.lib"
>
</File>
<File
RelativePath="C:\Program Files\Python25\libs\python25.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

807
msvc/core/core.vcproj Normal file
View file

@ -0,0 +1,807 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="mapnik"
ProjectGUID="{AFB929AA-7EE5-44CC-AC30-F08D120233F2}"
RootNamespace="core"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MAPNIKDIR)&quot;;&quot;$(MAPNIKDIR)\tinyxml&quot;;&quot;$(MAPNIKDIR)\include&quot;;&quot;$(MAPNIKDIR)\agg\include&quot;;&quot;$(FREETYPEDIR)\include&quot;;&quot;$(LIBTOOLDIR)\include&quot;;&quot;$(LIBPNGDIR)\include&quot;;&quot;$(LIBJPEGDIR)\include&quot;;&quot;$(PROJ4DIR)\src&quot;;&quot;$(ZLIBDIR)&quot;;&quot;$(ICUDIR)\include\&quot;;&quot;$(LIBTIFFDIR)\include\&quot;;&quot;$(MAPNIKDIR)\thirdparty\libxml\include&quot;;&quot;$(WXPDFDIR)\include&quot;;&quot;$(WXDIR)\include&quot;;&quot;$(WXDIR)\include\msvc\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;MAPNIK_EXPORTS;TIXML_USE_STL;BOOST_PROPERTY_TREE_XML_PARSER_TINYXML;ENABLE_PDF"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wxpdfdocud.lib wxbase28ud.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib comctl32.lib rpcrt4.lib icuuc.lib freetype235_D.lib libjpeg.lib ltdl.lib libpngd.lib proj.lib libtiff.lib "
ShowProgress="0"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(ICUDIR)\lib&quot;;&quot;$(WXDIR)\lib\vc_lib&quot;;&quot;$(WXPDFDIR)\lib\&quot;;&quot;$(FREETYPEDIR)\objs\&quot;;&quot;$(LIBJPEGDIR)\&quot;;&quot;$(LIBPNGDIR)\projects\visualc71\Win32_LIB_Debug\&quot;;&quot;$(LIBTIFFDIR)\libtiff\&quot;;&quot;$(LIBTOOLDIR)\lib\&quot;;&quot;$(PROJ4DIR)\src\&quot;"
IgnoreDefaultLibraryNames="libc.lib;libcmt.lib;msvcrt.lib;libcd.lib;libcmtd.lib"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="true"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy &quot;$(TargetPath)&quot; &quot;$(PYTHONDIR)/Lib/site-packages/mapnik/mapnik.dll&quot;"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(PYTHONDIR)/Lib/site-packages/mapnik/mapnik.dll&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\src\agg_renderer.cpp"
>
</File>
<File
RelativePath="..\..\src\arrow.cpp"
>
</File>
<File
RelativePath="..\..\src\datasource_cache.cpp"
>
</File>
<File
RelativePath="..\..\src\distance.cpp"
>
</File>
<File
RelativePath="..\..\src\envelope.cpp"
>
</File>
<File
RelativePath="..\..\src\filter_factory.cpp"
>
</File>
<File
RelativePath="..\..\src\font_engine_freetype.cpp"
>
</File>
<File
RelativePath="..\..\pdf\font_engine_pdf.cpp"
>
</File>
<File
RelativePath="..\..\src\graphics.cpp"
>
</File>
<File
RelativePath="..\..\src\image_reader.cpp"
>
</File>
<File
RelativePath="..\..\src\image_util.cpp"
>
</File>
<File
RelativePath="..\..\src\layer.cpp"
>
</File>
<File
RelativePath="..\..\src\line_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\load_map.cpp"
>
</File>
<File
RelativePath="..\..\src\map.cpp"
>
</File>
<File
RelativePath="..\..\src\memory.cpp"
>
</File>
<File
RelativePath="..\..\src\memory_datasource.cpp"
>
</File>
<File
RelativePath="..\..\src\params.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_line_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_point_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_polygon_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_renderer.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_renderer_layout.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_renderer_utility.cpp"
>
</File>
<File
RelativePath="..\..\pdf\pdf_shield_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\placement_finder.cpp"
>
</File>
<File
RelativePath="..\..\src\plugin.cpp"
>
</File>
<File
RelativePath="..\..\src\png_reader.cpp"
>
</File>
<File
RelativePath="..\..\src\point_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\polygon_pattern_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\proj_transform.cpp"
>
</File>
<File
RelativePath="..\..\src\projection.cpp"
>
</File>
<File
RelativePath="..\..\src\save_map.cpp"
>
</File>
<File
RelativePath="..\..\src\scale_denominator.cpp"
>
</File>
<File
RelativePath="..\..\src\shield_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\stroke.cpp"
>
</File>
<File
RelativePath="..\..\src\symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\text_symbolizer.cpp"
>
</File>
<File
RelativePath="..\..\src\tiff_reader.cpp"
>
</File>
<File
RelativePath="..\..\tinyxml\tinystr.cpp"
>
</File>
<File
RelativePath="..\..\tinyxml\tinyxml.cpp"
>
</File>
<File
RelativePath="..\..\tinyxml\tinyxmlerror.cpp"
>
</File>
<File
RelativePath="..\..\tinyxml\tinyxmlparser.cpp"
>
</File>
<File
RelativePath="..\..\src\unicode.cpp"
>
</File>
<File
RelativePath="..\..\src\wkb.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\include\mapnik\agg_renderer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\arrow.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\attribute.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\attribute_collector.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\attribute_descriptor.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\color.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\color_factory.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\comparison.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\config.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\config_error.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\coord.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\coord_array.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\css_color_parser.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\ctrans.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\datasource.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\datasource_cache.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\distance.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\ellipsoid.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\enumeration.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\envelope.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\expression.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\factory.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\feature.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\feature_factory.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\feature_layer_desc.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\feature_style_processor.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\feature_type_style.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\fill.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter_expression.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter_factory.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter_featureset.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter_parser.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter_parser_ast.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\filter_visitor.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\font_engine_freetype.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\font_engine_pdf.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\gamma.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\geom_util.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\geometry.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\global.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\graphics.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\hit_test_filter.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\image_data.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\image_reader.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\image_util.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\image_view.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\label_collision_detector.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\label_placement.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\layer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\libxml2_loader.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\line_pattern_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\line_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\load_map.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\local_datasource.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\logical.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\map.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\markers_converter.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\markers_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\math_expr.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\memory.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\memory_datasource.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\memory_featureset.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\params.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_line_pattern_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_point_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_polygon_pattern_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_renderer.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_renderer_layout.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_renderer_utility.hpp"
>
</File>
<File
RelativePath="..\..\include\pdf\pdf_shield_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\placement_finder.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\plugin.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\point_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\polygon_pattern_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\polygon_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\pool.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\proj_transform.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\projection.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\ptree_helpers.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\quad_tree.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\query.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\raster.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\raster_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\regex_filter.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\rule.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\save_map.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\scale_denominator.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\shield_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\spatial.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\stroke.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\style.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\style_factory.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\text_path.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\text_symbolizer.hpp"
>
</File>
<File
RelativePath="..\..\tinyxml\tinystr.h"
>
</File>
<File
RelativePath="..\..\tinyxml\tinyxml.h"
>
</File>
<File
RelativePath="..\..\include\mapnik\unicode.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\utils.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\value.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\vertex.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\vertex_transform.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\vertex_vector.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\wkb.hpp"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\debug\agg.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -0,0 +1,224 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="input_raster"
ProjectGUID="{7F0D48DE-482F-42A0-8D19-2C52DCEAFEDD}"
RootNamespace="input_raster"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MAPNIKDIR)\plugins\input\raster&quot;;&quot;$(MAPNIKDIR)\include&quot;;&quot;$(MAPNIKDIR)\thirdparty\icu\include\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;INPUT_RASTER_EXPORTS;MAPNIK_IMPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy &quot;$(TargetPath)&quot; &quot;$(TargetDir)\raster.input&quot;"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(TargetDir)\raster.input&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;INPUT_RASTER_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\plugins\input\raster\raster_datasource.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\raster\raster_featureset.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\raster\raster_info.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\plugins\input\raster\raster_datasource.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\raster\raster_featureset.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\raster\raster_info.hpp"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\Debug\mapnik.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -0,0 +1,262 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="input_shapefile"
ProjectGUID="{9AF4294B-E941-4FF5-BC3F-A47C47C577F7}"
RootNamespace="input_shapefile"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MAPNIKDIR)\plugins\input\shape&quot;;&quot;$(MAPNIKDIR)\include&quot;;&quot;$(MAPNIKDIR)\thirdparty\icu\include\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;INPUT_SHAPEFILE_EXPORTS;MAPNIK_IMPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuuc.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="$(ICUDIR)/lib/"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy &quot;$(TargetPath)&quot; &quot;$(TargetDir)/shape.input&quot;"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(TargetDir)/shape.input&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;INPUT_SHAPEFILE_EXPORTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\plugins\input\shape\dbffile.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_featureset.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_index_featureset.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_io.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shapefile.cpp"
>
</File>
<File
RelativePath="..\..\src\unicode.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\plugins\input\shape\dbffile.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_featureset.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_index_featureset.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_io.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shapefile.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shp_index.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\unicode.hpp"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\Debug\mapnik.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

75
msvc/msvc.sln Normal file
View file

@ -0,0 +1,75 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg", "agg\agg.vcproj", "{3BFF8124-56D1-4722-81B9-8B1810D1825C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapnik", "core\core.vcproj", "{AFB929AA-7EE5-44CC-AC30-F08D120233F2}"
ProjectSection(ProjectDependencies) = postProject
{3BFF8124-56D1-4722-81B9-8B1810D1825C} = {3BFF8124-56D1-4722-81B9-8B1810D1825C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapeindex", "shapeindex\shapeindex.vcproj", "{FCF9FDD7-0B23-4FDA-A965-5275D1682362}"
ProjectSection(ProjectDependencies) = postProject
{AFB929AA-7EE5-44CC-AC30-F08D120233F2} = {AFB929AA-7EE5-44CC-AC30-F08D120233F2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "input_shapefile", "input_shapefile\input_shapefile.vcproj", "{9AF4294B-E941-4FF5-BC3F-A47C47C577F7}"
ProjectSection(ProjectDependencies) = postProject
{AFB929AA-7EE5-44CC-AC30-F08D120233F2} = {AFB929AA-7EE5-44CC-AC30-F08D120233F2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "input_raster", "input_raster\input_raster.vcproj", "{7F0D48DE-482F-42A0-8D19-2C52DCEAFEDD}"
ProjectSection(ProjectDependencies) = postProject
{AFB929AA-7EE5-44CC-AC30-F08D120233F2} = {AFB929AA-7EE5-44CC-AC30-F08D120233F2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "binding_python", "binding_python\binding_python.vcproj", "{D4904853-B226-4142-B5AD-871BEE3C497B}"
ProjectSection(ProjectDependencies) = postProject
{AFB929AA-7EE5-44CC-AC30-F08D120233F2} = {AFB929AA-7EE5-44CC-AC30-F08D120233F2}
{3BFF8124-56D1-4722-81B9-8B1810D1825C} = {3BFF8124-56D1-4722-81B9-8B1810D1825C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pdf", "pdf\pdf.vcproj", "{9853DAB2-975F-454B-9B62-00C2718C5F70}"
ProjectSection(ProjectDependencies) = postProject
{AFB929AA-7EE5-44CC-AC30-F08D120233F2} = {AFB929AA-7EE5-44CC-AC30-F08D120233F2}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3BFF8124-56D1-4722-81B9-8B1810D1825C}.Debug|Win32.ActiveCfg = Debug|Win32
{3BFF8124-56D1-4722-81B9-8B1810D1825C}.Debug|Win32.Build.0 = Debug|Win32
{3BFF8124-56D1-4722-81B9-8B1810D1825C}.Release|Win32.ActiveCfg = Release|Win32
{3BFF8124-56D1-4722-81B9-8B1810D1825C}.Release|Win32.Build.0 = Release|Win32
{AFB929AA-7EE5-44CC-AC30-F08D120233F2}.Debug|Win32.ActiveCfg = Debug|Win32
{AFB929AA-7EE5-44CC-AC30-F08D120233F2}.Debug|Win32.Build.0 = Debug|Win32
{AFB929AA-7EE5-44CC-AC30-F08D120233F2}.Release|Win32.ActiveCfg = Release|Win32
{AFB929AA-7EE5-44CC-AC30-F08D120233F2}.Release|Win32.Build.0 = Release|Win32
{FCF9FDD7-0B23-4FDA-A965-5275D1682362}.Debug|Win32.ActiveCfg = Debug|Win32
{FCF9FDD7-0B23-4FDA-A965-5275D1682362}.Debug|Win32.Build.0 = Debug|Win32
{FCF9FDD7-0B23-4FDA-A965-5275D1682362}.Release|Win32.ActiveCfg = Release|Win32
{FCF9FDD7-0B23-4FDA-A965-5275D1682362}.Release|Win32.Build.0 = Release|Win32
{9AF4294B-E941-4FF5-BC3F-A47C47C577F7}.Debug|Win32.ActiveCfg = Debug|Win32
{9AF4294B-E941-4FF5-BC3F-A47C47C577F7}.Debug|Win32.Build.0 = Debug|Win32
{9AF4294B-E941-4FF5-BC3F-A47C47C577F7}.Release|Win32.ActiveCfg = Release|Win32
{9AF4294B-E941-4FF5-BC3F-A47C47C577F7}.Release|Win32.Build.0 = Release|Win32
{7F0D48DE-482F-42A0-8D19-2C52DCEAFEDD}.Debug|Win32.ActiveCfg = Debug|Win32
{7F0D48DE-482F-42A0-8D19-2C52DCEAFEDD}.Debug|Win32.Build.0 = Debug|Win32
{7F0D48DE-482F-42A0-8D19-2C52DCEAFEDD}.Release|Win32.ActiveCfg = Release|Win32
{7F0D48DE-482F-42A0-8D19-2C52DCEAFEDD}.Release|Win32.Build.0 = Release|Win32
{D4904853-B226-4142-B5AD-871BEE3C497B}.Debug|Win32.ActiveCfg = Debug|Win32
{D4904853-B226-4142-B5AD-871BEE3C497B}.Debug|Win32.Build.0 = Debug|Win32
{D4904853-B226-4142-B5AD-871BEE3C497B}.Release|Win32.ActiveCfg = Release|Win32
{D4904853-B226-4142-B5AD-871BEE3C497B}.Release|Win32.Build.0 = Release|Win32
{9853DAB2-975F-454B-9B62-00C2718C5F70}.Debug|Win32.ActiveCfg = Debug|Win32
{9853DAB2-975F-454B-9B62-00C2718C5F70}.Debug|Win32.Build.0 = Debug|Win32
{9853DAB2-975F-454B-9B62-00C2718C5F70}.Release|Win32.ActiveCfg = Release|Win32
{9853DAB2-975F-454B-9B62-00C2718C5F70}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

200
msvc/pdf/pdf.vcproj Normal file
View file

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="pdf"
ProjectGUID="{9853DAB2-975F-454B-9B62-00C2718C5F70}"
RootNamespace="pdf"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MAPNIKDIR)/include/&quot;;&quot;$(WXPDFDIR)/include/&quot;;&quot;$(WXDIR)/include/&quot;;&quot;$(WXDIR)/include/msvc/&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ENABLE_PDF"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="mapnik.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;$(MAPNIKDIR)/msvc/Debug&quot;;&quot;$(ICUDIR)/lib/&quot;;&quot;$(WXPDFDIR)/lib/&quot;;&quot;$(WXDIR)/lib/vc_lib&quot;"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\demo\pdf\main.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

281
msvc/readme.txt Normal file
View file

@ -0,0 +1,281 @@
--------------------------------------------------------------------------------
General:
Built using visual studio c++ 2005 express edition
- with the platform SDK
--------------------------------------------------------------------------------
Boost
http://www.boost.org/users/download/
1) download and extract to "c:/program files/boost/" or equivalent
it will make a directory like "c:/program files/boost/boost_1_35_0/"
2) read /index.htm and follow the getting started instructions on compiling the
libraries for your environment
--------------------------------------------------------------------------------
wxWidgets
http://www.wxwidgets.org/downloads/#latest_stable
1) download and extract the wxAll source archive to /thirdparty/wxWidgets/
(e.g. there will now be a directory /thirdparty/wxWidgets/wxWidgets-x.x.x/ )
2) open the workspace "wxWidgets/wxWidgets-x.x.x/build/msw/wx.dsw"
- let visual studio perform conversion if required
3) Select the 'Unicode Debug' configuration and build the complete solution
4) if you want, build the complete solution with the 'Unicode Release' configuration
5) create an environment variable WXDIR with value "path/to/mapnik/thirdparty/wxWidgets/wxWidgets-x.x.x/"
--------------------------------------------------------------------------------
wxPdfDoc
http://wxcode.sourceforge.net/components/wxpdfdoc/
1) download wxPdfDocument 0.8.0
2) create a directory /thirdparty/wxWidgets/wxCode/components
3) extract wxPdfDocument into /thirdparty/wxWidgets/wxCode/components
4) open the workspace "wxpdfdoc/build/wxpdfdoc.dsw"
- let visual studio perform conversion if required
5) choose the 'Unicode Debug Monolithic' configuration
6) right click the 'wxpdfdoc' project, Properties and go to C/C++ / General properties
change WXWIN to WXDIR in the 'Additional include directories' line. It should look like:
$(WXDIR)\lib\vc_lib\mswud,$(WXDIR)\include,..\include
7) apply the patch wxpdfdoc_patch_20080112.patch or copy the files manually
8) add the files pdfoc.h and pdfoc.cpp to the project
9) build wxpdfdoc
10) repeat step 6 for the 'makefont' project
It should look like: "$(WXDIR)\lib\vc_lib\mswud";"$(WXDIR)\include";..\include;..\..\include
- and also change WXWIN to WXDIR in the resources / General properties 'Additional include directories'
- and also change WXWIN to WXDIR in the linker / general properties 'additional library directories'
11) In the Linker/input properties, change wxmsw26ud.lib to wxbase28ud.lib and add wxbase28ud_xml.lib
12) build makefont
13) if you want, repeat for the 'Unicode Release Monolithic' configuration
14) create and environment variable WXPDFDIR with value "path/to/mapnik/thirdparty/wxWidgets/wxCode/components/wxpdfdoc"
If this doesnt work, compare the command lines and work out whats different
Example command line for wxpdfdoc project compiler:
/Od /I "D:\OTM\mapnik\trunk\thirdparty\wxWidgets\wxWidgets-2.8.7\lib\vc_lib\mswud" /I "D:\OTM\mapnik\trunk\thirdparty\wxWidgets\wxWidgets-2.8.7\include" /I "..\include" /D "WIN32" /D "_LIB" /D "_DEBUG" /D "__WXDEBUG__" /D "__WXMSW__" /D "_VC80_UPGRADE=0x0600" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fp".\msvc6prjud_lib\wxpdfdoc/wxpdfdoc_wxpdfdoc.pch" /Fo".\msvc6prjud_lib\wxpdfdoc/" /Fd"..\lib\wxpdfdocud.pdb" /W4 /nologo /c /Zi /TP /errorReport:prompt
Example command line for makefont project compiler:
/Od /I "D:\OTM\mapnik\trunk\thirdparty\wxWidgets\wxWidgets-2.8.7\lib\vc_lib\mswud" /I "D:\OTM\mapnik\trunk\thirdparty\wxWidgets\wxWidgets-2.8.7\include" /I "..\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "__WXDEBUG__" /D "__WXMSW__" /D "_CONSOLE" /D "_VC80_UPGRADE=0x0600" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fp".\msvc6prjud_lib\makefont/wxpdfdoc_makefont.pch" /Fo".\msvc6prjud_lib\makefont/" /Fd"..\makefont\makefont.pdb" /W4 /nologo /c /Zi /TP /errorReport:prompt
Example command line for makefont project linker:
/OUT:"..\makefont\makefont.exe" /INCREMENTAL /NOLOGO /LIBPATH:"D:\OTM\mapnik\trunk\thirdparty\wxWidgets\wxWidgets-2.8.7\lib\vc_lib" /LIBPATH:"..\lib" /MANIFEST /MANIFESTFILE:".\msvc6prjud_lib\makefont\makefont.exe.intermediate.manifest" /DEBUG /PDB:".\..\makefont/makefont.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT ..\lib\wxpdfdocud.lib wxbase28ud.lib wxbase28ud_xml.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib oleacc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
--------------------------------------------------------------------------------
ICU
http://icu-project.org/download/
1) download and extract to /thirdparty/icu-x.x.x
2) open the solution /icu-x.x.x/source/allinone/allinone.sln
3) Select the 'Debug' configuration and build the complete solution
4) if you want, build the complete solution with the 'Release' configuration
5) create an environment variable ICUDIR with value "path/to/mapnik/thirdparty/icu-x.x.x/"
--------------------------------------------------------------------------------
freetype
http://freetype.sourceforge.net/download.html#stable
(e.g. http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz)
1) download and extract to /thirdparty/freetype-x.x.x
2) open the solution /freetype-x.x.x/builds/win32/visualc/freetype.sln
3) Select the 'Debug' configuration
4) build the solution
5) if you want, build the solution with the 'Release multithreaded' configuration
6) create an environment variable FREETYPEDIR with value "path/to/mapnik/thirdparty/freetype-x.x.x/"
--------------------------------------------------------------------------------
zlib
http://www.zlib.net/
(http://www.zlib.net/zlib-1.2.3.tar.gz)
1) download and extract to /thirdparty/zlib-x.x.x
2) open the workspace in "/zlib-x.x.x/projects/visualc6/zlib.dsw"
- let visual studio perform conversion if required
3) select the 'lib debug' configuration and build the zlib project
4) if you want, try the asm optimised versions and release builds
5) create an environment variable ZLIBDIR with value "path/to/mapnik/thirdparty/zlib-x.x.x/"
--------------------------------------------------------------------------------
libpng
http://www.libpng.org/pub/png/libpng.html
(ftp://ftp.simplesystems.org/pub/libpng/png/src/lpng1225.zip)
1) download and extract to /thirdparty/lpngxxxx
2) open the solution /lpng1225/projects/visualc71/libpng.sln
- let visual studio perform conversion if required
3) add zlib to the 'additional include directories' of libpng
e.g. it should look like: ..\..;"..\..\..\zlib-1.2.3"
4) remove the project dependancy on zlib (right click project, project dependancies ...)
5) select the 'lib debug' configuration and build the libpng project
6) if you want, try the asm optimised versions and release builds
2) create an environment variable LIBPNGDIR with value "path/to/mapnik/thirdparty/lpngxxxx/"
--------------------------------------------------------------------------------
libjpeg
http://www.ijg.org/
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
1) download and extract to /thirdparty/jpeg-6b/
2) copy jconfig.vc to jconfig.h
3) open a visual studio command prompt and change to the /thirdparty/jpeg-x directory
4) nmake /f makefile.vc all
--------------------------------------------------------------------------------
libtiff
http://www.libtiff.org/
(ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz)
1) download and extract to /thirdparty/libtiff-x.x.x
2) open the nmake.opt file and uncomment the JPEG_SUPPORT and ZIP_SUPPORT sections (also update ZLIBDIR and JPEGDIR)
2) open a visual studio command prompt and change to the /thirdparty/libtiff-x.x.x directory
3) nmake /f makefile.vc
4) change to tools directory
5) nmake /f makefile.vc
--------------------------------------------------------------------------------
libtool (ltdl)
http://gnuwin32.sourceforge.net/packages/libtool.htm
(http://gnuwin32.sourceforge.net/downlinks/libtool-bin-zip.php)
1) download and extract the binaries package to /thirdparty/libtool-x.x.x
2) create an environment variable LIBTOOLDIR with value "path/to/mapnik/thirdparty/libtool-x.x.x/"
--------------------------------------------------------------------------------
proj.4
http://www.remotesensing.org/proj/
(ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz)
(ftp://ftp.remotesensing.org/proj/proj-datumgrid-1.3.zip)
1) download and extract to /thirdparty/proj-x.x.x
2) if you have more datum definition files, extract them to the /proj-x.x.x/nad directory
3) edit /proj-x.x.x/src/makefile.vc
- change PROJ_LIB_DIR to point to the proper place e.g: PROJ_LIB_DIR=D:\OTM\mapnik\trunk\thirdparty\proj-4.6.0\nad
4) open a visual studio command prompt and change the the /proj-x.x.x/src/ directory
5) nmake /f makefile.vc all
6) create an environment variable PROJ4DIR with value "path/to/mapnik/thirdparty/proj-x.x.x/"
--------------------------------------------------------------------------------
python bindings
1) create an environment variable PYTHONDIR with the value "path/to/python" e.g. "c:\program files\python25"
2) copy "/mapnik/trunk/bindings/python/mapnik" directory to "/python/Lib/site-packages/mapnik"
3) create a file called paths.py in "/python/Lib/site-packages/mapnik/"
- add the lines:
mapniklibpath = 'path/to/mapnik/msvc/Debug'
inputpluginspath = 'path/to/mapnik/msvc/Debug'
fontscollectionpath = 'path/to/mapnik/fonts/dejavu-ttf-2.14'
e.g.
mapniklibpath = 'D:/otm/mapnik/trunk/msvc/Debug'
inputpluginspath = 'D:/otm/mapnik/trunk/msvc/Debug'
fontscollectionpath = 'D:/otm/mapnik/trunk/fonts/dejavu-ttf-2.14'
4) open __init__.py
- comment out lines 21-29 and 99, where it is using the get/set dlopenflags things
5) copy libltdl3.dll from "mapnik/thirdparth/libtool-x.x.x/bin" to "/python/Lib/site-packages/mapnik/"
6) copy boost_python-vc80-mt-gd-x_xx_x.dll from "boost/stage/lib" to "/python/Lib/site-packages/mapnik/"
7) when you build mapnik and the python-bindings they will copy other files to "/python/Lib/site-packages/mapnik/"
-- after you've build mapnik and the python-bindings (later)
8) start python
>>> import mapnik
>>> dir(mapnik)
and you shouldn't get any errors
--------------------------------------------------------------------------------
mapnik
1) create an environment variable MAPNIKDIR with value "path/to/mapnik" e.g. "D:\OTM\mapnik\trunk\"
2) In visual studio, do Tools menu, Options, projects and solutions, vc++ directories
- choose include files
- add:
$(LIBTIFFDIR)\libtiff\
$(ZLIBDIR)
$(PROJ4DIR)\src
$(LIBJPEGDIR)
$(LIBPNGDIR)
$(LIBTOOLDIR)\include
$(FREETYPEDIR)\include
$(ICUDIR)\include\
--------------------------------------------------------------------------------
building
1) just hit build all and it should all work.
2) to test things, try the pdf project.
- You'll need to update the four defines at the top of main.cpp in the pdf project.
Point them to the proper locations on your machine.
--------------------------------------------------------------------------------
alternative libpng
http://gnuwin32.sourceforge.net/packages/libpng.htm
(http://gnuwin32.sourceforge.net/downlinks/libpng-lib-zip.php)
1) download and extract the 'developer files' package to /thirdparty/libpng-x.x.x
2) create an environment variable LIBPNGDIR with value "path/to/mapnik/thirdparty/libpng-x.x.x/"
--------------------------------------------------------------------------------
alternative libtiff
http://gnuwin32.sourceforge.net/packages/tiff.htm
(http://gnuwin32.sourceforge.net/downlinks/tiff-lib-zip.php)
1) download and extract the 'developer files' package to /thirdparty/libtiff-x.x.x-x
2) create an environment variable LIBTIFFDIR with value "path/to/mapnik/thirdparty/libtiff-x.x.x-x/"
--------------------------------------------------------------------------------
alternative libjpeg
http://gnuwin32.sourceforge.net/packages/libjpeg.htm
(http://gnuwin32.sourceforge.net/downlinks/jpeg-lib-zip.php)
1) download and extract the 'developer files' package to /thirdparty/libjpeg-6b
2) create an environment variable LIBJPEGDIR with value "path/to/mapnik/thirdparty/libjpeg-6b/"

View file

@ -0,0 +1,276 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="shapeindex"
ProjectGUID="{FCF9FDD7-0B23-4FDA-A965-5275D1682362}"
RootNamespace="shapeindex"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(MAPNIKDIR)\plugins\input\shape&quot;;&quot;$(MAPNIKDIR)\utils\shapeindex&quot;;&quot;$(MAPNIKDIR)\include\&quot;;&quot;$(MAPNIKDIR)\thirdparty\icu\include\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuuc.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="$(ICUDIR)/lib/"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\plugins\input\shape\dbffile.cpp"
>
</File>
<File
RelativePath="..\..\src\envelope.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_featureset.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_index_featureset.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_io.cpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shapefile.cpp"
>
</File>
<File
RelativePath="..\..\utils\shapeindex\shapeindex.cpp"
>
</File>
<File
RelativePath="..\..\src\unicode.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\plugins\input\shape\dbffile.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\envelope.hpp"
>
</File>
<File
RelativePath="..\..\utils\shapeindex\quadtree.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_featureset.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_index_featureset.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shape_io.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shapefile.hpp"
>
</File>
<File
RelativePath="..\..\plugins\input\shape\shp_index.hpp"
>
</File>
<File
RelativePath="..\..\include\mapnik\unicode.hpp"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\Debug\mapnik.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

200
pdf/font_engine_pdf.cpp Normal file
View file

@ -0,0 +1,200 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#if ENABLE_PDF
// pdf
#include <pdf/font_engine_pdf.hpp>
namespace mapnik {
pdf_text_renderer::pdf_text_renderer(wxPdfDocument &_pdf)
: fill(0,0,0),
halo_fill(255,255,255),
halo_radius(0),
default_font_name(_T("arial"))
{
pdf = &_pdf;
font_description = NULL;
//set the other defaults
set_size(10);
set_font(default_font_name);
}
void pdf_text_renderer::set_external_font_options(const std::wstring& externalFontPath, const bool enableSubsetting) {
pdf->SetFontPath(externalFontPath);
pdf->SetFontSubsetting(enableSubsetting);
}
bool pdf_text_renderer::add_external_font(const std::wstring& fontName, const std::wstring& fontXMLFile) {
return pdf->AddFont(fontName, _T(""), fontXMLFile);
}
bool pdf_text_renderer::set_font(const std::string& font) {
std::wstring wFont;
//convert to wide name
std::string::const_iterator itr;
for(itr = font.begin();itr!=font.end();itr++) {
wFont.push_back(*itr);
}
return set_font(wFont);
}
bool pdf_text_renderer::set_font(const std::wstring& font) {
//try to set font
if(pdf->SetFont(font, _T(""), pdf->GetFontSize()))
{
font_name = font;
font_description = &pdf->GetFontDescription();
return true;
}
//if we get here, give up and use the default which always exists (internal pdf font)
std::wclog << __FILE__ << ":" << __LINE__ << ": failed to set font: " << font << ". Using default: " << default_font_name << "\n";
pdf->SetFont(default_font_name, _T(""), pdf->GetFontSize());
font_description = &pdf->GetFontDescription();
return false;
}
void pdf_text_renderer::set_size(const double size) {
font_size = size;
pdf->SetFontSize(font_size * pdf->GetScaleFactor());
}
void pdf_text_renderer::set_fill(mapnik::Color const& _fill)
{
fill = _fill;
}
void pdf_text_renderer::set_halo_fill(mapnik::Color const& _halo)
{
halo_fill = _halo;
}
void pdf_text_renderer::set_halo_radius( const double radius )
{
halo_radius = radius;
}
pdf_text_renderer::char_dimension_t pdf_text_renderer::character_dimensions(const unsigned c)
{
std::wstring str;
str.push_back(c);
char_dimension_t dim;
dim.first = pdf->GetStringWidth(str); //gets it in pdf units, not points. no conversion needed.
dim.second = (font_description->GetCapHeight() - font_description->GetDescent()) * font_size / 1000.0; // The cap-height and descent are scaled by 1000, and are relative to a font size of 1.
return dim;
}
void pdf_text_renderer::get_string_info(string_info *info)
{
double width = 0;
double height = 0;
const UnicodeString &text = info->get_string();
for(int i=0;i<text.length();i++)
{
unsigned int c = text[i];
char_dimension_t char_dim = character_dimensions(c);
info->add_info(c, char_dim.first, char_dim.second);
width += char_dim.first;
height = char_dim.second > height ? char_dim.second : height;
}
info->set_dimensions(width, height);
}
void pdf_text_renderer::prepare_render(void)
{
pdf->SetTextColor(fill.red(), fill.green(), fill.blue());
wxPdfLineStyle lineStyle;
lineStyle.SetWidth(halo_radius);
lineStyle.SetColour(wxPdfColour(halo_fill.red(), halo_fill.green(), halo_fill.blue()));
lineStyle.SetLineJoin(wxPDF_LINEJOIN_ROUND);
lineStyle.SetLineCap(wxPDF_LINECAP_ROUND);
pdf->SetLineStyle(lineStyle);
}
void pdf_text_renderer::render(text_path *path, double x0, double y0)
{
int c;
double x, y, angle;
std::wstring character;
//render the halos if they're used
if(halo_radius > 0) {
for (int i = 0; i < path->num_nodes(); i++)
{
path->vertex(&c, &x, &y, &angle);
character.clear();
character.push_back(c);
//note that angle has to be converted from radians to degrees, and y direction is opposite to what you expect
pdf->RotatedText(x0 + x, y0 - y, character, (180.0/M_PI)*angle, 1); //stroke, no fill
}
}
//rewind the iterator
path->itr_ = 0;
//render the text
for (int i = 0; i < path->num_nodes(); i++)
{
path->vertex(&c, &x, &y, &angle);
character.clear();
character.push_back(c);
//note that angle has to be converted from radians to degrees, and y direction is opposite to what you expect
pdf->RotatedText(x0 + x, y0 - y, character, (180.0/M_PI)*angle, 0); //fill, no stroke
}
}
}
#endif //ENABLE_PDF

View file

@ -0,0 +1,73 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#if ENABLE_PDF
// pdf
#include <pdf/pdf_line_pattern_symbolizer.hpp>
// mapnik
#include <mapnik/line_pattern_symbolizer.hpp>
#include <mapnik/image_reader.hpp>
// stl
#include <iostream>
namespace mapnik
{
pdf_line_pattern_symbolizer::pdf_line_pattern_symbolizer(std::string const& file, std::string const& type, const double line_width, const unsigned image_width, const unsigned image_height, const double _output_width, const double _output_height)
: line_pattern_symbolizer(file, type, image_width, image_height),
line_stroke(Color(), line_width)
{
output_width = _output_width;
output_height = _output_height;
}
pdf_line_pattern_symbolizer::pdf_line_pattern_symbolizer(pdf_line_pattern_symbolizer const& rhs)
: line_pattern_symbolizer(rhs)
{
output_width = rhs.output_width;
output_height = rhs.output_height;
line_stroke = rhs.line_stroke;
}
pdf_line_pattern_symbolizer::pdf_line_pattern_symbolizer(line_pattern_symbolizer const& rhs, const double line_width, const double _output_width, const double _output_height)
: line_pattern_symbolizer(rhs),
line_stroke(Color(), line_width)
{
output_width = _output_width;
output_height = _output_height;
}
void pdf_line_pattern_symbolizer::set_output_size(const double width, const double height)
{
output_width = width;
output_height = height;
}
} //namespace mapnik
#endif //ENABLE_PDF

View file

@ -0,0 +1,80 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#if ENABLE_PDF
// pdf
#include <pdf/pdf_point_symbolizer.hpp>
// mapnik
#include <mapnik/image_data.hpp>
#include <mapnik/image_reader.hpp>
// boost
#include <boost/scoped_ptr.hpp>
// stl
#include <iostream>
namespace mapnik
{
pdf_point_symbolizer::pdf_point_symbolizer()
: point_symbolizer()
{
output_width = 1;
output_height = 1;
}
pdf_point_symbolizer::pdf_point_symbolizer( std::string const& file,
std::string const& type,
unsigned image_width, unsigned image_height,
double _output_width, double _output_height)
: point_symbolizer(file, type, image_width, image_height)
{
output_width = _output_width;
output_height = _output_height;
}
pdf_point_symbolizer::pdf_point_symbolizer(pdf_point_symbolizer const& rhs)
: point_symbolizer(rhs)
{
output_width = rhs.get_output_width();
output_height = rhs.get_output_height();
}
pdf_point_symbolizer::pdf_point_symbolizer(point_symbolizer const& rhs, const double _output_width, const double _output_height)
: point_symbolizer(rhs)
{
output_width = _output_width;
output_height = _output_height;
}
void pdf_point_symbolizer::set_output_size(const double width, const double height)
{
output_width = width;
output_height = height;
}
}
#endif //ENABLE_PDF

View file

@ -0,0 +1,69 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#if ENABLE_PDF
// pdf
#include <pdf/pdf_polygon_pattern_symbolizer.hpp>
// mapnik
#include <mapnik/polygon_pattern_symbolizer.hpp>
#include <mapnik/image_reader.hpp>
// stl
#include <iostream>
namespace mapnik
{
pdf_polygon_pattern_symbolizer::pdf_polygon_pattern_symbolizer(std::string const& file, std::string const& type, unsigned image_width, unsigned image_height, double _output_width, double _output_height)
: polygon_pattern_symbolizer(file, type, image_width, image_height)
{
output_width = _output_width;
output_height = _output_height;
}
pdf_polygon_pattern_symbolizer::pdf_polygon_pattern_symbolizer(pdf_polygon_pattern_symbolizer const& rhs)
: polygon_pattern_symbolizer(rhs)
{
output_width = rhs.output_width;
output_height = rhs.output_height;
}
pdf_polygon_pattern_symbolizer::pdf_polygon_pattern_symbolizer(polygon_pattern_symbolizer const& rhs, const double _output_width, const double _output_height)
: polygon_pattern_symbolizer(rhs)
{
output_width = _output_width;
output_height = _output_height;
}
void pdf_polygon_pattern_symbolizer::set_output_size(const double width, const double height)
{
output_width = width;
output_height = height;
}
} //namespace mapnik
#endif //ENABLE_PDF

1719
pdf/pdf_renderer.cpp Normal file

File diff suppressed because it is too large Load diff

111
pdf/pdf_renderer_layout.cpp Normal file
View file

@ -0,0 +1,111 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
//! \file pdf_renderer_layout.cpp
//! \brief Implementation of pdf_renderer_layout.hpp
//!
#if ENABLE_PDF
// mapnik
#include <mapnik/map.hpp>
// pdf
#include <pdf/pdf_renderer.hpp>
#include <pdf/pdf_renderer_layout.hpp>
#include <pdf/font_engine_pdf.hpp>
namespace mapnik
{
//---------------------------------------------------------------------------
pdf_renderer_layout::pdf_renderer_layout(const std::string &units, const double width, const double height, const bool portrait)
: page_area(Envelope<double>(0,0, width, height)),
page_units(units)
{
page_background_colour = Color(255, 255, 255);
page_portrait = portrait;
map_area = page_area;
map_area_border = false;
map_area_border_width = 0.5;
font_name = "Arial";
border_scales = true;
map_grid = false;
map_grid_approx_spacing = 35;
border_scale_width = 4.5;
border_scale_linewidth = 0.1;
map_grid_colour = Color(0,0,0,64);
map_grid_linewidth = 0.25;
scale_bar = true;
scale_bar_area = Envelope<double>(20,20,100,27.5);
scale_bar_factor = 0.001;
scale_bar_unit = "Kilometers";
}
//---------------------------------------------------------------------------
pdf_renderer_layout::~pdf_renderer_layout()
{
//remove all data in overlay images vector
OIDitr itr;
for(itr = overlay_images.begin(); itr != overlay_images.end(); itr++) {
delete *itr;
*itr = NULL;
}
}
//---------------------------------------------------------------------------
void pdf_renderer_layout::set_map_area(const double x, const double y, const double width, const double height)
{
map_area = Envelope<double>(x, y, x+width, y+height);
if(!page_area.contains(map_area))
{
map_area = page_area;
std::clog << "WARNING: specified map area is not within the page area. Setting map area to page area.";
}
}
void pdf_renderer_layout::add_overlay_image(const std::string &image, const double x, const double y, const double width, const double height, const double angle)
{
overlay_image_data *data = new overlay_image_data;
data->file = image;
data->x = x;
data->y = y;
data->width = width;
data->height = height;
data->angle = angle;
overlay_images.push_back(data);
}
} //namespace mapnik
#endif // #if ENABLE_PDF

View file

@ -0,0 +1,64 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
//! \file pdf_renderer_utility.cpp
//! \brief Implementation of pdf_renderer_utility.hpp
//!
#if ENABLE_PDF
// mapnik
#include <mapnik/map.hpp>
#include <pdf/pdf_renderer_layout.hpp>
#include <pdf/pdf_renderer.hpp>
// WX
#include <wx/pdfdoc.h>
namespace mapnik {
MAPNIK_DECL void render_to_pdf(const mapnik::Map& map, const mapnik::pdf_renderer_layout &layout, const std::string& filename, const bool compress) {
using namespace mapnik;
//create the pdf
wxPdfDocument pdf(layout.get_page_width(), layout.get_page_height(), layout.get_page_portrait()?wxPORTRAIT:wxLANDSCAPE, pdf_renderer::convert_string_to_wstring(layout.get_page_units()));
//set pdf options
pdf.SetMargins(0,0,0);
pdf.SetCompression(compress);
//create the renderer
pdf_renderer pr(map, pdf, layout, 0, 0);
//render
pr.apply();
//save to file
pdf.SaveAsFile(pdf_renderer::convert_string_to_wstring(filename));
}
} //namespace mapnik
#endif //#if ENABLE_PDF

View file

@ -0,0 +1,76 @@
/*****************************************************************************
*
* This file is part of the wxPdfDoc modifications for mapnik
*
* Copyright (C) 2007 Ben Moores
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#if ENABLE_PDF
// pdf
#include <pdf/pdf_shield_symbolizer.hpp>
// mapnik
#include <mapnik/image_data.hpp>
#include <mapnik/image_reader.hpp>
// boost
#include <boost/scoped_ptr.hpp>
// stl
#include <iostream>
namespace mapnik
{
pdf_shield_symbolizer::pdf_shield_symbolizer(std::string const& name,
std::string const& face_name,
unsigned size,
Color const& fill,
std::string const& file,
std::string const& type,
unsigned image_width, unsigned image_height,
double _output_width, double _output_height)
: shield_symbolizer(name, face_name, size, fill, file, type, image_width, image_height)
{
output_width = _output_width;
output_height = _output_height;
}
pdf_shield_symbolizer::pdf_shield_symbolizer(pdf_shield_symbolizer const& rhs)
: shield_symbolizer(rhs)
{
output_width = rhs.get_output_width();
output_height = rhs.get_output_height();
}
pdf_shield_symbolizer::pdf_shield_symbolizer(shield_symbolizer const& rhs, const double _output_width, const double _output_height)
: shield_symbolizer(rhs)
{
output_width = _output_width;
output_height = _output_height;
}
void pdf_shield_symbolizer::set_output_size(const double width, const double height)
{
output_width = width;
output_height = height;
}
}
#endif //ENABLE_PDF

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,179 @@
///////////////////////////////////////////////////////////////////////////////
// Name: pdfoc.h
// Purpose:
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/// \file pdfoc.h PDF Optional Content Management Classes
#ifndef _PDFOC_H_
#define _PDFOC_H_
#include <wx/string.h>
#include "pdfdocdef.h"
/// OCG Intent options
#define wxPDF_OCG_INTENT_VIEW 0x0001
#define wxPDF_OCG_INTENT_DESIGN 0x0002
class wxPdfOcg; // Predefine for hashmap
/// Hashmap class for document links
WX_DECLARE_HASH_MAP(unsigned int, wxPdfOcg*, wxIntegerHash, wxIntegerEqual, wxPdfOcgHashMap);
/// Class representing the optional content in a document.
class WXDLLIMPEXP_PDFDOC wxPdfOc {
public:
/// Constructor
wxPdfOc();
/// Destructor
~wxPdfOc();
/// Add an optional content group
/**
* The OCG will be managed by this class after its added, so you dont need to destroy it yourself.
* <b>This means the OCG must have been created dynamically, not statically.</b>
* \param[in] ocg The OCG to add
*/
void AddOcg(wxPdfOcg *ocg);
/// Get the OCG map
/**
* \return The ocg hash map
*/
wxPdfOcgHashMap& GetOcgMap(void) { return m_ocgs; };
private:
unsigned int m_nextOcgId; ///< Next Id to use for an Ocg. Incremented after adding new Ocg;
wxPdfOcgHashMap m_ocgs; ///< Hash map of ocgs
};
/// Class representing an optional content group
class WXDLLIMPEXP_PDFDOC wxPdfOcg {
public:
/// Construct a new OCG
/**
* \param [in] name The label shown in the view application (does not need to be unique)
*/
wxPdfOcg(const wxString& name);
/// Destructor
~wxPdfOcg();
/// Set OCG Intent
/**
* \param[in] intent Combination of the defined wxPDF_OCG_INTENT_???? values to set
*/
void SetIntent(const unsigned int intent) { m_intent |= intent; };
/// Clear OCG Intent
/**
* \param[in] intent Combination of the defined wxPDF_OCG_INTENT_???? values to clear
*/
void ClearIntent(const unsigned int intent) { m_intent &= ~intent; };
/// Get OCG Index
/**
* \return The OCG index
*/
unsigned int GetOcgIndex(void) const { return m_index; };
/// Set OCG Index
/**
* \param[in] index The value to set index to
*/
void SetOcgIndex(const unsigned int index) { m_index = index; };
/// Get Object Index
/**
* \return The object index
*/
unsigned int GetObjectIndex(void) const { return m_objIndex; };
/// Set Object Index
/**
* \param[in] index The value to set index to
*/
void SetObjectIndex(const unsigned int index) { m_objIndex = index; };
/// Set the default visibility state
/**
* \param[in] state true = on, false = off
*/
void SetDefaultVisibilityState(const bool state) { m_defaultState = state; };
/// Get the default visibility state
/**
* \return The default visibility state, true = on, false = off
*/
bool GetDefaultVisibilityState(void) const { return m_defaultState; };
/// Get ocg name
/**
* \return OCG name
*/
const wxString& GetName(void) const {return m_name; };
/// Get stringised Intent
/**
* \return String representing intent
*/
wxString& GetIntentString(void);
private:
unsigned int m_objIndex; ///< Object index
unsigned int m_index; ///< OCG Index
wxString m_name; ///< OCG Name
unsigned int m_intent; ///< OCG Intent (combinations of wxPDF_OCG_INTENT_VIEW | wxPDF_OCG_INTENT_DESIGN)
wxString m_intentStr; ///< OCG Intent string
bool m_defaultState; ///!< true = default on, false = default off
};
/// Class representing an optional content membership dictionary
/*class WXDLLIMPEXP_PDFDOC wxPdfOcmd {
public:
typedef enum VisiblityPolicy {
AllOn = 0,
AnyOn,
AnyOff,
AllOff
} VisibilityPolicy;
public:
/// Construct a new OCMD
wxPdfOcmd();
/// Destructor
~wxPdfOcmd();
/// Set visibility policy
void SetVisibilityPolicy(const VisibilityPolicy policy);
/// Get visibility policy
const VisibilityPolicy GetVisibilityPolicy(void) const { return m_policy; };
/// Get visibility policy as PdfName
const wxPdfName& GetNameVisibilityPolicy(void) const { return m_strPolicy; };
private:
wxPdfArray m_ocg; ///< Array of OCGs whose states determine the visibility of content controlled by this OCMD
VisibilityPolicy m_policy; ///< Visiblity policy
wxPdfName m_strPolicy; ///< Stringised visibility policy
};
*/
#endif //_PDFOC_H_

View file

@ -0,0 +1,882 @@
///////////////////////////////////////////////////////////////////////////////
// Name: pdfproperties.h
// Purpose:
// Author: Ulrich Telle
// Modified by:
// Created: 2006-07-13
// Copyright: (c) Ulrich Telle
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/// \file pdfproperties.h Interface of the several wxPdfDocument property classes
#ifndef _PDFPROPERTIES_H_
#define _PDFPROPERTIES_H_
// wxWidgets headers
#include "wx/pdfdocdef.h"
/// Border options
#define wxPDF_BORDER_NONE 0x0000
#define wxPDF_BORDER_LEFT 0x0001
#define wxPDF_BORDER_RIGHT 0x0002
#define wxPDF_BORDER_TOP 0x0004
#define wxPDF_BORDER_BOTTOM 0x0008
#define wxPDF_BORDER_FRAME 0x000F
/// Corner options
#define wxPDF_CORNER_NONE 0x0000
#define wxPDF_CORNER_TOP_LEFT 0x0001
#define wxPDF_CORNER_TOP_RIGHT 0x0002
#define wxPDF_CORNER_BOTTOM_LEFT 0x0004
#define wxPDF_CORNER_BOTTOM_RIGHT 0x0008
#define wxPDF_CORNER_ALL 0x000F
/// Style options
#define wxPDF_STYLE_NOOP 0x0000
#define wxPDF_STYLE_DRAW 0x0001
#define wxPDF_STYLE_FILL 0x0002
#define wxPDF_STYLE_FILLDRAW 0x0003
#define wxPDF_STYLE_DRAWCLOSE 0x0004
#define wxPDF_STYLE_MASK 0x0007
/// Font decoration options
#define wxPDF_FONT_NORMAL 0x0000
#define wxPDF_FONT_UNDERLINE 0x0001
#define wxPDF_FONT_OVERLINE 0x0002
#define wxPDF_FONT_STRIKEOUT 0x0004
#define wxPDF_FONT_DECORATION 0x0007 // Mask all possible decorations
/// Permission options
#define wxPDF_PERMISSION_NONE 0x0000 ///< Allow nothing
#define wxPDF_PERMISSION_PRINT 0x0004 ///< Allow printing
#define wxPDF_PERMISSION_MODIFY 0x0008 ///< Allow modifying
#define wxPDF_PERMISSION_COPY 0x0010 ///< Allow text copying
#define wxPDF_PERMISSION_ANNOT 0x0020 ///< Allow annotations
#define wxPDF_PERMISSION_ALL 0x003C ///< Allow anything
/// Encryption methods
enum wxPdfEncryptionMethod
{
wxPDF_ENCRYPTION_RC4V1,
wxPDF_ENCRYPTION_RC4V2,
wxPDF_ENCRYPTION_AESV2
};
/// Color types
enum wxPdfColourType
{
wxPDF_COLOURTYPE_UNKNOWN,
wxPDF_COLOURTYPE_GRAY,
wxPDF_COLOURTYPE_RGB,
wxPDF_COLOURTYPE_CMYK,
wxPDF_COLOURTYPE_SPOT
};
/// Form field border styles
enum wxPdfBorderStyle
{
wxPDF_BORDER_SOLID,
wxPDF_BORDER_DASHED,
wxPDF_BORDER_BEVELED,
wxPDF_BORDER_INSET,
wxPDF_BORDER_UNDERLINE
};
/// Alignment options
enum wxPdfAlignment
{
wxPDF_ALIGN_LEFT,
wxPDF_ALIGN_CENTER,
wxPDF_ALIGN_RIGHT,
wxPDF_ALIGN_JUSTIFY,
wxPDF_ALIGN_TOP = wxPDF_ALIGN_LEFT,
wxPDF_ALIGN_MIDDLE = wxPDF_ALIGN_CENTER,
wxPDF_ALIGN_BOTTOM = wxPDF_ALIGN_RIGHT
};
/// Zoom options
enum wxPdfZoom
{
wxPDF_ZOOM_FULLPAGE,
wxPDF_ZOOM_FULLWIDTH,
wxPDF_ZOOM_REAL,
wxPDF_ZOOM_DEFAULT,
wxPDF_ZOOM_FACTOR
};
/// Layout options
enum wxPdfLayout
{
wxPDF_LAYOUT_CONTINUOUS,
wxPDF_LAYOUT_SINGLE,
wxPDF_LAYOUT_TWO,
wxPDF_LAYOUT_DEFAULT
};
/// Viewer preferences
#define wxPDF_VIEWER_HIDETOOLBAR 0x0001
#define wxPDF_VIEWER_HIDEMENUBAR 0x0002
#define wxPDF_VIEWER_HIDEWINDOWUI 0x0004
#define wxPDF_VIEWER_FITWINDOW 0x0008
#define wxPDF_VIEWER_CENTERWINDOW 0x0010
#define wxPDF_VIEWER_DISPLAYDOCTITLE 0x0020
/// Line Cap options
enum wxPdfLineCap
{
wxPDF_LINECAP_NONE = -1,
wxPDF_LINECAP_BUTT = 0,
wxPDF_LINECAP_ROUND = 1,
wxPDF_LINECAP_SQUARE = 2
};
/// Line join options
enum wxPdfLineJoin
{
wxPDF_LINEJOIN_NONE = -1,
wxPDF_LINEJOIN_MITER = 0,
wxPDF_LINEJOIN_ROUND = 1,
wxPDF_LINEJOIN_BEVEL = 2
};
/// Marker symbols
enum wxPdfMarker
{
wxPDF_MARKER_CIRCLE,
wxPDF_MARKER_SQUARE,
wxPDF_MARKER_TRIANGLE_UP,
wxPDF_MARKER_TRIANGLE_DOWN,
wxPDF_MARKER_TRIANGLE_LEFT,
wxPDF_MARKER_TRIANGLE_RIGHT,
wxPDF_MARKER_DIAMOND,
wxPDF_MARKER_PENTAGON_UP,
wxPDF_MARKER_PENTAGON_DOWN,
wxPDF_MARKER_PENTAGON_LEFT,
wxPDF_MARKER_PENTAGON_RIGHT,
wxPDF_MARKER_STAR,
wxPDF_MARKER_STAR4,
wxPDF_MARKER_PLUS,
wxPDF_MARKER_CROSS,
wxPDF_MARKER_SUN,
wxPDF_MARKER_BOWTIE_HORIZONTAL,
wxPDF_MARKER_BOWTIE_VERTICAL,
wxPDF_MARKER_ASTERISK,
wxPDF_MARKER_LAST // Marks the last available marker symbol; do not use!
};
/// Linear gradient types
enum wxPdfLinearGradientType
{
wxPDF_LINEAR_GRADIENT_HORIZONTAL,
wxPDF_LINEAR_GRADIENT_VERTICAL,
wxPDF_LINEAR_GRADIENT_MIDHORIZONTAL,
wxPDF_LINEAR_GRADIENT_MIDVERTICAL,
wxPDF_LINEAR_GRADIENT_REFLECTION_LEFT,
wxPDF_LINEAR_GRADIENT_REFLECTION_RIGHT,
wxPDF_LINEAR_GRADIENT_REFLECTION_TOP,
wxPDF_LINEAR_GRADIENT_REFLECTION_BOTTOM
};
enum wxPdfBlendMode
{
wxPDF_BLENDMODE_NORMAL,
wxPDF_BLENDMODE_MULTIPLY,
wxPDF_BLENDMODE_SCREEN,
wxPDF_BLENDMODE_OVERLAY,
wxPDF_BLENDMODE_DARKEN,
wxPDF_BLENDMODE_LIGHTEN,
wxPDF_BLENDMODE_COLORDODGE,
wxPDF_BLENDMODE_COLORBURN,
wxPDF_BLENDMODE_HARDLIGHT,
wxPDF_BLENDMODE_SOFTLIGHT,
wxPDF_BLENDMODE_DIFFERENCE,
wxPDF_BLENDMODE_EXCLUSION,
wxPDF_BLENDMODE_HUE,
wxPDF_BLENDMODE_SATURATION,
wxPDF_BLENDMODE_COLOR,
wxPDF_BLENDMODE_LUMINOSITY
};
enum wxPdfShapedTextMode
{
wxPDF_SHAPEDTEXTMODE_ONETIME,
wxPDF_SHAPEDTEXTMODE_STRETCHTOFIT,
wxPDF_SHAPEDTEXTMODE_REPEAT
};
/// Class representing a PDF document information dictionary.
class WXDLLIMPEXP_PDFDOC wxPdfInfo
{
public:
wxPdfInfo() {}
virtual~wxPdfInfo() {}
void SetTitle(const wxString& title) { m_title = title; }
void SetAuthor(const wxString& author) { m_author = author; }
void SetSubject(const wxString& subject) { m_subject = subject; }
void SetKeywords(const wxString& keywords) { m_keywords = keywords; }
void SetCreator(const wxString& creator) { m_creator = creator; }
void SetProducer(const wxString& producer) { m_producer = producer; }
void SetCreationDate(const wxString& creationDate) { m_creationDate = creationDate; }
void SetModDate(const wxString& modDate) { m_modDate = modDate; }
const wxString GetTitle() const { return m_title; }
const wxString GetAuthor() const { return m_author; }
const wxString GetSubject() const { return m_subject; }
const wxString GetKeywords() const { return m_keywords; }
const wxString GetCreator() const { return m_creator; }
const wxString GetProducer() const { return m_producer; }
const wxString GetCreationDate() const { return m_creationDate; }
const wxString GetModDate() const { return m_modDate; }
private:
wxString m_title; ///< The documents title.
wxString m_author; ///< The name of the person who created the document.
wxString m_subject; ///< The subject of the document.
wxString m_keywords; ///< Keywords associated with the document.
wxString m_creator; ///< The name of the application that created the original document.
wxString m_producer; ///< The name of the application that produced the document.
wxString m_creationDate; ///< The date and time the document was created.
wxString m_modDate; ///< The date and time the document was modified.
};
/// Class representing internal or external links.
class WXDLLIMPEXP_PDFDOC wxPdfLink
{
public:
/// Constructor for internal link
/**
* Use this constructor to create an \b internal link reference.
* \see wxPdfDocument::Link(), wxPdfDocument::Write(), wxPdfDocument::Cell(), wxPdfDocument::ClippedCell(), wxPdfDocument::Image(), wxPdfDocument::RotatedImage()
*/
wxPdfLink(int linkRef);
/// Constructor for external link
/**
* Use this constructor to create an \b external link reference.
* \see wxPdfDocument::Link(), wxPdfDocument::Write(), wxPdfDocument::Cell(), wxPdfDocument::ClippedCell(), wxPdfDocument::Image(), wxPdfDocument::RotatedImage()
*/
wxPdfLink(const wxString& linkURL);
/// Copy constructor
wxPdfLink(const wxPdfLink& pdfLink);
/// Destructor
virtual ~wxPdfLink();
/// Check whether this instance is a valid link reference
bool IsValid() const { return m_isValid; }
/// Check whether this instance is an internal reference
bool IsLinkRef() const { return m_isRef; }
/// Get the internal link reference
int GetLinkRef() const { return m_linkRef; }
/// Get the external link reference
const wxString GetLinkURL() const { return m_linkURL; }
/// Set page number and position on page
void SetLink(int page, double ypos) { m_page = page; m_ypos = ypos; }
/// Get the page this link refers to
int GetPage() { return m_page; }
/// Get the page position this link refers to
double GetPosition() { return m_ypos; }
private:
bool m_isValid; ///< Flag whether this instance is valid
bool m_isRef; ///< Flag whether this is an internal link reference
int m_linkRef; ///< Internal link reference
wxString m_linkURL; ///< External link reference
int m_page; ///< Page number this link refers to
double m_ypos; ///< Position on page this link refers to
};
/// Class representing the sensitive area of links referring to a page. (For internal use only)
class WXDLLIMPEXP_PDFDOC wxPdfPageLink : public wxPdfLink
{
public:
/// Constructor
wxPdfPageLink(double x, double y, double w, double h, const wxPdfLink& pdfLink);
/// Destructor
virtual ~wxPdfPageLink();
/// Get the X offset
double GetX() { return m_x; }
/// Get the Y offset
double GetY() { return m_y; }
/// Get the width
double GetWidth() { return m_w; }
/// Get the height
double GetHeight() { return m_h; }
private:
double m_x; ///< X offset of sensitive area
double m_y; ///< Y offset of sensitive area
double m_w; ///< Width of sensitive area
double m_h; ///< Height of sensitive area
};
/// Class representing text annotations.
class WXDLLIMPEXP_PDFDOC wxPdfAnnotation
{
public:
/// Constructor for text annotation
/**
* Use this constructor to create a text annotation.
* \param x X offset of the annotation
* \param y Y offset of the annotation
* \param text annotation text
*/
wxPdfAnnotation(double x, double y, const wxString& text);
/// Copy constructor
wxPdfAnnotation(const wxPdfAnnotation& annotation);
/// Destructor
virtual ~wxPdfAnnotation() {}
/// Get the X offset of the annotation
double GetX() const { return m_x; }
/// Get the Y offset of the annotation
double GetY() const { return m_y; }
/// Get the text of the annotation
wxString GetText() const { return m_text; }
private:
double m_x; ///< X offset of the annotation
double m_y; ///< Y offset of the annotation
wxString m_text; ///< Annotation text
};
/// Class representing bookmarks for defining the document's outline. (For internal use only)
class WXDLLIMPEXP_PDFDOC wxPdfBookmark
{
public:
/// Constructor
wxPdfBookmark(const wxString& txt, int level, double y, int page);
/// Destructor
virtual ~wxPdfBookmark();
/// Get the bookmark text
wxString GetText() { return m_text; }
/// Get the associated level
int GetLevel() { return m_level; }
/// Get the Y offset of the bookmark
double GetY() { return m_y; }
/// Get the page number of the bookmark
int GetPage() { return m_page; }
/// Set the parent of the bookmark
void SetParent(int parent) { m_parent = parent; }
/// Get the parent of the bookmark
int GetParent() { return m_parent; }
/// Set previous bookmark
void SetPrev(int prev) { m_prev = prev; }
/// Get previous bookmark
int GetPrev() { return m_prev; }
/// Set next bookmark
void SetNext(int next) { m_next = next; }
/// Get next bookmark
int GetNext() { return m_next; }
/// Set first bookmark
void SetFirst(int first) { m_first = first; }
/// Get first bookmark
int GetFirst() { return m_first; }
/// Set last bookmark
void SetLast(int last) { m_last = last; }
/// Get last bookmark
int GetLast() { return m_last; }
private:
wxString m_text; ///< Text of bookmark
int m_level; ///< Associated level
double m_y; ///< Y offset
int m_page; ///< Page number
int m_parent; ///< Parent bookmark
int m_prev; ///< Previous bookmark
int m_next; ///< Next bookmark
int m_first; ///< First bookmark
int m_last; ///< Last bookmark
};
/// Class representing spot colors.
class WXDLLIMPEXP_PDFDOC wxPdfSpotColour
{
public:
/// Constructor for spot color
wxPdfSpotColour(int index, double cyan, double magenta, double yellow, double black);
/// Copy constructor
wxPdfSpotColour(const wxPdfSpotColour& color);
/// Set object index
void SetObjIndex(int index) { m_objIndex = index; }
/// Get object index
int GetObjIndex() const { return m_objIndex; }
/// Get spot color index
int GetIndex() const { return m_index; }
/// Get cyan level
double GetCyan() const { return m_cyan; }
/// Get magenta level
double GetMagenta() const { return m_magenta; }
/// Get yellow level
double GetYellow() const { return m_yellow; }
/// Get black level
double GetBlack() const { return m_black; }
private:
int m_objIndex; ///< object index
int m_index; ///< color index
double m_cyan; ///< cyan level
double m_magenta; ///< magenta level
double m_yellow; ///< yellow level
double m_black; ///< black level
};
/// Class representing patterns.
// Implementation in pdfcolor.cpp
class WXDLLIMPEXP_PDFDOC wxPdfPattern
{
public:
/// Constructor for pattern
/**
* \param index The pattern index
* \param width The image width
* \param height The image height
*/
wxPdfPattern(const int index, const double width, const double height);
/// Copy constructor
wxPdfPattern(const wxPdfPattern& pattern);
/// Set object index
void SetObjIndex(int index) { m_objIndex = index; };
/// Get object index
int GetObjIndex() const { return m_objIndex; };
/// Get pattern index
int GetIndex() const { return m_index; };
/// Set image
void SetImage(wxPdfImage *image) { m_image = image; };
/// Get image
wxPdfImage *GetImage() const {return m_image; };
/// Get image width
int GetImageWidth() const {return m_imageWidth; };
/// Get image height
int GetImageHeight() const {return m_imageHeight; };
private:
int m_objIndex; ///< object index
int m_index; ///< pattern index
wxPdfImage *m_image; ///< image
double m_imageWidth; ///< image width
double m_imageHeight;///< image height
};
/// Class representing wxPdfDocument colors.
class WXDLLIMPEXP_PDFDOC wxPdfColour
{
public:
/// Default constructor
/**
* Constructs a color object with an undefined color
*/
wxPdfColour();
/// Constructor for grayscale color
/**
* Defines a grayscale color
* \param grayscale indicates the gray level. Value between 0 and 255
*/
wxPdfColour(const unsigned char grayscale);
/// Constructor for wxColour color
/**
* Defines a wxColour color.
* \param color defines a wxColour color composed of a red, green and blue component
*/
wxPdfColour(const wxColour& color);
/// Constructor for RGB color
/**
* Defines a RGB color.
* \param red indicates the red level. Value between 0 and 255
* \param green indicates the green level. Value between 0 and 255
* \param blue indicates the blue level. Value between 0 and 255
*/
wxPdfColour(const unsigned char red, const unsigned char green, const unsigned char blue);
/// Constructor for CMYK color
/**
* Defines a CMYK color.
* \param cyan indicates the cyan level. Value between 0 and 100
* \param magenta indicates the magenta level. Value between 0 and 100
* \param yellow indicates the yellow level. Value between 0 and 100
* \param black indicates the black level. Value between 0 and 100
*/
wxPdfColour(double cyan, double magenta, double yellow, double black);
/// Constructor for named RGB color
/**
* Defines a named RGB color.
* \param name is the name of the requested color. Use of HTML notation <b><tt>\#rrggbb</tt></b> as color name is also supported.
*/
wxPdfColour(const wxString& name);
/// Constructor for named RGB color
/**
* Defines a spot color.
* \param spotColor is the spot color to be used
* \param tint indicates the tint level. Value between 0 and 100. Default: 100.
*/
wxPdfColour(const wxPdfSpotColour& spotColor, double tint);
/// Copy constructor
wxPdfColour(const wxPdfColour& color);
/// Assignment operator
wxPdfColour& operator=(const wxPdfColour& color);
/// Set grayscale color
/**
* \param grayscale indicates the gray level. Value between 0 and 255. Default: 0 (Black).
*/
void SetColor(const unsigned char grayscale = 0);
/// Set wxColour color
/**
* \param color defines a wxColour color composed of a red, green and blue component
*/
void SetColor(const wxColour& color);
/// Set RGB color
/**
* \param red indicates the red level. Value between 0 and 255
* \param green indicates the green level. Value between 0 and 255
* \param blue indicates the blue level. Value between 0 and 255
*/
void SetColor(const unsigned char red, const unsigned char green, const unsigned char blue);
/// Set CMYK color
/**
* \param cyan indicates the cyan level. Value between 0 and 100
* \param magenta indicates the magenta level. Value between 0 and 100
* \param yellow indicates the yellow level. Value between 0 and 100
* \param black indicates the black level. Value between 0 and 100
*/
void SetColor(double cyan, double magenta, double yellow, double black);
/// Set a named RGB color
/**
* \param name is the name of the requested color
*/
void SetColor(const wxString& name);
/// Set a spot color (internal use only)
/**
* \param spotColor is the spot color to be used
* \param tint indicates the tint level. Value between 0 and 100. Default: 100.
*/
void SetColor(const wxPdfSpotColour& spotColor, double tint);
/// Get internal color string representation (for internal use only)
/**
* \param drawing flag specifying whether the color is used for drawing operations
*/
const wxString GetColor(bool drawing) const;
/// Get color type
/**
*/
wxPdfColourType GetColorType() const { return m_type; }
/// Get internal color value string representation (for internal use only)
/**
*/
const wxString GetColorValue() const;
/// Compare color
bool Equals(const wxPdfColour& color) const;
protected:
/// Constructor for internal color string representation
wxPdfColour(const wxString& color, bool WXUNUSED(internal));
/// Get a color database
static wxColourDatabase* GetColorDatabase();
private:
wxPdfColourType m_type; ///< color type
wxString m_prefix; ///< internal color string prefix
wxString m_color; ///< internal color string
static wxColourDatabase* ms_colorDatabase;
};
bool operator==(const wxPdfColour& a, const wxPdfColour& b);
bool operator!=(const wxPdfColour& a, const wxPdfColour& b);
/// Class representing double arrays (no standard class in wxWidgets unfortunately)
WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(double, wxPdfArrayDouble, class WXDLLIMPEXP_PDFDOC);
/// Class representing line styles.
class WXDLLIMPEXP_PDFDOC wxPdfLineStyle
{
public:
/// Constructor
/**
* Creates a line style for use in graphics primitives.
* \param[in] width Width of the line in user units.
* \param[in] cap Type of cap to put on the line (butt, round, square).
* The difference between 'square' and 'butt' is that 'square'
* projects a flat end past the end of the line.
* \param[in] join form of line joining: miter, round or bevel
* \param[in] dash pattern for dashed lines.Is an empty array (without dash) or
* array with series of length values, which are the lengths of the on and off dashes.
* For example: (2) represents 2 on, 2 off, 2 on , 2 off ...
* (2,1) is 2 on, 1 off, 2 on, 1 off.. etc
* \param[in] phase Modifier of the dash pattern which is used to shift the point at which the pattern starts
* \param[in] color line color.
* \see SetLineStyle(), Curve(), Line(), Circle(), Ellipse(), Rect(), RoundedRect(), Polygon(), RegularPolygon(), StarPolygon()
*/
wxPdfLineStyle(double width = -1,
wxPdfLineCap cap = wxPDF_LINECAP_NONE, wxPdfLineJoin join = wxPDF_LINEJOIN_NONE,
const wxPdfArrayDouble& dash = wxPdfArrayDouble(), double phase = -1,
const wxPdfColour& color = wxPdfColour());
/// Copy constructor
wxPdfLineStyle(const wxPdfLineStyle& lineStyle);
/// Assignment operator
wxPdfLineStyle& operator= (const wxPdfLineStyle& lineStyle);
/// Destructor
virtual ~wxPdfLineStyle();
/// Check whether the style is initialized.
bool IsSet() const { return m_isSet; }
/// Set the line width
void SetWidth(double width) { m_width = width; }
/// Get the line width
double GetWidth() const { return m_width; }
/// Set the line ending style
void SetLineCap(const wxPdfLineCap cap) { m_cap = cap; }
/// Get the line ending style
wxPdfLineCap GetLineCap() const { return m_cap; }
/// Set the line join style
void SetLineJoin(const wxPdfLineJoin join) { m_join = join; }
/// Get the line join style
wxPdfLineJoin GetLineJoin() const { return m_join; }
/// Set the dash pattern
void SetDash(const wxPdfArrayDouble& dash) { m_dash = dash; }
/// Get the dash pattern
const wxPdfArrayDouble& GetDash() const { return m_dash; }
/// Set the dash pattern phase
void SetPhase(double phase) { m_phase = phase; }
/// Get the dash pattern phase
double GetPhase() const { return m_phase; }
/// Set the line color
void SetColour(const wxPdfColour& color) { m_color = color; };
/// Get the line color
const wxPdfColour& GetColour() const { return m_color; };
/// Set the miter limit (0 for none)
void SetMiterLimit(const double miterLimit) { m_miterLimit = miterLimit; };
/// Get the miter limit
double GetMiterLimit() const { return m_miterLimit; };
private:
bool m_isSet; ///< Flag whether the style is initialized
double m_width; ///< Line width
wxPdfLineCap m_cap; ///< Line ending style
wxPdfLineJoin m_join; ///< Line joining style
wxPdfArrayDouble m_dash; ///< Dash pattern
double m_phase; ///< Dash pattern phase
wxPdfColour m_color; ///< Line color
double m_miterLimit; ///< Miter limit (0 for none)
};
/// Class representing a coons patch mesh.
class WXDLLIMPEXP_PDFDOC wxPdfCoonsPatchMesh
{
public:
/// Constructor
wxPdfCoonsPatchMesh();
/// Destructor
virtual ~wxPdfCoonsPatchMesh();
/// Add patch to mesh
/**
* \param edgeFlag flag indicating the patch position relative to previous patches
* \li 0 - new patch, unrelated to previous patches (the first patch added must have this flag)
* \li 1 - above previous patch
* \li 2 - right to previous patch
* \li 3 - below previous patch
* \param colors array of colors of this patch (size: 4 if edge flag is 1, 2 otherwise)
* \param x array of x coordinates of patch mesh points (size: 12 if edge flag is 1, 8 otherwise)
* \param y array of y coordinates of patch mesh points (size: 12 if edge flag is 1, 8 otherwise)
* \returns true if the added patch is valid
*/
bool AddPatch(int edgeFlag, wxPdfColour colors[], double x[], double y[]);
/// Checks whether the coons patch mesh is valid
bool Ok() const { return m_ok; }
/// Get color type of the coons patch mesh
/**
* \returns the color type of the coons patch mesh (gray scale, RGB or CMYK)
*/
wxPdfColourType GetColorType() const { return m_colorType; }
/// Get the number of patches
/**
* \returns the number of patches of the coons patch mesh
*/
size_t GetPatchCount() const { return m_patches.size(); }
/// Get the array of patches
/**
*
* \returns array of patches
*/
const wxArrayPtrVoid* GetPatches() const { return &m_patches; }
private:
bool m_ok; ///< flag whether the coons patch mesh is valid
wxPdfColourType m_colorType; ///< color type of the mesh
wxArrayPtrVoid m_patches; ///< array of patches
};
/// Shape segment types
enum wxPdfSegmentType
{
wxPDF_SEG_UNDEFINED,
wxPDF_SEG_MOVETO,
wxPDF_SEG_LINETO,
wxPDF_SEG_CURVETO,
wxPDF_SEG_CLOSE
};
/// Class representing a shape consisting of line and curve segments
class WXDLLIMPEXP_PDFDOC wxPdfShape
{
public:
/// Constructor
wxPdfShape();
/// Destructor
virtual ~wxPdfShape();
/// Begin a new subpath of the shape
/**
* Move to the starting point of a new (sub)path.
* The new current point is (x, y).
* \param x abscissa value
* \param y ordinate value
* \remark This must be the first operation in constructing the shape.
*/
void MoveTo(double x, double y);
/// Add line segment to the shape
/**
* Append a straight line segment from the current point to the point (x, y).
* The new current point is (x, y).
* \param x abscissa value
* \param y ordinate value
*/
void LineTo(double x, double y);
/// Add a cubic Bezier curve to the shape
/**
* Append a cubic Bezier curve to the current path. The curve extends
* from the current point to the point (x3, y3), using (x1, y1) and (x2, y2)
* as the Bezier control points. The new current point is (x3, y3).
* \param x1: Abscissa of control point 1
* \param y1: Ordinate of control point 1
* \param x2: Abscissa of control point 2
* \param y2: Ordinate of control point 2
* \param x3: Abscissa of end point
* \param y3: Ordinate of end point
*/
void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3);
/// Close (sub)path of the shape
void ClosePath();
/// Get the number of segments of the shape
size_t GetSegmentCount() const { return m_types.GetCount(); }
/// Get a specific segment of the shape (for internal use only)
/**
* \param[in] iterType index of segment in segment type array
* \param[in] iterPoints index of segment in segment coordinate array
* \param[out] coords array of segment coordinates (size: >= 8)
* \returns the type of the segment
*/
wxPdfSegmentType GetSegment(int iterType, int iterPoints, double coords[]) const;
private:
wxArrayInt m_types; ///< array of segment types
wxPdfArrayDouble m_x; ///< array of abscissa values
wxPdfArrayDouble m_y; ///< array of ordinate values
int m_subpath; ///< subpath index
int m_segment; ///< segment index
int m_index; ///< points index
};
#endif

View file

@ -0,0 +1,574 @@
///////////////////////////////////////////////////////////////////////////////
// Name: pdfcolor.cpp
// Purpose: Implementation of wxPdfDocument color handling
// Author: Ulrich Telle
// Modified by:
// Created: 2006-01-27
// Copyright: (c) Ulrich Telle
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/// \file pdfcolor.cpp Implementation of the wxPdfDocument color handling
// For compilers that support precompilation, includes <wx/wx.h>.
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "wx/pdfdoc.h"
#include "pdfcolordata.inc"
wxColourDatabase* wxPdfColour::ms_colorDatabase = NULL;
wxColourDatabase*
wxPdfColour::GetColorDatabase()
{
if (ms_colorDatabase == NULL)
{
if (wxTheColourDatabase != NULL)
{
ms_colorDatabase = wxTheColourDatabase;
}
else
{
static wxColourDatabase pdfColorDatabase;
ms_colorDatabase = &pdfColorDatabase;
}
size_t n;
for ( n = 0; n < WXSIZEOF(wxColourTable); n++ )
{
const wxColourDesc& cc = wxColourTable[n];
ms_colorDatabase->AddColour(cc.name, wxColour(cc.r, cc.g, cc.b));
}
}
return ms_colorDatabase;
}
wxPdfColour::wxPdfColour()
{
m_type = wxPDF_COLOURTYPE_UNKNOWN;
m_prefix = wxEmptyString;
m_color = _T("0");
}
wxPdfColour::wxPdfColour(const unsigned char grayscale)
{
SetColor(grayscale);
}
wxPdfColour::wxPdfColour(const wxColour& color)
{
SetColor(color);
}
wxPdfColour::wxPdfColour(const unsigned char red, const unsigned char green, const unsigned char blue)
{
SetColor(red, green, blue);
}
wxPdfColour::wxPdfColour(double cyan, double magenta, double yellow, double black)
{
SetColor(cyan, magenta, yellow, black);
}
wxPdfColour::wxPdfColour(const wxPdfSpotColour& spot, double tint)
{
SetColor(spot, tint);
}
wxPdfColour::wxPdfColour(const wxString& name)
{
SetColor(name);
}
wxPdfColour::wxPdfColour(const wxPdfColour& color)
{
m_type = color.m_type;
m_prefix = color.m_prefix;
m_color = color.m_color;
}
wxPdfColour::wxPdfColour(const wxString& color, bool WXUNUSED(internal))
{
m_color = color;
}
wxPdfColour&
wxPdfColour::operator=(const wxPdfColour& color)
{
m_type = color.m_type;
m_prefix = color.m_prefix;
m_color = color.m_color;
return *this;
}
bool
wxPdfColour::Equals(const wxPdfColour& color) const
{
return (m_type == color.m_type) && (m_prefix == color.m_prefix) && (m_color == color.m_color);
}
void
wxPdfColour::SetColor(const unsigned char grayscale)
{
m_type = wxPDF_COLOURTYPE_GRAY;
m_prefix = wxEmptyString;
m_color = wxPdfDocument::Double2String(((double) grayscale)/255.,3);
}
void
wxPdfColour::SetColor(const wxColour& color)
{
m_type = wxPDF_COLOURTYPE_RGB;
m_prefix = wxEmptyString;
m_color = wxPdfDocument::RGB2String(color);
}
void
wxPdfColour::SetColor(const unsigned char red, const unsigned char green, const unsigned char blue)
{
SetColor(wxColour(red,green,blue));
}
void
wxPdfColour::SetColor(double cyan, double magenta, double yellow, double black)
{
m_type = wxPDF_COLOURTYPE_CMYK;
m_prefix = wxEmptyString;
m_color = wxPdfDocument::Double2String(wxPdfDocument::ForceRange(cyan, 0., 100.)/100.,3) + _T(" ") +
wxPdfDocument::Double2String(wxPdfDocument::ForceRange(magenta, 0., 100.)/100.,3) + _T(" ") +
wxPdfDocument::Double2String(wxPdfDocument::ForceRange(yellow, 0., 100.)/100.,3) + _T(" ") +
wxPdfDocument::Double2String(wxPdfDocument::ForceRange(black, 0., 100.)/100.,3);
}
void
wxPdfColour::SetColor(const wxString& name)
{
if (name.Length() == 7 && name[0] == wxT('#'))
{
unsigned long r = 0, g = 0, b = 0;
if (name.Mid(1,2).ToULong(&r,16) &&
name.Mid(3,2).ToULong(&g,16) &&
name.Mid(5,2).ToULong(&b,16))
{
SetColor((unsigned char) r, (unsigned char) g, (unsigned char) b);
}
else
{
SetColor(0);
}
}
else
{
wxColourDatabase* colorDatabase = GetColorDatabase();
wxColour color = colorDatabase->Find(name);
if (color.Ok())
{
SetColor(color);
}
else
{
SetColor(0);
}
}
}
void
wxPdfColour::SetColor(const wxPdfSpotColour& spot, double tint)
{
m_type = wxPDF_COLOURTYPE_SPOT;
m_prefix = wxString::Format(_T("/CS%d CS "), spot.GetIndex());
m_color = wxPdfDocument::Double2String(wxPdfDocument::ForceRange(tint, 0., 100.)/100.,3);
}
const wxString
wxPdfColour::GetColor(bool drawing) const
{
wxString color = wxEmptyString;
switch (m_type)
{
case wxPDF_COLOURTYPE_GRAY:
color = m_color + wxString(_T(" g"));
break;
case wxPDF_COLOURTYPE_RGB:
color = m_color + wxString(_T(" rg"));
break;
case wxPDF_COLOURTYPE_CMYK:
color = m_color + wxString(_T(" k"));
break;
case wxPDF_COLOURTYPE_SPOT:
color = m_prefix + m_color + wxString(_T(" scn"));
break;
default:
color = wxString(_T("0 g"));
break;
}
if (drawing)
color.MakeUpper();
else
color.MakeLower();
color.Replace(_T("/cs"), _T("/CS"));
return color;
}
const wxString
wxPdfColour::GetColorValue() const
{
return m_color;
}
wxPdfSpotColour::wxPdfSpotColour(int index, double cyan, double magenta, double yellow, double black)
: m_objIndex(0), m_index(index), m_cyan(cyan), m_magenta(magenta), m_yellow(yellow), m_black(black)
{
}
wxPdfSpotColour::wxPdfSpotColour(const wxPdfSpotColour& color)
{
m_objIndex = color.m_objIndex;
m_index = color.m_index;
m_cyan = color.m_cyan;
m_magenta = color.m_magenta;
m_yellow = color.m_yellow;
m_black = color.m_black;
}
wxPdfPattern::wxPdfPattern(const int index, const double width, const double height)
: m_objIndex(0), m_index(index), m_imageWidth(width), m_imageHeight(height)
{
}
wxPdfPattern::wxPdfPattern(const wxPdfPattern& pattern)
{
m_objIndex = pattern.m_objIndex;
m_index = pattern.m_index;
m_imageWidth = pattern.m_imageWidth;
m_imageHeight = pattern.m_imageHeight;
m_image = pattern.m_image;
}
// ---
void
wxPdfDocument::AddPattern(const wxString& name, const wxImage& image, const wxString& imageName, const double width, const double height)
{
wxPdfPatternMap::iterator pattern = (*m_patterns).find(name);
wxPdfPattern *newPattern;
if (pattern == (*m_patterns).end())
{
int i = (*m_patterns).size() + 1;
newPattern = new wxPdfPattern(i, width, height);
(*m_patterns)[name] = newPattern;
//store the image
wxImage tempImage = image.Copy();
wxPdfImage* currentImage = NULL;
wxPdfImageHashMap::iterator imageIter = (*m_images).find(imageName);
int maskImage;
if (imageIter == (*m_images).end())
{
if (tempImage.HasAlpha())
{
maskImage = ImageMask(imageName+wxString(_T(".mask")), tempImage);
tempImage.ConvertAlphaToMask(0);
}
// First use of image, get info
tempImage.SetMask(false);
int i = (*m_images).size() + 1;
currentImage = new wxPdfImage(this, i, imageName, tempImage);
currentImage->Parse();
currentImage->SetMaskImage(maskImage);
(*m_images)[imageName] = currentImage;
}
imageIter = (*m_images).find(imageName);
newPattern->SetImage( (*imageIter).second );
}
}
void
wxPdfDocument::AddSpotColor(const wxString& name, double cyan, double magenta, double yellow, double black)
{
wxPdfSpotColourMap::iterator spotColor = (*m_spotColors).find(name);
if (spotColor == (*m_spotColors).end())
{
int i = (*m_spotColors).size() + 1;
(*m_spotColors)[name] = new wxPdfSpotColour(i, cyan, magenta, yellow, black);
}
}
void
wxPdfDocument::SetDrawColorSpace(const int space)
{
switch(space) {
case 1:
OutAscii(_T("/Pattern CS"));
break;
case 0:
default:
OutAscii(_T("/DeviceRGB CS"));
break;
}
}
void
wxPdfDocument::SetFillColorSpace(const int space)
{
switch(space) {
case 1:
OutAscii(_T("/Pattern cs"));
break;
case 0:
default:
OutAscii(_T("/DeviceRGB cs"));
break;
}
}
void
wxPdfDocument::SetDrawColor(const wxColour& color)
{
wxPdfColour tempColor(color);
m_drawColor = tempColor;
if (m_page > 0)
{
OutAscii(m_drawColor.GetColor(true));
}
}
void
wxPdfDocument::SetDrawColor(const unsigned char grayscale)
{
wxPdfColour tempColor(grayscale);
m_drawColor = tempColor;
if (m_page > 0)
{
OutAscii(m_drawColor.GetColor(true));
}
}
void
wxPdfDocument::SetDrawColor(const unsigned char red, const unsigned char green, const unsigned char blue)
{
SetDrawColor(wxColour(red, green, blue));
}
void
wxPdfDocument::SetDrawColor(double cyan, double magenta, double yellow, double black)
{
SetDrawColor(wxPdfColour(cyan, magenta, yellow, black));
}
void
wxPdfDocument::SetDrawColor(const wxPdfColour& color)
{
m_drawColor = color;
if (m_page > 0)
{
OutAscii(m_drawColor.GetColor(true));
}
}
void
wxPdfDocument::SetDrawColor(const wxString& name, double tint)
{
wxPdfSpotColourMap::iterator spotColor = (*m_spotColors).find(name);
if (spotColor != (*m_spotColors).end())
{
wxPdfColour tempColor(*(spotColor->second), tint);
m_drawColor = tempColor;
if (m_page > 0)
{
OutAscii(m_drawColor.GetColor(true));
}
}
else
{
wxLogError(_("SetDrawColor: Undefined spot color: ") + name);
}
}
void
wxPdfDocument::SetDrawPattern(const wxString& name) {
wxPdfPatternMap::iterator patternIter = (*m_patterns).find(name);
wxPdfPattern *pattern;
if( patternIter != (*m_patterns).end())
{
pattern = patternIter->second;
OutAscii(wxString::Format(_T("/P%d SCN"), pattern->GetIndex()));
}
else {
wxLogError(_("SetFillPattern: Undefined pattern: ") + name);
}
}
const wxPdfColour
wxPdfDocument::GetDrawColor()
{
return wxPdfColour(m_drawColor);
}
void
wxPdfDocument::SetFillColor(const wxColour& color)
{
wxPdfColour tempColor(color);
m_fillColor = tempColor;
m_colorFlag = (m_fillColor != m_textColor);
if (m_page > 0)
{
OutAscii(m_fillColor.GetColor(false));
}
}
void
wxPdfDocument::SetFillColor(const unsigned char grayscale)
{
wxPdfColour tempColor(grayscale);
m_fillColor = tempColor;
m_colorFlag = (m_fillColor != m_textColor);
if (m_page > 0)
{
OutAscii(m_fillColor.GetColor(false));
}
}
void
wxPdfDocument::SetFillColor(const wxPdfColour& color)
{
m_fillColor = color;
m_colorFlag = (m_fillColor != m_textColor);
if (m_page > 0)
{
OutAscii(m_fillColor.GetColor(false));
}
}
void
wxPdfDocument::SetFillColor(const unsigned char red, const unsigned char green, const unsigned char blue)
{
SetFillColor(wxColour(red, green, blue));
}
void
wxPdfDocument::SetFillColor(double cyan, double magenta, double yellow, double black)
{
SetFillColor(wxPdfColour(cyan, magenta, yellow, black));
}
void
wxPdfDocument::SetFillColor(const wxString& name, double tint)
{
wxPdfSpotColourMap::iterator spotColor = (*m_spotColors).find(name);
if (spotColor != (*m_spotColors).end())
{
wxPdfColour tempColor(*(spotColor->second), tint);
m_fillColor = tempColor;
m_colorFlag = (m_fillColor != m_textColor);
if (m_page > 0)
{
OutAscii(m_fillColor.GetColor(false));
}
}
else
{
wxLogError(_("SetFillColor: Undefined spot color: ") + name);
}
}
void
wxPdfDocument::SetFillPattern(const wxString& name) {
wxPdfPatternMap::iterator patternIter = (*m_patterns).find(name);
wxPdfPattern *pattern;
if( patternIter != (*m_patterns).end())
{
pattern = patternIter->second;
OutAscii(wxString::Format(_T("/P%d scn"), pattern->GetIndex()));
}
else {
wxLogError(_("SetFillPattern: Undefined pattern: ") + name);
}
}
const wxPdfColour
wxPdfDocument::GetFillColor()
{
return wxPdfColour(m_fillColor);
}
void
wxPdfDocument::SetTextColor(const wxColour& color)
{
wxPdfColour tempColor(color);
m_textColor = tempColor;
m_colorFlag = (m_fillColor != m_textColor);
}
void
wxPdfDocument::SetTextColor(const unsigned char grayscale)
{
wxPdfColour tempColor(grayscale);
m_textColor = tempColor;
m_colorFlag = (m_fillColor != m_textColor);
}
void
wxPdfDocument::SetTextColor(const wxPdfColour& color)
{
m_textColor = color;
m_colorFlag = (m_fillColor != m_textColor);
}
void
wxPdfDocument::SetTextColor(const unsigned char red, const unsigned char green, const unsigned char blue)
{
SetTextColor(wxColour(red, green, blue));
}
void
wxPdfDocument::SetTextColor(double cyan, double magenta, double yellow, double black)
{
SetTextColor(wxPdfColour(cyan, magenta, yellow, black));
}
void
wxPdfDocument::SetTextColor(const wxString& name, double tint)
{
wxPdfSpotColourMap::iterator spotColor = (*m_spotColors).find(name);
if (spotColor != (*m_spotColors).end())
{
wxPdfColour tempColor(*(spotColor->second), tint);
m_textColor = tempColor;
m_colorFlag = (m_fillColor != m_textColor);
}
else
{
wxLogError(_("SetTextColor: Undefined spot color: ") + name);
}
}
const wxPdfColour
wxPdfDocument::GetTextColor()
{
return wxPdfColour(m_textColor);
}
bool operator==(const wxPdfColour& a, const wxPdfColour& b)
{
return a.Equals(b);
}
bool operator!=(const wxPdfColour& a, const wxPdfColour& b)
{
return !a.Equals(b);
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,122 @@
///////////////////////////////////////////////////////////////////////////////
// Name: pdfoc.cpp
// Purpose: Implementation of pdfoc.h
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/// \file pdfoc.cpp Implementation of pdfoc.h
// For compilers that support precompilation, includes <wx/wx.h>.
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "wx/pdfoc.h"
// ----------------------------------------------------------------------------
// wxPdfOc: class representing the optional content in a document
// ----------------------------------------------------------------------------
wxPdfOc::wxPdfOc()
{
m_nextOcgId = 0;
}
wxPdfOc::~wxPdfOc()
{
//need to delete all the OCGs
wxPdfOcgHashMap::iterator ocg = m_ocgs.begin();
while(m_ocgs.size() != 0) {
ocg = m_ocgs.begin();
delete ocg->second;
m_ocgs.erase(ocg);
}
}
void wxPdfOc::AddOcg(wxPdfOcg *ocg)
{
//set its index
ocg->SetOcgIndex(m_nextOcgId);
m_nextOcgId++;
ocg->SetObjectIndex(0); //not set yet
//store
m_ocgs[ocg->GetOcgIndex()] = ocg;
}
// ----------------------------------------------------------------------------
// wxPdfOcg: class representing an optional content group
// ----------------------------------------------------------------------------
wxPdfOcg::wxPdfOcg(const wxString &name)
: m_name(name)
{
m_intent = wxPDF_OCG_INTENT_VIEW;
m_index = 0;
m_objIndex = 0;
m_defaultState = true;
}
wxPdfOcg::~wxPdfOcg()
{
}
wxString& wxPdfOcg::GetIntentString(void)
{
m_intentStr = _T("[ ");
if(m_intent & wxPDF_OCG_INTENT_VIEW) {
m_intentStr += _T("/View ");
}
if(m_intent & wxPDF_OCG_INTENT_DESIGN) {
m_intentStr += _T("/Design ");
}
m_intentStr += _T("]");
return m_intentStr;
}
// ----------------------------------------------------------------------------
// wxPdfOcmd: class representing an optional membership dictionary
// ----------------------------------------------------------------------------
/*wxPdfOcmd::wxPdfOcmd()
{
}
wxPdfOcmd::~wxPdfOcmd()
{
}
void wxPdfOcmd::SetVisibilityPolicy(const VisibilityPolicy policy)
{
m_policy = policy;
switch(policy) {
case AllOn:
m_strPolicy = wxPdfName(_T("AllOn"));
break;
case AnyOn:
m_strPolicy = wxPdfName(_T("AnyOn"));
break;
case AnyOff:
m_strPolicy = wxPdfName(_T("AnyOff"));
break;
case AllOff:
m_strPolicy = wxPdfName(_T("AllOff"));
break;
}
}
*/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff