From 59259f0cabfa0205acc3229c281169e8406570b3 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 2 Sep 2011 22:14:29 +0200 Subject: Rename the struct "SnappedConstraints" to the more meaningfull "IntermSnapResults" (bzr r10612) --- src/line-snapper.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index 22a964d43..d2f1193ff 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -21,7 +21,7 @@ Inkscape::LineSnapper::LineSnapper(SnapManager *sm, Geom::Coord const d) : Snapp { } -void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc, +void Inkscape::LineSnapper::freeSnap(IntermSnapResults &isr, Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &/*bbox_to_snap*/, std::vector const */*it*/, @@ -44,13 +44,13 @@ void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc, Geom::Coord const dist = Geom::L2(p_proj - p.getPoint()); //Store any line that's within snapping range if (dist < getSnapperTolerance()) { - _addSnappedLine(sc, p_proj, dist, p.getSourceType(), p.getSourceNum(), i->first, i->second); + _addSnappedLine(isr, p_proj, dist, p.getSourceType(), p.getSourceNum(), i->first, i->second); // For any line that's within range, we will also look at it's "point on line" p1. For guides // this point coincides with its origin; for grids this is of no use, but we cannot // discern between grids and guides here Geom::Coord const dist_p1 = Geom::L2(p1 - p.getPoint()); if (dist_p1 < getSnapperTolerance()) { - _addSnappedLinesOrigin(sc, p1, dist_p1, p.getSourceType(), p.getSourceNum(), false); + _addSnappedLinesOrigin(isr, p1, dist_p1, p.getSourceType(), p.getSourceNum(), false); // Only relevant for guides; grids don't have an origin per line // Therefore _addSnappedLinesOrigin() will only be implemented for guides } @@ -60,7 +60,7 @@ void Inkscape::LineSnapper::freeSnap(SnappedConstraints &sc, } } -void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, +void Inkscape::LineSnapper::constrainedSnap(IntermSnapResults &isr, Inkscape::SnapCandidatePoint const &p, Geom::OptRect const &/*bbox_to_snap*/, SnapConstraint const &c, @@ -91,7 +91,7 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, Geom::Coord radius = c.getRadius(); if (dist == radius) { // Only one point of intersection; - _addSnappedPoint(sc, p_proj, Geom::L2(pp - p_proj), p.getSourceType(), p.getSourceNum(), true); + _addSnappedPoint(isr, p_proj, Geom::L2(pp - p_proj), p.getSourceType(), p.getSourceNum(), true); } else if (dist < radius) { // Two points of intersection, symmetrical with respect to the projected point // Calculate half the length of the linesegment between the two points of intersection @@ -99,8 +99,8 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, Geom::Coord d = Geom::L2(gridguide_line.versor()); // length of versor, needed to normalize the versor if (d > 0) { Geom::Point v = l*gridguide_line.versor()/d; - _addSnappedPoint(sc, p_proj + v, Geom::L2(p.getPoint() - (p_proj + v)), p.getSourceType(), p.getSourceNum(), true); - _addSnappedPoint(sc, p_proj - v, Geom::L2(p.getPoint() - (p_proj - v)), p.getSourceType(), p.getSourceNum(), true); + _addSnappedPoint(isr, p_proj + v, Geom::L2(p.getPoint() - (p_proj + v)), p.getSourceType(), p.getSourceNum(), true); + _addSnappedPoint(isr, p_proj - v, Geom::L2(p.getPoint() - (p_proj - v)), p.getSourceType(), p.getSourceNum(), true); } } } else { @@ -125,7 +125,7 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, // This snappoint is therefore fully constrained, so there's no need // to look for additional intersections; just return the snapped point // and forget about the line - _addSnappedPoint(sc, t, dist, p.getSourceType(), p.getSourceNum(), true); + _addSnappedPoint(isr, t, dist, p.getSourceType(), p.getSourceNum(), true); } } } @@ -134,7 +134,7 @@ void Inkscape::LineSnapper::constrainedSnap(SnappedConstraints &sc, // Will only be overridden in the guide-snapper class, because grid lines don't have an origin; the // grid-snapper classes will use this default empty method -void Inkscape::LineSnapper::_addSnappedLinesOrigin(SnappedConstraints &/*sc*/, Geom::Point const /*origin*/, Geom::Coord const /*snapped_distance*/, SnapSourceType const &/*source_type*/, long /*source_num*/, bool /*constrained_snap*/) const +void Inkscape::LineSnapper::_addSnappedLinesOrigin(IntermSnapResults &/*isr*/, Geom::Point const /*origin*/, Geom::Coord const /*snapped_distance*/, SnapSourceType const &/*source_type*/, long /*source_num*/, bool /*constrained_snap*/) const { } -- cgit v1.2.3 From 20097d47e6945bceb57d2335d23fe764f493ab59 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 2 Oct 2011 20:44:17 -0700 Subject: Another minor pass of Doxygen cleanup. (bzr r10659) --- src/line-snapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index d2f1193ff..66bc8c530 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -1,6 +1,6 @@ /** * \file line-snapper.cpp - * \brief LineSnapper class. + * LineSnapper class. * * Authors: * Diederik van Lierop -- cgit v1.2.3 From 48acbc6ed82b18fb07aa5e7964f7702428bade73 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Tue, 18 Oct 2011 07:54:57 +0200 Subject: cppcheck (bzr r10681) --- src/line-snapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index 66bc8c530..45b03c38b 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -34,7 +34,7 @@ void Inkscape::LineSnapper::freeSnap(IntermSnapResults &isr, /* Get the lines that we will try to snap to */ const LineList lines = _getSnapLines(p.getPoint()); - for (LineList::const_iterator i = lines.begin(); i != lines.end(); i++) { + for (LineList::const_iterator i = lines.begin(); i != lines.end(); ++i) { Geom::Point const p1 = i->second; // point at guide/grid line Geom::Point const p2 = p1 + Geom::rot90(i->first); // 2nd point at guide/grid line // std::cout << " line through " << i->second << " with normal " << i->first; @@ -78,7 +78,7 @@ void Inkscape::LineSnapper::constrainedSnap(IntermSnapResults &isr, /* Get the lines that we will try to snap to */ const LineList lines = _getSnapLines(pp); - for (LineList::const_iterator i = lines.begin(); i != lines.end(); i++) { + for (LineList::const_iterator i = lines.begin(); i != lines.end(); ++i) { Geom::Point const point_on_line = c.hasPoint() ? c.getPoint() : pp; Geom::Line gridguide_line(i->second, i->second + Geom::rot90(i->first)); -- cgit v1.2.3 From 2633767789e4264b13ef91a684accf734fb4e94f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 26 Oct 2011 21:55:51 -0700 Subject: Fixing more broken and split doc comments. (bzr r10697) --- src/line-snapper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index 45b03c38b..6a50e8485 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -1,5 +1,4 @@ -/** - * \file line-snapper.cpp +/* * LineSnapper class. * * Authors: -- cgit v1.2.3 From 8f1c271f1e1d226061e9fe63faa40cefdd1dcd81 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 18 Dec 2011 13:45:52 +0100 Subject: Refactor snap-preferences a bit more (bzr r10780) --- src/line-snapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/line-snapper.cpp') diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp index 6a50e8485..3fb503354 100644 --- a/src/line-snapper.cpp +++ b/src/line-snapper.cpp @@ -26,7 +26,7 @@ void Inkscape::LineSnapper::freeSnap(IntermSnapResults &isr, std::vector const */*it*/, std::vector */*unselected_nodes*/) const { - if (!(_snap_enabled && _snapmanager->snapprefs.getSnapFrom(p.getSourceType())) ) { + if (!(_snap_enabled && _snapmanager->snapprefs.isSourceSnappable(p.getSourceType())) ) { return; } @@ -67,7 +67,7 @@ void Inkscape::LineSnapper::constrainedSnap(IntermSnapResults &isr, std::vector */*unselected_nodes*/) const { - if (_snap_enabled == false || _snapmanager->snapprefs.getSnapFrom(p.getSourceType()) == false) { + if (_snap_enabled == false || _snapmanager->snapprefs.isSourceSnappable(p.getSourceType()) == false) { return; } -- cgit v1.2.3