Boost.Geometry    Boost C++ Libraries
Public Member Functions | List of all members
boost::geometry::svg_mapper< Point, SameScale, SvgCoordinateType > Class Template Reference

Helper class to create SVG maps. More...

Inheritance diagram for boost::geometry::svg_mapper< Point, SameScale, SvgCoordinateType >:

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. More...
 
template<typename Geometry >
void map (Geometry const &geometry, std::string const &style, double size=-1.0)
 Maps a geometry into the SVG map using the specified style. More...
 
 svg_mapper (std::ostream &stream, SvgCoordinateType width, SvgCoordinateType height, std::string const &width_height="width=\"100%\" height=\"100%\"")
 Constructor, initializing the SVG map. Opens and initializes the SVG. Should be called explicitly. More...
 
template<typename TextPoint >
void text (TextPoint const &point, std::string const &s, std::string const &style, double offset_x=0.0, double offset_y=0.0, double lineheight=10.0)
 Adds a text to the SVG map. More...
 
virtual ~svg_mapper ()
 Destructor, called automatically. Closes the SVG by streaming <\/svg> More...
 

Detailed Description

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

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
SvgCoordinateTypeCoordinate type of SVG points. SVG is capable to use floating point coordinates. Therefore the default value is double
Examples:
07_a_graph_route_example.cpp, and 07_b_graph_route_example.cpp.

Constructor & Destructor Documentation

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

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, typename SvgCoordinateType = double>
virtual boost::geometry::svg_mapper< Point, SameScale, SvgCoordinateType >::~svg_mapper ( )
virtual

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

Member Function Documentation

template<typename Point, bool SameScale = true, typename SvgCoordinateType = double>
template<typename Geometry >
void boost::geometry::svg_mapper< Point, SameScale, SvgCoordinateType >::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, typename SvgCoordinateType = double>
template<typename Geometry >
void boost::geometry::svg_mapper< Point, SameScale, SvgCoordinateType >::map ( Geometry const &  geometry,
std::string const &  style,
double  size = -1.0 
)

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, typename SvgCoordinateType = double>
template<typename TextPoint >
void boost::geometry::svg_mapper< Point, SameScale, SvgCoordinateType >::text ( TextPoint const &  point,
std::string const &  s,
std::string const &  style,
double  offset_x = 0.0,
double  offset_y = 0.0,
double  lineheight = 10.0 
)

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