42 return c >=
'0' &&
c <=
'9';
49 , _use_shorthands(true)
53 _ns.imbue(std::locale::classic());
54 _ns.unsetf(std::ios::floatfield);
148 bool large_arc,
bool sweep,
Point const &p)
183 if (
_s.tellp() != 0) {
190 bool contained_dot =
false;
205 char firstchar = cs[0];
209 }
else if (firstchar ==
'.' && !contained_dot) {
212 }
else if (lastchar ==
'.' &&
is_digit(firstchar)) {
218 lastchar = cs[cs.length()-1];
219 contained_dot = cs.find(
'.') != std::string::npos;
virtual void feed(Curve const &c, bool moveto_initial=true)
Two-dimensional point that doubles as a vector.
Serialize paths to SVG path data strings.
void setPrecision(int prec)
Set output precision.
void lineTo(Point const &p) override
Output a line segment.
void quadTo(Point const &c, Point const &p) override
Output a cubic Bezier segment.
void setOptimize(bool opt)
Enable or disable length optimization.
std::vector< Coord > _current_pars
void flush() override
Flush any internal state of the generator.
void clear()
Clear any path data written so far.
void moveTo(Point const &p) override
Move to a different point without creating a segment.
void curveTo(Point const &c0, Point const &c1, Point const &p) override
Output a quadratic Bezier segment.
std::string _formatCoord(Coord par)
void closePath() override
Close the current path with a line segment.
void arcTo(double rx, double ry, double angle, bool large_arc, bool sweep, Point const &p) override
Output an elliptical arc segment.
void setUseShorthands(bool use)
Enable or disable the use of V, H, T and S commands where possible.
std::string str() const
Retrieve the generated path data string.
void _setCommand(char cmd)
Integral and real coordinate types and some basic utilities.
double Coord
Floating point type used to store coordinates.
Various utility functions.
static bool is_digit(char c)
std::string write_svg_path(PathVector const &pv, int prec=-1, bool optimize=false, bool shorthands=true)
std::string format_coord_shortest(Coord x)
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)
Path sink which writes an SVG-compatible command string.
Glib::RefPtr< Gtk::Adjustment > optimize