33#ifndef LIB2GEOM_SEEN_SVG_PATH_PARSER_H
34#define LIB2GEOM_SEEN_SVG_PATH_PARSER_H
79 void parse(
char const *str,
int len = -1);
81 void parse(std::string
const &s);
90 void feed(
char const *str,
int len = -1);
92 void feed(std::string
const &s);
135 void _arcTo(
double rx,
double ry,
double angle,
136 bool large_arc,
bool sweep,
Point const &p);
140 void _parse(
char const *str,
char const *strend,
bool finish);
180 FILE* fi = fopen(filename,
"r");
181 if(fi == NULL)
throw(std::runtime_error(
"Error opening file"));
Defines the different types of exceptions that 2geom can throw.
Cartesian point / 2D vector and related operations.
Abstract continuous curve on a plane defined on [0,1].
Store paths to an output iterator.
Callback interface for processing path data.
Two-dimensional point that doubles as a vector.
Read SVG path data and feed it to a PathSink.
void finish()
Finalize parsing.
void setZSnapThreshold(Coord threshold)
Set the threshold for considering the closing segment degenerate.
Coord _pop_coord(Geom::Dim2 axis)
void _parse(char const *str, char const *strend, bool finish)
void feed(char const *str, int len=-1)
Parse a part of path data stored in a C-style string.
bool _moveto_was_absolute
std::vector< Coord > _params
void _quadTo(Point const &c, Point const &p)
Coord zSnapThreshold() const
void parse(char const *str, int len=-1)
Parse a C-style string.
void _curveTo(Point const &c0, Point const &c1, Point const &p)
void _moveTo(Point const &p)
void _lineTo(Point const &p)
void _arcTo(double rx, double ry, double angle, bool large_arc, bool sweep, Point const &p)
void reset()
Reset internal state.
void _pushCurve(Curve *c)
Contains forward declarations of 2geom types.
void parse_svg_path(char const *str, PathSink &sink)
Feed SVG path data to the specified sink.
PathVector read_svgd_f(FILE *fi)
Create path vector from a C stream with SVG path data.
PathVector read_svgd(char const *filename)
Create path vector from SVG path data stored in a file.
void parse_svg_path_file(FILE *fi, PathSink &sink)
Feed SVG path data from a C stream to the specified sink.
Dim2
2D axis enumeration (X or Y).
double Coord
Floating point type used to store coordinates.
Various utility functions.
std::back_insert_iterator< PathVector > SubpathInserter
callback interface for SVG path data