/*
5 * Authors: see git history
7 * Copyright 2007 MenTaLguY <mental@rydia.net>
8 * Copyright 2008 Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
9 * Copyright 2013 Tavmjong Bah <tavmjong@free.fr>
10 * Copyright (C) 2014 Authors
12 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
15#ifndef SEEN_INKSCAPE_SVG_PATH_STRING_H
16#define SEEN_INKSCAPE_SVG_PATH_STRING_H
20#include <glibmm/ustring.h>
47 std::string
const &t =
tail();
55 operator std::string
const &() {
59 operator Glib::ustring
const ()
const {
131 bool large_arc,
bool sweep,
154 void _appendOp(
char abs_op,
char rel_op);
193 State(
int precision = 8,
int minexp = -8) {
201 prevop = ( op ==
'M' ?
'L' : op ==
'm' ?
'l' : op );
206 str += ( flag ?
'1' :
'0' );
217 if (
str.size() < s.
str.size() )
return true;
218 if (
str.size() > s.
str.size() )
return false;
246 std::string
const &
tail()
const {
Cartesian point / 2D vector and related operations.
Two-dimensional point that doubles as a vector.
Builder for SVG path strings.
std::string const & tail() const
void _appendX(Geom::Coord x, bool sc)
void _appendY(Geom::Coord y, bool sc)
PathString & curveTo(Geom::Coord x0, Geom::Coord y0, Geom::Coord x1, Geom::Coord y1, Geom::Coord x, Geom::Coord y)
std::string const & string()
PathString & lineTo(Geom::Point p)
struct Inkscape::SVG::PathString::State _abs_state
PathString & moveTo(Geom::Coord x, Geom::Coord y)
bool _force_repeat_commands
PATHSTRING_FORMAT _format
PathString & verticalLineTo(Geom::Coord y)
Geom::Point _current_point
PathString & arcTo(Geom::Coord rx, Geom::Coord ry, Geom::Coord rot, bool large_arc, bool sweep, Geom::Point p)
PathString & lineTo(Geom::Coord x, Geom::Coord y)
PathString()
Construct a path string using Inkscape's default preferences.
PathString & quadTo(Geom::Coord cx, Geom::Coord cy, Geom::Coord x, Geom::Coord y)
PathString & moveTo(Geom::Point p)
PathString & horizontalLineTo(Geom::Coord x)
void _appendPoint(Geom::Point p, bool sc)
void _appendValue(Geom::Point p)
PathString & curveTo(Geom::Point c0, Geom::Point c1, Geom::Point p)
void _appendFlag(bool flag)
PathString & quadTo(Geom::Point c, Geom::Point p)
void _appendOp(char abs_op, char rel_op)
Geom::Point _initial_point
struct Inkscape::SVG::PathString::State _rel_state
void _appendValue(Geom::Coord v)
double Coord
Floating point type used to store coordinates.
Helper class to stream background task notifications as a series of messages.
void appendNumber(double v, int precision, int minexp)
void appendRelativeCoord(Geom::Coord v, Geom::Coord r)
bool operator<=(const State &s) const
State(int precision=8, int minexp=-8)
void appendRelative(Geom::Coord v, Geom::Coord r)