SVGLoader Class Reference
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< gz::math::Vector2d > > &_closedPolys, std::vector< std::vector< gz::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()
|
explicit |
Constructor.
- Parameters
-
[in] _samples The 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] _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 |
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: