Gazebo Common

API Reference

4.7.0

A loader for SVG files. More...

#include <SVGLoader.hh>

Public Member Functions

 SVGLoader (const 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, const 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 ( const unsigned int  _samples)
explicit

Constructor.

Parameters
[in]_samplesThe number of points for cubic spline segments Samples must be greater than zero. A value of one will be used if _samples is set to zero.

◆ ~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]_pathsThe paths
[in]_outThe 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]_filenameThe SVG file
[out]_pathsVector that receives path datai
Returns
false when the file cannot be processed

◆ PathsToClosedPolylines()

static void PathsToClosedPolylines ( const std::vector< common::SVGPath > &  _paths,
const 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]_pathsThe input paths
[in]_tolTolerence when comparing distance between 2 points.
[out]_closedPolysA vector to collect new closed loops
[out]_openPolysA vector to collect non closed paths

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