##

SVGLoader Class Reference

A loader for SVG files. More...

`#include <SVGLoader.hh>`

## Public Member Functions

| SVGLoader (unsigned int _samples)
| Constructor. More...
| ~SVGLoader ()
| destructor More...
void | DumpPaths (const std::vector< SVGPath > &_paths, std::ostream &_out) const
| Outputs the content of the paths to file (or console) More...
bool | Parse (const std::string &_filename, std::vector< SVGPath > &_paths)
| Reads an SVG file and loads all the paths. More...

## Static Public Member Functions

static void | PathsToClosedPolylines (const std::vector< common::SVGPath > &_paths, double _tol, std::vector< std::vector< ignition::math::Vector2d > > &_closedPolys, std::vector< std::vector< ignition::math::Vector2d > > &_openPolys)
| Reads in paths and outputs closed polylines and open polylines. More...

## Detailed Description

A loader for SVG files.

## Constructor & Destructor Documentation

## SVGLoader()

SVGLoader | ( | unsigned int | _samples | ) |

explicit

Constructor.

Parameters

  [in] | _samples | The number of points for cubic spline segments

## ~SVGLoader()

~SVGLoader | ( |  | ) |

destructor

## Member Function Documentation

## DumpPaths()

void DumpPaths | ( | const std::vector< SVGPath > & | _paths,
|  | std::ostream & | _out
| ) |  | const

Outputs the content of the paths to file (or console)

Parameters

  [in] | _paths | The paths
  [in] | _out | The output stream (can be a file or std::cout)

## Parse()

bool Parse | ( | const std::string & | _filename,
|  | std::vector< SVGPath > & | _paths
| ) |  |

Reads an SVG file and loads all the paths.

Parameters

  [in] | _filename | The SVG file
  [out] | _paths | Vector that receives path datai

Returns
  false when the file cannot be processed

## PathsToClosedPolylines()

static void PathsToClosedPolylines | ( | const std::vector< common::SVGPath > & | _paths,
|  | double | _tol,
|  | std::vector< std::vector< ignition::math::Vector2d > > & | _closedPolys,
|  | std::vector< std::vector< ignition::math::Vector2d > > & | _openPolys
| ) |  |

static

Reads in paths and outputs closed polylines and open polylines.

Parameters

  [in] | _paths | The input paths
  [in] | _tol | Tolerence when comparing distance between 2 points.
  [out] | _closedPolys | A vector to collect new closed loops
  [out] | _openPolys | A vector to collect non closed paths

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

- SVGLoader.hh