svg_mapper.qbk 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. [/============================================================================
  2. Boost.Geometry (aka GGL, Generic Geometry Library)
  3. Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
  4. Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
  5. Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
  6. Use, modification and distribution is subject to the Boost Software License,
  7. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. http://www.boost.org/LICENSE_1_0.txt)
  9. =============================================================================/]
  10. [/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
  11. [/ Generated from doxy/doxygen_output/xml/classboost_1_1geometry_1_1svg__mapper.xml]
  12. [section:svg_mapper svg_mapper]
  13. '''<indexterm><primary>svg_mapper</primary></indexterm>'''
  14. Helper class to create SVG maps.
  15. [heading Synopsis]
  16. ``template<typename Point, bool SameScale, typename SvgCoordinateType>
  17. class svg_mapper
  18. : noncopyable
  19. {
  20. // ...
  21. };
  22. ``
  23. [heading Template parameter(s)]
  24. [table
  25. [[Parameter] [Default] [Description]]
  26. [[typename Point] [] [Point type, for input geometries. ]]
  27. [[bool SameScale] [true] [Boolean flag indicating if horizontal and vertical scale should be the same. The default value is true ]]
  28. [[typename SvgCoordinateType] [double] [Coordinate type of SVG points. SVG is capable to use floating point coordinates. Therefore the default value is double]]
  29. ]
  30. [heading Constructor(s)]
  31. [table
  32. [[Function] [Description] [Parameters] ]
  33. [[``svg_mapper(std::ostream & stream, SvgCoordinateType width, SvgCoordinateType height,
  34. std::string const & width_height = "width=\"100%\" height=\"100%\"")``
  35. ] [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
  36. [* SvgCoordinateType]: ['width]: Width of the SVG map (in SVG pixels)
  37. [* SvgCoordinateType]: ['height]: Height of the SVG map (in SVG pixels)
  38. [* std::string const &]: ['width_height]: Optional information to increase width and/or height
  39. ]]
  40. [[``~svg_mapper()``
  41. ] [Destructor, called automatically. Closes the SVG by streaming <\/svg> ] [
  42. ]]
  43. ]
  44. [heading Member Function(s)]
  45. [table
  46. [[Function] [Description] [Parameters] [Returns]]
  47. [[``template<typename Geometry>
  48. void add(Geometry const & geometry)``
  49. ] [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
  50. ][
  51. ]
  52. ]
  53. [[``template<typename Geometry>
  54. void map(Geometry const & geometry, std::string const & style, double size = -1.0)``
  55. ] [Maps a geometry into the SVG map using the specified style. ] [[* Geometry const &]: ['geometry]: A model of the specified concept
  56. [* std::string const &]: ['style]: String containing verbatim SVG style information
  57. [* double]: ['size]: Optional size (used for SVG points) in SVG pixels. For linestrings, specify linewidth in the SVG style information
  58. ][
  59. ]
  60. ]
  61. [[``template<typename TextPoint>
  62. void text(TextPoint const & point, std::string const & s, std::string const & style,
  63. double offset_x = 0.0, double offset_y = 0.0, double lineheight = 10.0)``
  64. ] [Adds a text to the SVG map. ] [[* TextPoint const &]: ['point]: Location of the text (in map units)
  65. [* std::string const &]: ['s]: The text itself
  66. [* std::string const &]: ['style]: String containing verbatim SVG style information, of the text
  67. [* double]: ['offset_x]: Offset in SVG pixels, defaults to 0
  68. [* double]: ['offset_y]: Offset in SVG pixels, defaults to 0
  69. [* double]: ['lineheight]: Line height in SVG pixels, in case the text contains
  70. ][
  71. ]
  72. ]
  73. ]
  74. [heading Header]
  75. Either
  76. `#include <boost/geometry.hpp>`
  77. Or
  78. `#include <boost/geometry/io/svg/svg_mapper.hpp>`
  79. [include reference/io/svg.qbk]
  80. [endsect]