123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- [/============================================================================
- Boost.Geometry (aka GGL, Generic Geometry Library)
- Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
- Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
- Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
- Use, modification and distribution is subject to the Boost Software License,
- Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt)
- =============================================================================/]
- [/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
- [/ Generated from doxy/doxygen_output/xml/classboost_1_1geometry_1_1svg__mapper.xml]
- [section:svg_mapper svg_mapper]
- '''<indexterm><primary>svg_mapper</primary></indexterm>'''
- Helper class to create SVG maps.
- [heading Synopsis]
- ``template<typename Point, bool SameScale, typename SvgCoordinateType>
- class svg_mapper
- : noncopyable
- {
- // ...
- };
- ``
- [heading Template parameter(s)]
- [table
- [[Parameter] [Default] [Description]]
- [[typename Point] [] [Point type, for input geometries. ]]
- [[bool SameScale] [true] [Boolean flag indicating if horizontal and vertical scale should be the same. The default value is true ]]
- [[typename SvgCoordinateType] [double] [Coordinate type of SVG points. SVG is capable to use floating point coordinates. Therefore the default value is double]]
- ]
- [heading Constructor(s)]
- [table
- [[Function] [Description] [Parameters] ]
- [[``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. ] [[* std::ostream &]: ['stream]: Output stream, should be a stream already open
- [* SvgCoordinateType]: ['width]: Width of the SVG map (in SVG pixels)
- [* SvgCoordinateType]: ['height]: Height of the SVG map (in SVG pixels)
- [* std::string const &]: ['width_height]: Optional information to increase width and/or height
- ]]
- [[``~svg_mapper()``
- ] [Destructor, called automatically. Closes the SVG by streaming <\/svg> ] [
- ]]
- ]
- [heading Member Function(s)]
- [table
- [[Function] [Description] [Parameters] [Returns]]
- [[``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. ] [[* Geometry const &]: ['geometry]: A model of the specified concept
- ][
- ]
- ]
- [[``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. ] [[* Geometry const &]: ['geometry]: A model of the specified concept
- [* std::string const &]: ['style]: String containing verbatim SVG style information
- [* double]: ['size]: Optional size (used for SVG points) in SVG pixels. For linestrings, specify linewidth in the SVG style information
- ][
- ]
- ]
- [[``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. ] [[* TextPoint const &]: ['point]: Location of the text (in map units)
- [* std::string const &]: ['s]: The text itself
- [* std::string const &]: ['style]: String containing verbatim SVG style information, of the text
- [* double]: ['offset_x]: Offset in SVG pixels, defaults to 0
- [* double]: ['offset_y]: Offset in SVG pixels, defaults to 0
- [* double]: ['lineheight]: Line height in SVG pixels, in case the text contains
- ][
- ]
- ]
- ]
- [heading Header]
- Either
- `#include <boost/geometry.hpp>`
- Or
- `#include <boost/geometry/io/svg/svg_mapper.hpp>`
- [include reference/io/svg.qbk]
- [endsect]
|