1
#include "libnr/nr-point-matrix-ops.h"
2
#include "livarot/path-description.h"
4
PathDescr *PathDescrMoveTo::clone() const
6
return new PathDescrMoveTo(*this);
9
void PathDescrMoveTo::dumpSVG(Inkscape::SVGOStringStream& s, NR::Point const &last) const
11
s << "M " << p[NR::X] << " " << p[NR::Y] << " ";
14
void PathDescrMoveTo::transform(NR::Matrix const& t)
19
void PathDescrMoveTo::dump(std::ostream &s) const
22
s << " m " << p[NR::X] << " " << p[NR::Y];
25
void PathDescrLineTo::dumpSVG(Inkscape::SVGOStringStream& s, NR::Point const &last) const
27
s << "L " << p[NR::X] << " " << p[NR::Y] << " ";
30
PathDescr *PathDescrLineTo::clone() const
32
return new PathDescrLineTo(*this);
35
void PathDescrLineTo::transform(NR::Matrix const& t)
40
void PathDescrLineTo::dump(std::ostream &s) const
43
s << " l " << p[NR::X] << " " << p[NR::Y];
46
PathDescr *PathDescrBezierTo::clone() const
48
return new PathDescrBezierTo(*this);
51
void PathDescrBezierTo::transform(NR::Matrix const& t)
56
void PathDescrBezierTo::dump(std::ostream &s) const
59
s << " b " << p[NR::X] << " " << p[NR::Y] << " " << nb;
62
PathDescr *PathDescrIntermBezierTo::clone() const
64
return new PathDescrIntermBezierTo(*this);
67
void PathDescrIntermBezierTo::transform(NR::Matrix const& t)
72
void PathDescrIntermBezierTo::dump(std::ostream &s) const
75
s << " i " << p[NR::X] << " " << p[NR::Y];
78
void PathDescrCubicTo::dumpSVG(Inkscape::SVGOStringStream& s, NR::Point const &last) const
81
<< last[NR::X] + start[0] / 3 << " "
82
<< last[NR::Y] + start[1] / 3 << " "
83
<< p[NR::X] - end[0] / 3 << " "
84
<< p[NR::Y] - end[1] / 3 << " "
89
PathDescr *PathDescrCubicTo::clone() const
91
return new PathDescrCubicTo(*this);
94
void PathDescrCubicTo::dump(std::ostream &s) const
98
<< p[NR::X] << " " << p[NR::Y] << " "
99
<< start[NR::X] << " " << start[NR::Y] << " "
100
<< end[NR::X] << " " << end[NR::Y] << " ";
103
void PathDescrCubicTo::transform(NR::Matrix const& t)
113
void PathDescrArcTo::dumpSVG(Inkscape::SVGOStringStream& s, NR::Point const &last) const
119
<< (large ? "1" : "0") << " "
120
<< (clockwise ? "0" : "1") << " "
125
PathDescr *PathDescrArcTo::clone() const
127
return new PathDescrArcTo(*this);
130
void PathDescrArcTo::transform(NR::Matrix const& t)
135
void PathDescrArcTo::dump(std::ostream &s) const
139
<< p[NR::X] << " " << p[NR::Y] << " "
140
<< rx << " " << ry << " "
142
<< (clockwise ? 1 : 0) << " "
146
PathDescr *PathDescrForced::clone() const
148
return new PathDescrForced(*this);
151
void PathDescrClose::dumpSVG(Inkscape::SVGOStringStream& s, NR::Point const &last) const
156
PathDescr *PathDescrClose::clone() const
158
return new PathDescrClose(*this);
165
c-file-style:"stroustrup"
166
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
171
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :