diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-04-07 23:42:04 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-04-07 23:42:04 +0000 |
| commit | 945ce419c806c73d70203dec33ececafbe108a92 (patch) | |
| tree | cfcdb59bf47e9db7f9e01f7eebb59924bdeaea94 /src/livarot | |
| parent | Merge from trunk (again) (diff) | |
| parent | Extensions. SVG+media fix (see Bug #400356). (diff) | |
| download | inkscape-945ce419c806c73d70203dec33ececafbe108a92.tar.gz inkscape-945ce419c806c73d70203dec33ececafbe108a92.zip | |
Merge from trunk
(bzr r9508.1.73)
Diffstat (limited to 'src/livarot')
| -rw-r--r-- | src/livarot/Path.cpp | 2 | ||||
| -rw-r--r-- | src/livarot/Path.h | 6 | ||||
| -rw-r--r-- | src/livarot/PathCutting.cpp | 14 | ||||
| -rw-r--r-- | src/livarot/PathSimplify.cpp | 4 | ||||
| -rw-r--r-- | src/livarot/Shape.h | 6 | ||||
| -rw-r--r-- | src/livarot/ShapeMisc.cpp | 8 | ||||
| -rw-r--r-- | src/livarot/ShapeSweep.cpp | 4 | ||||
| -rw-r--r-- | src/livarot/path-description.cpp | 16 | ||||
| -rw-r--r-- | src/livarot/path-description.h | 14 |
9 files changed, 37 insertions, 37 deletions
diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp index 2a1851cfe..88d397864 100644 --- a/src/livarot/Path.cpp +++ b/src/livarot/Path.cpp @@ -699,7 +699,7 @@ void Path::PointAndTangentAt(int piece, double at, Geom::Point &pos, Geom::Point } } -void Path::Transform(const Geom::Matrix &trans) +void Path::Transform(const Geom::Affine &trans) { for (std::vector<PathDescr*>::iterator i = descr_cmd.begin(); i != descr_cmd.end(); i++) { (*i)->transform(trans); diff --git a/src/livarot/Path.h b/src/livarot/Path.h index 19b1ab48c..b8041c63a 100644 --- a/src/livarot/Path.h +++ b/src/livarot/Path.h @@ -178,12 +178,12 @@ public: void DashPolylineFromStyle(SPStyle *style, float scale, float min_len); //utilitaire pour inkscape - void LoadPath(Geom::Path const &path, Geom::Matrix const &tr, bool doTransformation, bool append = false); - void LoadPathVector(Geom::PathVector const &pv, Geom::Matrix const &tr, bool doTransformation); + void LoadPath(Geom::Path const &path, Geom::Affine const &tr, bool doTransformation, bool append = false); + void LoadPathVector(Geom::PathVector const &pv, Geom::Affine const &tr, bool doTransformation); void LoadPathVector(Geom::PathVector const &pv); Geom::PathVector* MakePathVector(); - void Transform(const Geom::Matrix &trans); + void Transform(const Geom::Affine &trans); // decompose le chemin en ses sous-chemin // killNoSurf=true -> oublie les chemins de surface nulle diff --git a/src/livarot/PathCutting.cpp b/src/livarot/PathCutting.cpp index 112aabed7..708d20f3f 100644 --- a/src/livarot/PathCutting.cpp +++ b/src/livarot/PathCutting.cpp @@ -23,7 +23,7 @@ #include "libnr/nr-convert2geom.h" #include <2geom/pathvector.h> #include <2geom/point.h> -#include <2geom/matrix.h> +#include <2geom/affine.h> #include <2geom/sbasis-to-bezier.h> #include <2geom/curves.h> #include "../display/canvas-bpath.h" @@ -399,9 +399,9 @@ void Path::AddCurve(Geom::Curve const &c) } else if(Geom::SVGEllipticalArc const *svg_elliptical_arc = dynamic_cast<Geom::SVGEllipticalArc const *>(&c)) { ArcTo( svg_elliptical_arc->finalPoint(), - svg_elliptical_arc->ray(0), svg_elliptical_arc->ray(1), - svg_elliptical_arc->rotation_angle(), /// \todo check that this parameter is in radians (rotation_angle returns the angle in radians!) - svg_elliptical_arc->large_arc_flag(), !svg_elliptical_arc->sweep_flag() ); + svg_elliptical_arc->ray(Geom::X), svg_elliptical_arc->ray(Geom::Y), + svg_elliptical_arc->rotationAngle(), /// \todo check that this parameter is in radians (rotation_angle returns the angle in radians!) + svg_elliptical_arc->largeArc(), !svg_elliptical_arc->sweep() ); } else { //this case handles sbasis as well as all other curve types Geom::Path sbasis_path = Geom::cubicbezierpath_from_sbasis(c.toSBasis(), 0.1); @@ -415,7 +415,7 @@ void Path::AddCurve(Geom::Curve const &c) /** append is false by default: it means that the path should be resetted. If it is true, the path is not resetted and Geom::Path will be appended as a new path */ -void Path::LoadPath(Geom::Path const &path, Geom::Matrix const &tr, bool doTransformation, bool append) +void Path::LoadPath(Geom::Path const &path, Geom::Affine const &tr, bool doTransformation, bool append) { if (!append) { SetBackData (false); @@ -448,10 +448,10 @@ void Path::LoadPath(Geom::Path const &path, Geom::Matrix const &tr, bool doTran void Path::LoadPathVector(Geom::PathVector const &pv) { - LoadPathVector(pv, Geom::Matrix(), false); + LoadPathVector(pv, Geom::Affine(), false); } -void Path::LoadPathVector(Geom::PathVector const &pv, Geom::Matrix const &tr, bool doTransformation) +void Path::LoadPathVector(Geom::PathVector const &pv, Geom::Affine const &tr, bool doTransformation) { SetBackData (false); Reset(); diff --git a/src/livarot/PathSimplify.cpp b/src/livarot/PathSimplify.cpp index 4ebed0efd..fb2aa55e2 100644 --- a/src/livarot/PathSimplify.cpp +++ b/src/livarot/PathSimplify.cpp @@ -251,7 +251,7 @@ bool Path::FitCubic(Geom::Point const &start, PathDescrCubicTo &res, Geom::Point const end = res.p; // la matrice tNN - Geom::Matrix M(0, 0, 0, 0, 0, 0); + Geom::Affine M(0, 0, 0, 0, 0, 0); for (int i = 1; i < nbPt - 1; i++) { M[0] += N13(tk[i]) * N13(tk[i]); M[1] += N23(tk[i]) * N13(tk[i]); @@ -266,7 +266,7 @@ bool Path::FitCubic(Geom::Point const &start, PathDescrCubicTo &res, return false; } - Geom::Matrix const iM = M.inverse(); + Geom::Affine const iM = M.inverse(); M = iM; // phase 1: abcisses diff --git a/src/livarot/Shape.h b/src/livarot/Shape.h index 44dd43a4a..5649ff9e4 100644 --- a/src/livarot/Shape.h +++ b/src/livarot/Shape.h @@ -288,9 +288,9 @@ public: // create a graph that is an offseted version of the graph "of" // the offset is dec, with joins between edges of type "join" (see LivarotDefs.h) // the result is NOT a polygon; you need a subsequent call to ConvertToShape to get a real polygon - int MakeOffset(Shape *of, double dec, JoinType join, double miter, bool do_profile=false, double cx = 0, double cy = 0, double radius = 0, Geom::Matrix *i2doc = NULL); + int MakeOffset(Shape *of, double dec, JoinType join, double miter, bool do_profile=false, double cx = 0, double cy = 0, double radius = 0, Geom::Affine *i2doc = NULL); - int MakeTweak (int mode, Shape *a, double dec, JoinType join, double miter, bool do_profile, Geom::Point c, Geom::Point vector, double radius, Geom::Matrix *i2doc); + int MakeTweak (int mode, Shape *a, double dec, JoinType join, double miter, bool do_profile, Geom::Point c, Geom::Point vector, double radius, Geom::Affine *i2doc); int PtWinding(const Geom::Point px) const; // plus rapide int Winding(const Geom::Point px) const; @@ -314,7 +314,7 @@ public: void QuickScan(float &pos, int &curP, float to, FillRule directed, BitLigne* line, float step); void QuickScan(float &pos, int &curP, float to, AlphaLigne* line, float step); - void Transform(Geom::Matrix const &tr) + void Transform(Geom::Affine const &tr) {for(std::vector<dg_point>::iterator it=_pts.begin();it!=_pts.end();it++) it->x*=tr;} std::vector<back_data> ebData; diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp index a82da4c8a..da268910f 100644 --- a/src/livarot/ShapeMisc.cpp +++ b/src/livarot/ShapeMisc.cpp @@ -14,7 +14,7 @@ #include <cstdlib> #include <cstring> #include <2geom/point.h> -#include <2geom/matrix.h> +#include <2geom/affine.h> /* * polygon offset and polyline to path reassembling (when using back data) @@ -528,7 +528,7 @@ Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int wildPath,in int -Shape::MakeTweak (int mode, Shape *a, double power, JoinType join, double miter, bool do_profile, Geom::Point c, Geom::Point vector, double radius, Geom::Matrix *i2doc) +Shape::MakeTweak (int mode, Shape *a, double power, JoinType join, double miter, bool do_profile, Geom::Point c, Geom::Point vector, double radius, Geom::Affine *i2doc) { Reset (0, 0); MakeBackData(a->_has_back_data); @@ -639,7 +639,7 @@ Shape::MakeTweak (int mode, Shape *a, double power, JoinType join, double miter, Geom::Point this_vec(0,0); if (mode == tweak_mode_push) { - Geom::Matrix tovec (*i2doc); + Geom::Affine tovec (*i2doc); tovec[4] = tovec[5] = 0; tovec = tovec.inverse(); this_vec = this_power * (vector * tovec) ; @@ -718,7 +718,7 @@ Shape::MakeTweak (int mode, Shape *a, double power, JoinType join, double miter, // you gotta be very careful with the join, as anything but the right one will fuck everything up // see PathStroke.cpp for the "right" joins int -Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_profile, double cx, double cy, double radius, Geom::Matrix *i2doc) +Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_profile, double cx, double cy, double radius, Geom::Affine *i2doc) { Reset (0, 0); MakeBackData(a->_has_back_data); diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index 9ff633f1d..e3fb0296d 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -11,7 +11,7 @@ #include <cstring> #include <glib.h> #include <glib/gmem.h> -#include <2geom/matrix.h> +#include <2geom/affine.h> #include "Shape.h" #include "livarot/sweep-event-queue.h" #include "livarot/sweep-tree-list.h" @@ -2605,7 +2605,7 @@ Shape::TesteIntersection (Shape * ils, Shape * irs, int ilb, int irb, usvs = irs->pData[rSt].rx - ils->pData[lSt].rx; // pas sur de l'ordre des coefs de m - Geom::Matrix m(ldir[0], ldir[1], + Geom::Affine m(ldir[0], ldir[1], rdir[0], rdir[1], 0, 0); double det = m.det(); diff --git a/src/livarot/path-description.cpp b/src/livarot/path-description.cpp index fd91cb447..c34965a5c 100644 --- a/src/livarot/path-description.cpp +++ b/src/livarot/path-description.cpp @@ -1,5 +1,5 @@ #include "livarot/path-description.h" -#include <2geom/matrix.h> +#include <2geom/affine.h> PathDescr *PathDescrMoveTo::clone() const { @@ -11,7 +11,7 @@ void PathDescrMoveTo::dumpSVG(Inkscape::SVGOStringStream& s, Geom::Point const & s << "M " << p[Geom::X] << " " << p[Geom::Y] << " "; } -void PathDescrMoveTo::transform(Geom::Matrix const& t) +void PathDescrMoveTo::transform(Geom::Affine const& t) { p = p * t; } @@ -32,7 +32,7 @@ PathDescr *PathDescrLineTo::clone() const return new PathDescrLineTo(*this); } -void PathDescrLineTo::transform(Geom::Matrix const& t) +void PathDescrLineTo::transform(Geom::Affine const& t) { p = p * t; } @@ -48,7 +48,7 @@ PathDescr *PathDescrBezierTo::clone() const return new PathDescrBezierTo(*this); } -void PathDescrBezierTo::transform(Geom::Matrix const& t) +void PathDescrBezierTo::transform(Geom::Affine const& t) { p = p * t; } @@ -64,7 +64,7 @@ PathDescr *PathDescrIntermBezierTo::clone() const return new PathDescrIntermBezierTo(*this); } -void PathDescrIntermBezierTo::transform(Geom::Matrix const& t) +void PathDescrIntermBezierTo::transform(Geom::Affine const& t) { p = p * t; } @@ -100,9 +100,9 @@ void PathDescrCubicTo::dump(std::ostream &s) const << end[Geom::X] << " " << end[Geom::Y] << " "; } -void PathDescrCubicTo::transform(Geom::Matrix const& t) +void PathDescrCubicTo::transform(Geom::Affine const& t) { - Geom::Matrix tr = t; + Geom::Affine tr = t; tr[4] = tr[5] = 0; start = start * tr; end = end * tr; @@ -127,7 +127,7 @@ PathDescr *PathDescrArcTo::clone() const return new PathDescrArcTo(*this); } -void PathDescrArcTo::transform(Geom::Matrix const& t) +void PathDescrArcTo::transform(Geom::Affine const& t) { p = p * t; } diff --git a/src/livarot/path-description.h b/src/livarot/path-description.h index 68088c27c..1d0dfb57e 100644 --- a/src/livarot/path-description.h +++ b/src/livarot/path-description.h @@ -37,7 +37,7 @@ struct PathDescr virtual void dumpSVG(Inkscape::SVGOStringStream &/*s*/, Geom::Point const &/*last*/) const {} virtual PathDescr *clone() const = 0; - virtual void transform(Geom::Matrix const &/*t*/) {} + virtual void transform(Geom::Affine const &/*t*/) {} virtual void dump(std::ostream &/*s*/) const {} int flags; // most notably contains the path command no @@ -53,7 +53,7 @@ struct PathDescrMoveTo : public PathDescr void dumpSVG(Inkscape::SVGOStringStream &s, Geom::Point const &last) const; PathDescr *clone() const; - void transform(Geom::Matrix const &t); + void transform(Geom::Affine const &t); void dump(std::ostream &s) const; Geom::Point p; @@ -66,7 +66,7 @@ struct PathDescrLineTo : public PathDescr void dumpSVG(Inkscape::SVGOStringStream &s, Geom::Point const &last) const; PathDescr *clone() const; - void transform(Geom::Matrix const &t); + void transform(Geom::Affine const &t); void dump(std::ostream &s) const; Geom::Point p; @@ -79,7 +79,7 @@ struct PathDescrBezierTo : public PathDescr : PathDescr(descr_bezierto), p(pp), nb(n) {} PathDescr *clone() const; - void transform(Geom::Matrix const &t); + void transform(Geom::Affine const &t); void dump(std::ostream &s) const; Geom::Point p; // the endpoint's coordinates @@ -95,7 +95,7 @@ struct PathDescrIntermBezierTo : public PathDescr : PathDescr(descr_interm_bezier), p(pp) {} PathDescr *clone() const; - void transform(Geom::Matrix const &t); + void transform(Geom::Affine const &t); void dump(std::ostream &s) const; Geom::Point p; // control point coordinates @@ -109,7 +109,7 @@ struct PathDescrCubicTo : public PathDescr void dumpSVG(Inkscape::SVGOStringStream &s, Geom::Point const &last) const; PathDescr *clone() const; - void transform(Geom::Matrix const &t); + void transform(Geom::Affine const &t); void dump(std::ostream &s) const; Geom::Point p; @@ -125,7 +125,7 @@ struct PathDescrArcTo : public PathDescr void dumpSVG(Inkscape::SVGOStringStream &s, Geom::Point const &last) const; PathDescr *clone() const; - void transform(Geom::Matrix const &t); + void transform(Geom::Affine const &t); void dump(std::ostream &s) const; Geom::Point p; |
