Boost.Geometry    Boost C++ Libraries
Public Member Functions
boost::geometry::svg_mapper< Point, SameScale > Class Template Reference

Helper class to create SVG maps. More...

List of all members.

Public Member Functions

template<typename Geometry >
void add (Geometry const &geometry)
 Adds a geometry to the transformation matrix. After doing this, the specified geometry can be mapped fully into the SVG map.
template<typename Geometry >
void map (Geometry const &geometry, std::string const &style, int size=-1)
 Maps a geometry into the SVG map using the specified style.
 svg_mapper (std::ostream &stream, int width, int height, std::string const &width_height="width=\"100%\" height=\"100%\"")
 Constructor, initializing the SVG map. Opens and initializes the SVG. Should be called explicitly.
template<typename TextPoint >
void text (TextPoint const &point, std::string const &s, std::string const &style, int offset_x=0, int offset_y=0, int lineheight=10)
 Adds a text to the SVG map.
virtual ~svg_mapper ()
 Destructor, called automatically. Closes the SVG by streaming <\/svg>

Detailed Description

template<typename Point, bool SameScale = true>
class boost::geometry::svg_mapper< Point, SameScale >

Helper class to create SVG maps.

Template Parameters:
PointPoint type, for input geometries.
SameScaleBoolean flag indicating if horizontal and vertical scale should be the same. The default value is true
Examples:
07_a_graph_route_example.cpp, and 07_b_graph_route_example.cpp.

Constructor & Destructor Documentation

template<typename Point, bool SameScale = true>
boost::geometry::svg_mapper< Point, SameScale >::svg_mapper ( std::ostream &  stream,
int  width,
int  height,
std::string const &  width_height = "width=\"100%\" height=\"100%\"" 
) [explicit]

Constructor, initializing the SVG map. Opens and initializes the SVG. Should be called explicitly.

Parameters:
streamOutput stream, should be a stream already open
widthWidth of the SVG map (in SVG pixels)
heightHeight of the SVG map (in SVG pixels)
width_heightOptional information to increase width and/or height
template<typename Point, bool SameScale = true>
virtual boost::geometry::svg_mapper< Point, SameScale >::~svg_mapper ( ) [virtual]

Destructor, called automatically. Closes the SVG by streaming <\/svg>


Member Function Documentation

template<typename Point, bool SameScale = true>
template<typename Geometry >
void boost::geometry::svg_mapper< Point, SameScale >::add ( Geometry const &  geometry)

Adds a geometry to the transformation matrix. After doing this, the specified geometry can be mapped fully into the SVG map.

Template Parameters:
GeometryAny type fulfilling a Geometry Concept
Parameters:
geometryA model of the specified concept
template<typename Point, bool SameScale = true>
template<typename Geometry >
void boost::geometry::svg_mapper< Point, SameScale >::map ( Geometry const &  geometry,
std::string const &  style,
int  size = -1 
)

Maps a geometry into the SVG map using the specified style.

Template Parameters:
GeometryAny type fulfilling a Geometry Concept
Parameters:
geometryA model of the specified concept
styleString containing verbatim SVG style information
sizeOptional size (used for SVG points) in SVG pixels. For linestrings, specify linewidth in the SVG style information
template<typename Point, bool SameScale = true>
template<typename TextPoint >
void boost::geometry::svg_mapper< Point, SameScale >::text ( TextPoint const &  point,
std::string const &  s,
std::string const &  style,
int  offset_x = 0,
int  offset_y = 0,
int  lineheight = 10 
)

Adds a text to the SVG map.

Template Parameters:
TextPointAny type fulfilling a Point Concept
Parameters:
pointLocation of the text (in map units)
sThe text itself
styleString containing verbatim SVG style information, of the text
offset_xOffset in SVG pixels, defaults to 0
offset_yOffset in SVG pixels, defaults to 0
lineheightLine height in SVG pixels, in case the text contains

April 2, 2011

Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands
Copyright © 2008-2011 Bruno Lalande, Paris, France
Copyright © 2009-2010 Mateusz Loskot, London, UK
Documentation is generated by Doxygen