Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::geometry::svg_mapper< Point, SameScale > Class Template Reference

Helper class to create SVG maps. More...

#include <svg_mapper.hpp>

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

Public Member Functions

 svg_mapper (std::ostream &stream, int width, int height, std::string const &width_height="width=\"100%\" height=\"100%\"")
 Constructor, initializing the SVG map. More...
 
virtual ~svg_mapper ()
 Destructor, called automatically. More...
 
template<typename Geometry >
void add (Geometry const &geometry)
 Adds a geometry to the transformation matrix. More...
 
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. More...
 
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. More...
 

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

{[include reference/io/svg.qbk]}

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%\"" 
)
inlineexplicit

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

References boost::geometry::assign_inverse().

template<typename Point , bool SameScale = true>
virtual boost::geometry::svg_mapper< Point, SameScale >::~svg_mapper ( )
inlinevirtual

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)
inline

Adds a geometry to the transformation matrix.

After doing this, the specified geometry can be mapped fully into the SVG map

Template Parameters
Geometry
Parameters
geometry

References boost::geometry::expand(), boost::geometry::num_points(), and boost::geometry::return_envelope().

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 
)
inline

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

Template Parameters
Geometry
Parameters
geometry
styleString containing verbatim SVG style information
sizeOptional size (used for SVG points) in SVG pixels. For linestrings, specify linewidth in the SVG style information

References boost::size(), and boost::geometry::svg_map().

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 
)
inline

Adds a text to the SVG map.

Template Parameters
TextPoint
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

References boost::algorithm::is_any_of(), boost::it, boost::asio::s, boost::algorithm::split(), and boost::geometry::transform().


The documentation for this class was generated from the following file: