diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2016-02-15 09:03:42 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2016-02-15 09:03:42 +0000 |
| commit | 7f4a4369b9b0b97301690a32f1fd25f1161b41f3 (patch) | |
| tree | 6dd2a3fa0f357c33168c8915f52a998e71d08dbe | |
| parent | Fix improperly escaped character in previous commit (which actually fixes bug... (diff) | |
| download | inkscape-7f4a4369b9b0b97301690a32f1fd25f1161b41f3.tar.gz inkscape-7f4a4369b9b0b97301690a32f1fd25f1161b41f3.zip | |
Sync 2Geom to e7245a01127647cd20b0d851a0a622d9ded38d23.
Restores correct meaning of Line::versor().
(bzr r14652)
| -rw-r--r-- | src/2geom/circle.cpp | 8 | ||||
| -rw-r--r-- | src/2geom/conicsec.cpp | 14 | ||||
| -rw-r--r-- | src/2geom/coord.cpp | 9 | ||||
| -rw-r--r-- | src/2geom/ellipse.cpp | 2 | ||||
| -rw-r--r-- | src/2geom/generic-interval.h | 3 | ||||
| -rw-r--r-- | src/2geom/generic-rect.h | 5 | ||||
| -rw-r--r-- | src/2geom/line.cpp | 38 | ||||
| -rw-r--r-- | src/2geom/line.h | 41 | ||||
| -rw-r--r-- | src/2geom/ray.h | 47 | ||||
| -rw-r--r-- | src/2geom/sweeper.h | 12 | ||||
| -rw-r--r-- | src/2geom/utils.h | 2 | ||||
| -rw-r--r-- | src/conn-avoid-ref.cpp | 4 |
12 files changed, 89 insertions, 96 deletions
diff --git a/src/2geom/circle.cpp b/src/2geom/circle.cpp index 553981a72..934a8d3ab 100644 --- a/src/2geom/circle.cpp +++ b/src/2geom/circle.cpp @@ -144,7 +144,7 @@ bool Circle::contains(Circle const &other) const bool Circle::intersects(Line const &l) const { // http://mathworld.wolfram.com/Circle-LineIntersection.html - Coord dr = l.versor().length(); + Coord dr = l.vector().length(); Coord r = _radius; Coord D = cross(l.initialPoint(), l.finalPoint()); Coord delta = r*r * dr*dr - D*D; @@ -163,9 +163,9 @@ bool Circle::intersects(Circle const &other) const std::vector<ShapeIntersection> Circle::intersect(Line const &l) const { // http://mathworld.wolfram.com/Circle-LineIntersection.html - Coord dr = l.versor().length(); - Coord dx = l.versor().x(); - Coord dy = l.versor().y(); + Coord dr = l.vector().length(); + Coord dx = l.vector().x(); + Coord dy = l.vector().y(); Coord D = cross(l.initialPoint() - _center, l.finalPoint() - _center); Coord delta = _radius*_radius * dr*dr - D*D; diff --git a/src/2geom/conicsec.cpp b/src/2geom/conicsec.cpp index 089db71a4..2d396ba30 100644 --- a/src/2geom/conicsec.cpp +++ b/src/2geom/conicsec.cpp @@ -114,8 +114,8 @@ double RatQuad::lambda() const { RatQuad RatQuad::fromPointsTangents(Point P0, Point dP0, Point P, Point P2, Point dP2) { - Line Line0 = Line::from_origin_and_versor(P0, dP0); - Line Line2 = Line::from_origin_and_versor(P2, dP2); + Line Line0 = Line::from_origin_and_vector(P0, dP0); + Line Line2 = Line::from_origin_and_vector(P2, dP2); try { OptCrossing oc = intersection(Line0, Line2); if(!oc) // what to do? @@ -276,8 +276,8 @@ std::vector<Point> decompose_degenerate(xAx const & C1, xAx const & C2, xAx cons n1 = Point(b-d, 1); } - Line L0 = Line::from_origin_and_versor(B0, rot90(n0)); - Line L1 = Line::from_origin_and_versor(B0, rot90(n1)); + Line L0 = Line::from_origin_and_vector(B0, rot90(n0)); + Line L1 = Line::from_origin_and_vector(B0, rot90(n1)); std::vector<double> rts = C1.roots(L0); for(unsigned i = 0; i < rts.size(); i++) { @@ -327,12 +327,12 @@ std::vector<Point> decompose_degenerate(xAx const & C1, xAx const & C2, xAx cons */ assert(L2sq(g) != 0); - Line Lx = Line::from_origin_and_versor(trial_pt, g); // a line along the gradient + Line Lx = Line::from_origin_and_vector(trial_pt, g); // a line along the gradient std::vector<double> rts = xC0.roots(Lx); for(unsigned i = 0; i < rts.size(); i++) { Point P0 = Lx.pointAt(rts[i]); //std::cout << P0 << "\n"; - Line L = Line::from_origin_and_versor(P0, rot90(g)); + Line L = Line::from_origin_and_vector(P0, rot90(g)); std::vector<double> cnrts; // It's very likely that at least one of the conics is degenerate, this will hopefully pick the more generate of the two. if(fabs(C1.hessian().det()) > fabs(C2.hessian().det())) @@ -515,7 +515,7 @@ xAx xAx::operator*(double const &b) const { if(L2sq(dA) <= 1e-10) { // perhaps a single point? return boost::optional<RatQuad> (); } - LineSegment ls = intersection(Line::from_origin_and_versor(A, dA), bnd); + LineSegment ls = intersection(Line::from_origin_and_vector(A, dA), bnd); return RatQuad::fromPointsTangents(A, dA, ls.pointAt(0.5), ls[1], dA); } else if(crs.size() >= 2 && crs.size() < 4) { diff --git a/src/2geom/coord.cpp b/src/2geom/coord.cpp index 8b5e28586..8c7485883 100644 --- a/src/2geom/coord.cpp +++ b/src/2geom/coord.cpp @@ -111,12 +111,6 @@ namespace Geom { namespace { -inline int StrLength(const char* string) { - size_t length = strlen(string); - ASSERT(length == static_cast<size_t>(static_cast<int>(length))); - return static_cast<int>(length); -} - template <typename T> class Vector { public: @@ -1733,8 +1727,6 @@ enum FastDtoaMode { FAST_DTOA_PRECISION }; -static const int kFastDtoaMaximalLength = 17; - bool FastDtoa(double d, FastDtoaMode mode, int requested_digits, @@ -2350,7 +2342,6 @@ bool FastFixedDtoa(double v, return true; } -static const int kMaxExactDoubleIntegerDecimalDigits = 15; static const int kMaxUint64DecimalDigits = 19; static const int kMaxDecimalPower = 309; diff --git a/src/2geom/ellipse.cpp b/src/2geom/ellipse.cpp index afde428b1..f4704460f 100644 --- a/src/2geom/ellipse.cpp +++ b/src/2geom/ellipse.cpp @@ -417,7 +417,7 @@ std::vector<ShapeIntersection> Ellipse::intersect(Line const &line) const // generic case Coord a, b, c; line.coefficients(a, b, c); - Point lv = line.versor(); + Point lv = line.vector(); if (fabs(lv[X]) > fabs(lv[Y])) { // y = -a/b x - c/b diff --git a/src/2geom/generic-interval.h b/src/2geom/generic-interval.h index ce7945ab6..e7892e2dd 100644 --- a/src/2geom/generic-interval.h +++ b/src/2geom/generic-interval.h @@ -32,6 +32,7 @@ #define LIB2GEOM_SEEN_GENERIC_INTERVAL_H #include <cassert> +#include <iostream> #include <boost/none.hpp> #include <boost/optional.hpp> #include <2geom/coord.h> @@ -338,14 +339,12 @@ inline GenericOptInterval<C> operator&(GenericInterval<C> const &a, GenericInter return GenericOptInterval<C>(a) & GenericOptInterval<C>(b); } -#ifdef _GLIBCXX_IOSTREAM template <typename C> inline std::ostream &operator<< (std::ostream &os, Geom::GenericInterval<C> const &I) { os << "Interval("<<I.min() << ", "<<I.max() << ")"; return os; } -#endif } // namespace Geom #endif // !LIB2GEOM_SEEN_GENERIC_INTERVAL_H diff --git a/src/2geom/generic-rect.h b/src/2geom/generic-rect.h index afd2cb8a7..fdc7f369b 100644 --- a/src/2geom/generic-rect.h +++ b/src/2geom/generic-rect.h @@ -41,6 +41,7 @@ #define LIB2GEOM_SEEN_GENERIC_RECT_H #include <limits> +#include <iostream> #include <boost/optional.hpp> #include <2geom/coord.h> @@ -513,13 +514,11 @@ inline bool GenericRect<C>::contains(OptCRect const &r) const { return !r || contains(*r); } -#ifdef _GLIBCXX_IOSTREAM template <typename C> inline std::ostream &operator<<(std::ostream &out, GenericRect<C> const &r) { - out << "X: " << r[X] << " Y: " << r[Y]; + out << "Rect " << r[X] << " x " << r[Y]; return out; } -#endif } // end namespace Geom diff --git a/src/2geom/line.cpp b/src/2geom/line.cpp index ee2edeba7..a9cc0e251 100644 --- a/src/2geom/line.cpp +++ b/src/2geom/line.cpp @@ -103,7 +103,7 @@ void Line::setCoefficients (Coord a, Coord b, Coord c) void Line::coefficients(Coord &a, Coord &b, Coord &c) const { - Point v = versor().cw(); + Point v = vector().cw(); a = v[X]; b = v[Y]; c = cross(_initial, _final); @@ -139,7 +139,7 @@ std::vector<Coord> Line::roots(Coord v, Dim2 d) const { Coord Line::root(Coord v, Dim2 d) const { assert(d == X || d == Y); - Point vs = versor(); + Point vs = vector(); if (vs[d] != 0) { return (v - _initial[d]) / vs[d]; } else { @@ -149,7 +149,7 @@ Coord Line::root(Coord v, Dim2 d) const boost::optional<LineSegment> Line::clip(Rect const &r) const { - Point v = versor(); + Point v = vector(); // handle horizontal and vertical lines first, // since the root-based code below will break for them for (unsigned i = 0; i < 2; ++i) { @@ -221,7 +221,7 @@ boost::optional<LineSegment> Line::clip(Rect const &r) const * @see timeAtProjection */ Coord Line::timeAt(Point const &p) const { - Point v = versor(); + Point v = vector(); // degenerate case if (v[X] == 0 && v[Y] == 0) { return 0; @@ -243,8 +243,8 @@ Coord Line::timeAt(Point const &p) const Affine Line::transformTo(Line const &other) const { Affine result = Translate(-_initial); - result *= Rotate(angle_between(versor(), other.versor())); - result *= Scale(other.versor().length() / versor().length()); + result *= Rotate(angle_between(vector(), other.vector())); + result *= Scale(other.vector().length() / vector().length()); result *= Translate(other._initial); return result; } @@ -253,8 +253,8 @@ std::vector<ShapeIntersection> Line::intersect(Line const &other) const { std::vector<ShapeIntersection> result; - Point v1 = versor(); - Point v2 = other.versor(); + Point v1 = vector(); + Point v2 = other.vector(); Coord cp = cross(v1, v2); if (cp == 0) return result; @@ -333,8 +333,8 @@ OptCrossing intersection_impl(Ray const& r1, Line const& l2, unsigned int i) using std::swap; OptCrossing crossing = - intersection_impl(r1.versor(), r1.origin(), - l2.versor(), l2.origin() ); + intersection_impl(r1.vector(), r1.origin(), + l2.vector(), l2.origin() ); if (crossing) { if (crossing->ta < 0) { @@ -363,7 +363,7 @@ OptCrossing intersection_impl( LineSegment const& ls1, OptCrossing crossing = intersection_impl(ls1.finalPoint() - ls1.initialPoint(), ls1.initialPoint(), - l2.versor(), + l2.vector(), l2.origin() ); if (crossing) { @@ -396,7 +396,7 @@ OptCrossing intersection_impl( LineSegment const& ls1, OptCrossing crossing = intersection_impl( direction, ls1.initialPoint(), - r2.versor(), + r2.vector(), r2.origin() ); if (crossing) { @@ -414,7 +414,7 @@ OptCrossing intersection_impl( LineSegment const& ls1, } if ( are_near(r2.origin(), ls1) ) { - bool eqvs = (dot(direction, r2.versor()) > 0); + bool eqvs = (dot(direction, r2.vector()) > 0); if ( are_near(ls1.initialPoint(), r2.origin()) && !eqvs) { crossing->ta = crossing->tb = 0; return crossing; @@ -445,8 +445,8 @@ OptCrossing intersection_impl( LineSegment const& ls1, OptCrossing intersection(Line const& l1, Line const& l2) { OptCrossing c = detail::intersection_impl( - l1.versor(), l1.origin(), - l2.versor(), l2.origin()); + l1.vector(), l1.origin(), + l2.vector(), l2.origin()); if (!c && distance(l1.origin(), l2) == 0) { THROW_INFINITESOLUTIONS(); @@ -457,8 +457,8 @@ OptCrossing intersection(Line const& l1, Line const& l2) OptCrossing intersection(Ray const& r1, Ray const& r2) { OptCrossing crossing = - detail::intersection_impl( r1.versor(), r1.origin(), - r2.versor(), r2.origin() ); + detail::intersection_impl( r1.vector(), r1.origin(), + r2.vector(), r2.origin() ); if (crossing) { @@ -477,7 +477,7 @@ OptCrossing intersection(Ray const& r1, Ray const& r2) if ( are_near(r1.origin(), r2) || are_near(r2.origin(), r1) ) { if ( are_near(r1.origin(), r2.origin()) - && !are_near(r1.versor(), r2.versor()) ) + && !are_near(r1.vector(), r2.vector()) ) { crossing->ta = crossing->tb = 0; return crossing; @@ -582,7 +582,7 @@ Line make_angle_bisector_line(Line const& l1, Line const& l2) } Point O = l1.pointAt(crossing->ta); Point A = l1.pointAt(crossing->ta + 1); - double angle = angle_between(l1.versor(), l2.versor()); + double angle = angle_between(l1.vector(), l2.vector()); Point B = (angle > 0) ? l2.pointAt(crossing->tb + 1) : l2.pointAt(crossing->tb - 1); diff --git a/src/2geom/line.h b/src/2geom/line.h index 8a66d4472..62b3652f1 100644 --- a/src/2geom/line.h +++ b/src/2geom/line.h @@ -98,7 +98,7 @@ public: /// Create a line by extending a ray. explicit Line(Ray const &r) : _initial(r.origin()) - , _final(r.origin() + r.versor()) + , _final(r.origin() + r.vector()) {} /// Create a line normal to a vector at a specified distance from origin. @@ -111,7 +111,7 @@ public: * Note that each line direction has two possible unit vectors. * @param o Point through which the line will pass * @param v Unit vector of the line's direction */ - static Line from_origin_and_versor(Point const &o, Point const &v) { + static Line from_origin_and_vector(Point const &o, Point const &v) { Line l(o, o + v); return l; } @@ -126,9 +126,12 @@ public: /// Get the line's origin point. Point origin() const { return _initial; } - /** @brief Get the line's direction vector. - * Note that the retrieved vector is not normalized to unit length. */ - Point versor() const { return _final - _initial; } + /** @brief Get the line's raw direction vector. + * The retrieved vector is normalized to unit length. */ + Point vector() const { return _final - _initial; } + /** @brief Get the line's normalized direction vector. + * The retrieved vector is normalized to unit length. */ + Point versor() const { return (_final - _initial).normalized(); } /// Angle the line makes with the X axis, in mathematical convention. Coord angle() const { Point d = _final - _initial; @@ -147,7 +150,7 @@ public: } /** @brief Set the speed of the line. * Origin remains unchanged. */ - void setVersor(Point const &v) { + void setVector(Point const &v) { _final = _initial + v; } @@ -239,7 +242,7 @@ public: * @return Time value corresponding to a point closest to @c p. */ Coord timeAtProjection(Point const& p) const { if ( isDegenerate() ) return 0; - Point v = versor(); + Point v = vector(); return dot(p - _initial, v) / dot(v, v); } @@ -284,22 +287,22 @@ public: boost::optional<LineSegment> clip(Rect const &r) const; /** @brief Create a ray starting at the specified time value. - * The created ray will go in the direction of the line's versor (in the direction + * The created ray will go in the direction of the line's vector (in the direction * of increasing time values). * @param t Time value where the ray should start - * @return Ray starting at t and going in the direction of the versor */ + * @return Ray starting at t and going in the direction of the vector */ Ray ray(Coord t) { Ray result; result.setOrigin(pointAt(t)); - result.setVersor(versor()); + result.setVector(vector()); return result; } /** @brief Create a derivative of the line. * The new line will always be degenerate. Its origin will be equal to this - * line's versor. */ + * line's vector. */ Line derivative() const { - Point v = versor(); + Point v = vector(); Line result(v, v); return result; } @@ -314,7 +317,7 @@ public: * If Y grows upwards, then this is the left normal. If Y grows downwards, * then this is the right normal. */ Point normal() const { - return rot90(versor()).normalized(); + return rot90(vector()).normalized(); } // what does this do? @@ -326,7 +329,7 @@ public: /// Compute an affine matrix representing a reflection about the line. Affine reflection() const { - Point v = versor().normalized(); + Point v = versor(); Coord x2 = v[X]*v[X], y2 = v[Y]*v[Y], xy = v[X]*v[Y]; Affine m(x2-y2, 2.*xy, 2.*xy, y2-x2, @@ -344,7 +347,7 @@ public: * lower precision than e.g. a shear transform. * @param d Which coordinate of points on the line should be zero after the transformation */ Affine rotationToZero(Dim2 d) const { - Point v = versor(); + Point v = vector(); if (d == X) { std::swap(v[X], v[Y]); } else { @@ -421,7 +424,7 @@ bool are_near(Point const &p, Line const &line, double eps = EPSILON) inline bool are_parallel(Line const &l1, Line const &l2, double eps = EPSILON) { - return are_near(cross(l1.versor(), l2.versor()), 0, eps); + return are_near(cross(l1.vector(), l2.vector()), 0, eps); } /** @brief Test whether two lines are approximately the same. @@ -442,7 +445,7 @@ bool are_same(Line const &l1, Line const &l2, double eps = EPSILON) inline bool are_orthogonal(Line const &l1, Line const &l2, double eps = EPSILON) { - return are_near(dot(l1.versor(), l2.versor()), 0, eps); + return are_near(dot(l1.vector(), l2.vector()), 0, eps); } // evaluate the angle between l1 and l2 rotating l1 in cw direction @@ -451,7 +454,7 @@ bool are_orthogonal(Line const &l1, Line const &l2, double eps = EPSILON) inline double angle_between(Line const& l1, Line const& l2) { - double angle = angle_between(l1.versor(), l2.versor()); + double angle = angle_between(l1.vector(), l2.vector()); if (angle < 0) angle += M_PI; if (angle == M_PI) angle = 0; return angle; @@ -474,7 +477,7 @@ bool are_near(Point const &p, LineSegment const &seg, double eps = EPSILON) inline Line make_orthogonal_line(Point const &p, Line const &line) { - Point d = line.versor().cw(); + Point d = line.vector().cw(); Line l(p, p + d); return l; } diff --git a/src/2geom/ray.h b/src/2geom/ray.h index a336e3132..4e60fd814 100644 --- a/src/2geom/ray.h +++ b/src/2geom/ray.h @@ -53,61 +53,62 @@ namespace Geom class Ray { private: Point _origin; - Point _versor; + Point _vector; public: - Ray() : _origin(0,0), _versor(1,0) {} + Ray() : _origin(0,0), _vector(1,0) {} Ray(Point const& origin, Coord angle) : _origin(origin) { - sincos(angle, _versor[Y], _versor[X]); + sincos(angle, _vector[Y], _vector[X]); } Ray(Point const& A, Point const& B) { setPoints(A, B); } Point origin() const { return _origin; } - Point versor() const { return _versor; } + Point vector() const { return _vector; } + Point versor() const { return _vector.normalized(); } void setOrigin(Point const &o) { _origin = o; } - void setVersor(Point const& v) { _versor = v; } - Coord angle() const { return std::atan2(_versor[Y], _versor[X]); } - void setAngle(Coord a) { sincos(a, _versor[Y], _versor[X]); } + void setVector(Point const& v) { _vector = v; } + Coord angle() const { return std::atan2(_vector[Y], _vector[X]); } + void setAngle(Coord a) { sincos(a, _vector[Y], _vector[X]); } void setPoints(Point const &a, Point const &b) { _origin = a; - _versor = b - a; - if (are_near(_versor, Point(0,0)) ) - _versor = Point(0,0); + _vector = b - a; + if (are_near(_vector, Point(0,0)) ) + _vector = Point(0,0); else - _versor.normalize(); + _vector.normalize(); } bool isDegenerate() const { - return ( _versor[X] == 0 && _versor[Y] == 0 ); + return ( _vector[X] == 0 && _vector[Y] == 0 ); } Point pointAt(Coord t) const { - return _origin + _versor * t; + return _origin + _vector * t; } Coord valueAt(Coord t, Dim2 d) const { - return _origin[d] + _versor[d] * t; + return _origin[d] + _vector[d] * t; } std::vector<Coord> roots(Coord v, Dim2 d) const { std::vector<Coord> result; - if ( _versor[d] != 0 ) { - double t = (v - _origin[d]) / _versor[d]; + if ( _vector[d] != 0 ) { + double t = (v - _origin[d]) / _vector[d]; if (t >= 0) result.push_back(t); - } else if (_versor[(d+1)%2] == v) { + } else if (_vector[(d+1)%2] == v) { THROW_INFINITESOLUTIONS(); } return result; } Coord nearestTime(Point const& point) const { if ( isDegenerate() ) return 0; - double t = dot(point - _origin, _versor); + double t = dot(point - _origin, _vector); if (t < 0) t = 0; return t; } Ray reverse() const { Ray result; result.setOrigin(_origin); - result.setVersor(-_versor); + result.setVector(-_vector); return result; } Curve *portion(Coord f, Coord t) const { @@ -117,7 +118,7 @@ public: return LineSegment(pointAt(f), pointAt(t)); } Ray transformed(Affine const& m) const { - return Ray(_origin * m, (_origin + _versor) * m); + return Ray(_origin * m, (_origin + _vector) * m); } }; // end class Ray @@ -134,7 +135,7 @@ bool are_near(Point const& _point, Ray const& _ray, double eps = EPSILON) { inline bool are_same(Ray const& r1, Ray const& r2, double eps = EPSILON) { - return are_near(r1.versor(), r2.versor(), eps) + return are_near(r1.vector(), r2.vector(), eps) && are_near(r1.origin(), r2.origin(), eps); } @@ -142,7 +143,7 @@ bool are_same(Ray const& r1, Ray const& r2, double eps = EPSILON) { // the returned value is an angle in the interval [0, 2PI[ inline double angle_between(Ray const& r1, Ray const& r2, bool cw = true) { - double angle = angle_between(r1.versor(), r2.versor()); + double angle = angle_between(r1.vector(), r2.vector()); if (angle < 0) angle += 2*M_PI; if (!cw) angle = 2*M_PI - angle; return angle; @@ -170,7 +171,7 @@ Ray make_angle_bisector_ray(Ray const& r1, Ray const& r2, bool cw = true) THROW_RANGEERROR("passed rays do not have the same origin"); } - Ray bisector(r1.origin(), r1.origin() + r1.versor() * Rotate(angle_between(r1, r2) / 2.0)); + Ray bisector(r1.origin(), r1.origin() + r1.vector() * Rotate(angle_between(r1, r2) / 2.0)); return (cw ? bisector : bisector.reverse()); } diff --git a/src/2geom/sweeper.h b/src/2geom/sweeper.h index b3c96455f..469108465 100644 --- a/src/2geom/sweeper.h +++ b/src/2geom/sweeper.h @@ -52,10 +52,10 @@ public: {} std::vector<Item> const &items() { return _items; } - Interval itemBounds(ItemIterator ii) { return Interval(); } + Interval itemBounds(ItemIterator /*ii*/) { return Interval(); } - void addActiveItem(ItemIterator ii) {} - void removeActiveItem(ItemIterator ii) {} + void addActiveItem(ItemIterator /*ii*/) {} + void removeActiveItem(ItemIterator /*ii*/) {} private: std::vector<Item> const &_items; @@ -104,9 +104,9 @@ public: } /** @brief Process entry and exit events. - * This will iterate over all inserted items, calling the virtual protected - * functions _enter() and _leave() according to the order of the boundaries - * of each item. */ + * This will iterate over all inserted items, calling the methods + * addActiveItem and removeActiveItem on the SweepSet passed at construction + * according to the order of the boundaries of each item. */ void process() { if (_set.items().empty()) return; diff --git a/src/2geom/utils.h b/src/2geom/utils.h index 3e0dd4717..01579d81b 100644 --- a/src/2geom/utils.h +++ b/src/2geom/utils.h @@ -68,7 +68,7 @@ struct NullIterator NullIterator() {} template <typename T> - void operator=(T const &v) {} + void operator=(T const &) {} }; /** @brief Get the next iterator in the container with wrap-around. diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index d43d000a7..9190fe633 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -296,14 +296,14 @@ static Avoid::Polygon avoid_item_poly(SPItem const *item) Geom::Line hull_edge(hull[-1], hull[0]); Geom::Line prev_parallel_hull_edge; prev_parallel_hull_edge.setOrigin(hull_edge.origin()+hull_edge.versor().ccw()*spacing); - prev_parallel_hull_edge.setVersor(hull_edge.versor()); + prev_parallel_hull_edge.setVector(hull_edge.versor()); int hull_size = hull.size(); for (int i = 0; i < hull_size; ++i) { hull_edge.setPoints(hull[i], hull[i+1]); Geom::Line parallel_hull_edge; parallel_hull_edge.setOrigin(hull_edge.origin()+hull_edge.versor().ccw()*spacing); - parallel_hull_edge.setVersor(hull_edge.versor()); + parallel_hull_edge.setVector(hull_edge.versor()); // determine the intersection point try { |
