summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-10-03 03:44:17 +0000
committerJon A. Cruz <jon@joncruz.org>2011-10-03 03:44:17 +0000
commit20097d47e6945bceb57d2335d23fe764f493ab59 (patch)
tree47a1f62624d42e0302c2c370c1c23b2670e814ed /src/snap.cpp
parentNext pass of doxygen @brief cleanup. (diff)
downloadinkscape-20097d47e6945bceb57d2335d23fe764f493ab59.tar.gz
inkscape-20097d47e6945bceb57d2335d23fe764f493ab59.zip
Another minor pass of Doxygen cleanup.
(bzr r10659)
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp264
1 files changed, 120 insertions, 144 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index b2c5a5a10..fb6f120ec 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -1,8 +1,6 @@
-#define __SP_DESKTOP_SNAP_C__
-
/**
* \file snap.cpp
- * \brief SnapManager class.
+ * SnapManager class.
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
@@ -58,7 +56,7 @@ SnapManager::SnapManager(SPNamedView const *v) :
}
/**
- * \brief Return a list of snappers
+ * Return a list of snappers.
*
* Inkscape snaps to objects, grids, and guides. For each of these snap targets a
* separate class is used, which has been derived from the base Snapper class. The
@@ -67,10 +65,9 @@ SnapManager::SnapManager(SPNamedView const *v) :
* class, but any number of grid snappers (because each grid has its own snapper
* instance)
*
- * \return List of snappers that we use.
+ * @return List of snappers that we use.
*/
-SnapManager::SnapperList
-SnapManager::getSnappers() const
+SnapManager::SnapperList SnapManager::getSnappers() const
{
SnapManager::SnapperList s;
s.push_back(&guide);
@@ -83,17 +80,16 @@ SnapManager::getSnappers() const
}
/**
- * \brief Return a list of gridsnappers
+ * Return a list of gridsnappers.
*
* Each grid has its own instance of the snapper class. This way snapping can
* be enabled per grid individually. A list will be returned containing the
* pointers to these instances, but only for grids that are being displayed
* and for which snapping is enabled.
*
- * \return List of gridsnappers that we use.
+ * @return List of gridsnappers that we use.
*/
-SnapManager::SnapperList
-SnapManager::getGridSnappers() const
+SnapManager::SnapperList SnapManager::getGridSnappers() const
{
SnapperList s;
@@ -108,14 +104,14 @@ SnapManager::getGridSnappers() const
}
/**
- * \brief Return true if any snapping might occur, whether its to grids, guides or objects
+ * Return true if any snapping might occur, whether its to grids, guides or objects.
*
* Each snapper instance handles its own snapping target, e.g. grids, guides or
* objects. This method iterates through all these snapper instances and returns
* true if any of the snappers might possible snap, considering only the relevant
* snapping preferences.
*
- * \return true if one of the snappers will try to snap to something.
+ * @return true if one of the snappers will try to snap to something.
*/
bool SnapManager::someSnapperMightSnap() const
@@ -153,7 +149,7 @@ bool SnapManager::gridSnapperMightSnap() const
}
/**
- * \brief Try to snap a point to grids, guides or objects.
+ * Try to snap a point to grids, guides or objects.
*
* Try to snap a point to grids, guides or objects, in two degrees-of-freedom,
* i.e. snap in any direction on the two dimensional canvas to the nearest
@@ -172,11 +168,10 @@ bool SnapManager::gridSnapperMightSnap() const
* 2) Only to be used when a single source point is to be snapped; it assumes
* that source_num = 0, which is inefficient when snapping sets our source points
*
- * \param p Current position of the snap source; will be overwritten by the position of the snap target if snapping has occurred
- * \param source_type Detailed description of the source type, will be used by the snap indicator
- * \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
+ * @param p Current position of the snap source; will be overwritten by the position of the snap target if snapping has occurred
+ * @param source_type Detailed description of the source type, will be used by the snap indicator
+ * @param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
*/
-
void SnapManager::freeSnapReturnByRef(Geom::Point &p,
Inkscape::SnapSourceType const source_type,
Geom::OptRect const &bbox_to_snap) const
@@ -187,7 +182,7 @@ void SnapManager::freeSnapReturnByRef(Geom::Point &p,
/**
- * \brief Try to snap a point to grids, guides or objects.
+ * Try to snap a point to grids, guides or objects.
*
* Try to snap a point to grids, guides or objects, in two degrees-of-freedom,
* i.e. snap in any direction on the two dimensional canvas to the nearest
@@ -197,12 +192,10 @@ void SnapManager::freeSnapReturnByRef(Geom::Point &p,
* PS: SnapManager::setup() must have been called before calling this method,
* but only once for a set of points
*
- * \param p Source point to be snapped
- * \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics
+ * @param p Source point to be snapped
+ * @param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics
*/
-
-
Inkscape::SnappedPoint SnapManager::freeSnap(Inkscape::SnapCandidatePoint const &p,
Geom::OptRect const &bbox_to_snap) const
{
@@ -238,7 +231,7 @@ void SnapManager::preSnap(Inkscape::SnapCandidatePoint const &p)
}
/**
- * \brief Snap to the closest multiple of a grid pitch
+ * Snap to the closest multiple of a grid pitch.
*
* When pasting, we would like to snap to the grid. Problem is that we don't know which
* nodes were aligned to the grid at the time of copying, so we don't know which nodes
@@ -252,10 +245,9 @@ void SnapManager::preSnap(Inkscape::SnapCandidatePoint const &p)
* PS2: When multiple grids are present then the result will become ambiguous. There is no
* way to control to which grid this method will snap.
*
- * \param t Vector that represents the offset of the pasted copy with respect to the original
- * \return Offset vector after snapping to the closest multiple of a grid pitch
+ * @param t Vector that represents the offset of the pasted copy with respect to the original
+ * @return Offset vector after snapping to the closest multiple of a grid pitch
*/
-
Geom::Point SnapManager::multipleOfGridPitch(Geom::Point const &t, Geom::Point const &origin)
{
if (!snapprefs.getSnapEnabledGlobally() || snapprefs.getSnapPostponedGlobally())
@@ -312,7 +304,7 @@ Geom::Point SnapManager::multipleOfGridPitch(Geom::Point const &t, Geom::Point c
}
/**
- * \brief Try to snap a point along a constraint line to grids, guides or objects.
+ * Try to snap a point along a constraint line to grids, guides or objects.
*
* Try to snap a point to grids, guides or objects, in only one degree-of-freedom,
* i.e. snap in a specific direction on the two dimensional canvas to the nearest
@@ -335,12 +327,11 @@ Geom::Point SnapManager::multipleOfGridPitch(Geom::Point const &t, Geom::Point c
* that source_num = 0, which is inefficient when snapping sets our source points
*
- * \param p Current position of the snap source; will be overwritten by the position of the snap target if snapping has occurred
- * \param source_type Detailed description of the source type, will be used by the snap indicator
- * \param constraint The direction or line along which snapping must occur
- * \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
+ * @param p Current position of the snap source; will be overwritten by the position of the snap target if snapping has occurred
+ * @param source_type Detailed description of the source type, will be used by the snap indicator
+ * @param constraint The direction or line along which snapping must occur
+ * @param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
*/
-
void SnapManager::constrainedSnapReturnByRef(Geom::Point &p,
Inkscape::SnapSourceType const source_type,
Inkscape::Snapper::SnapConstraint const &constraint,
@@ -351,7 +342,7 @@ void SnapManager::constrainedSnapReturnByRef(Geom::Point &p,
}
/**
- * \brief Try to snap a point along a constraint line to grids, guides or objects.
+ * Try to snap a point along a constraint line to grids, guides or objects.
*
* Try to snap a point to grids, guides or objects, in only one degree-of-freedom,
* i.e. snap in a specific direction on the two dimensional canvas to the nearest
@@ -363,11 +354,10 @@ void SnapManager::constrainedSnapReturnByRef(Geom::Point &p,
* PS: If there's nothing to snap to or if snapping has been disabled, then this
* method will still apply the constraint (but without snapping)
*
- * \param p Source point to be snapped
- * \param constraint The direction or line along which snapping must occur
- * \param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
+ * @param p Source point to be snapped
+ * @param constraint The direction or line along which snapping must occur
+ * @param bbox_to_snap Bounding box hulling the set of points, all from the same selection and having the same transformation
*/
-
Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::SnapCandidatePoint const &p,
Inkscape::Snapper::SnapConstraint const &constraint,
Geom::OptRect const &bbox_to_snap) const
@@ -512,18 +502,17 @@ Inkscape::SnappedPoint SnapManager::multipleConstrainedSnaps(Inkscape::SnapCandi
}
/**
- * \brief Try to snap a point to something at a specific angle
+ * Try to snap a point to something at a specific angle.
*
* When drawing a straight line or modifying a gradient, it will snap to specific angle increments
* if CTRL is being pressed. This method will enforce this angular constraint (even if there is nothing
* to snap to)
*
- * \param p Source point to be snapped
- * \param p_ref Optional original point, relative to which the angle should be calculated. If empty then
+ * @param p Source point to be snapped
+ * @param p_ref Optional original point, relative to which the angle should be calculated. If empty then
* the angle will be calculated relative to the y-axis
- * \param snaps Number of angular increments per PI radians; E.g. if snaps = 2 then we will snap every PI/2 = 90 degrees
+ * @param snaps Number of angular increments per PI radians; E.g. if snaps = 2 then we will snap every PI/2 = 90 degrees
*/
-
Inkscape::SnappedPoint SnapManager::constrainedAngularSnap(Inkscape::SnapCandidatePoint const &p,
boost::optional<Geom::Point> const &p_ref,
Geom::Point const &o,
@@ -561,12 +550,12 @@ Inkscape::SnappedPoint SnapManager::constrainedAngularSnap(Inkscape::SnapCandida
}
/**
- * \brief Wrapper method to make snapping of the guide origin a bit easier (i.e. simplifies the calling code)
+ * Wrapper method to make snapping of the guide origin a bit easier (i.e. simplifies the calling code).
*
* PS: SnapManager::setup() must have been called before calling this method,
*
- * \param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred
- * \param guide_normal Vector normal to the guide line
+ * @param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred
+ * @param guide_normal Vector normal to the guide line
*/
void SnapManager::guideFreeSnap(Geom::Point &p, Geom::Point const &/*guide_normal*/, SPGuideDragType drag_type) const
{
@@ -591,14 +580,13 @@ void SnapManager::guideFreeSnap(Geom::Point &p, Geom::Point const &/*guide_norma
}
/**
- * \brief Wrapper method to make snapping of the guide origin a bit easier (i.e. simplifies the calling code)
+ * Wrapper method to make snapping of the guide origin a bit easier (i.e. simplifies the calling code).
*
* PS: SnapManager::setup() must have been called before calling this method,
*
- * \param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred
- * \param guide_normal Vector normal to the guide line
+ * @param p Current position of the point on the guide that is to be snapped; will be overwritten by the position of the snap target if snapping has occurred
+ * @param guide_normal Vector normal to the guide line
*/
-
void SnapManager::guideConstrainedSnap(Geom::Point &p, SPGuide const &guideline) const
{
if (!snapprefs.getSnapEnabledGlobally() || snapprefs.getSnapPostponedGlobally() || !snapprefs.isTargetSnappable(Inkscape::SNAPTARGET_GUIDE)) {
@@ -620,7 +608,7 @@ void SnapManager::guideConstrainedSnap(Geom::Point &p, SPGuide const &guideline)
}
/**
- * \brief Method for snapping sets of points while they are being transformed
+ * Method for snapping sets of points while they are being transformed.
*
* Method for snapping sets of points while they are being transformed, when using
* for example the selector tool. This method is for internal use only, and should
@@ -634,18 +622,17 @@ void SnapManager::guideConstrainedSnap(Geom::Point &p, SPGuide const &guideline)
* If no snap has occurred and we're asked for a constrained snap then the constraint
* will be applied nevertheless
*
- * \param points Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param constrained true if the snap is constrained, e.g. for stretching or for purely horizontal translation.
- * \param constraint The direction or line along which snapping must occur, if 'constrained' is true; otherwise undefined.
- * \param transformation_type Type of transformation to apply to points before trying to snap them.
- * \param transformation Description of the transformation; details depend on the type.
- * \param origin Origin of the transformation, if applicable.
- * \param dim Dimension to which the transformation applies, if applicable.
- * \param uniform true if the transformation should be uniform; only applicable for stretching and scaling.
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param points Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param constrained true if the snap is constrained, e.g. for stretching or for purely horizontal translation.
+ * @param constraint The direction or line along which snapping must occur, if 'constrained' is true; otherwise undefined.
+ * @param transformation_type Type of transformation to apply to points before trying to snap them.
+ * @param transformation Description of the transformation; details depend on the type.
+ * @param origin Origin of the transformation, if applicable.
+ * @param dim Dimension to which the transformation applies, if applicable.
+ * @param uniform true if the transformation should be uniform; only applicable for stretching and scaling.
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::_snapTransformed(
std::vector<Inkscape::SnapCandidatePoint> const &points,
Geom::Point const &pointer,
@@ -937,14 +924,13 @@ Inkscape::SnappedPoint SnapManager::_snapTransformed(
/**
- * \brief Apply a translation to a set of points and try to snap freely in 2 degrees-of-freedom
+ * Apply a translation to a set of points and try to snap freely in 2 degrees-of-freedom.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param tr Proposed translation; the final translation can only be calculated after snapping has occurred
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param tr Proposed translation; the final translation can only be calculated after snapping has occurred
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::freeSnapTranslate(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Geom::Point const &tr)
@@ -959,15 +945,14 @@ Inkscape::SnappedPoint SnapManager::freeSnapTranslate(std::vector<Inkscape::Snap
}
/**
- * \brief Apply a translation to a set of points and try to snap along a constraint
+ * Apply a translation to a set of points and try to snap along a constraint.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param constraint The direction or line along which snapping must occur.
- * \param tr Proposed translation; the final translation can only be calculated after snapping has occurred.
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param constraint The direction or line along which snapping must occur.
+ * @param tr Proposed translation; the final translation can only be calculated after snapping has occurred.
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::constrainedSnapTranslate(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Inkscape::Snapper::SnapConstraint const &constraint,
@@ -984,15 +969,14 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapTranslate(std::vector<Inkscap
/**
- * \brief Apply a scaling to a set of points and try to snap freely in 2 degrees-of-freedom
+ * Apply a scaling to a set of points and try to snap freely in 2 degrees-of-freedom.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param s Proposed scaling; the final scaling can only be calculated after snapping has occurred
- * \param o Origin of the scaling
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param s Proposed scaling; the final scaling can only be calculated after snapping has occurred
+ * @param o Origin of the scaling
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::freeSnapScale(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Geom::Scale const &s,
@@ -1009,15 +993,14 @@ Inkscape::SnappedPoint SnapManager::freeSnapScale(std::vector<Inkscape::SnapCand
/**
- * \brief Apply a scaling to a set of points and snap such that the aspect ratio of the selection is preserved
+ * Apply a scaling to a set of points and snap such that the aspect ratio of the selection is preserved.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param s Proposed scaling; the final scaling can only be calculated after snapping has occurred
- * \param o Origin of the scaling
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param s Proposed scaling; the final scaling can only be calculated after snapping has occurred
+ * @param o Origin of the scaling
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::constrainedSnapScale(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Geom::Scale const &s,
@@ -1034,17 +1017,16 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapScale(std::vector<Inkscape::S
}
/**
- * \brief Apply a stretch to a set of points and snap such that the direction of the stretch is preserved
+ * Apply a stretch to a set of points and snap such that the direction of the stretch is preserved.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param s Proposed stretch; the final stretch can only be calculated after snapping has occurred
- * \param o Origin of the stretching
- * \param d Dimension in which to apply proposed stretch.
- * \param u true if the stretch should be uniform (i.e. to be applied equally in both dimensions)
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param s Proposed stretch; the final stretch can only be calculated after snapping has occurred
+ * @param o Origin of the stretching
+ * @param d Dimension in which to apply proposed stretch.
+ * @param u true if the stretch should be uniform (i.e. to be applied equally in both dimensions)
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::constrainedSnapStretch(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Geom::Coord const &s,
@@ -1062,17 +1044,16 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapStretch(std::vector<Inkscape:
}
/**
- * \brief Apply a skew to a set of points and snap such that the direction of the skew is preserved
+ * Apply a skew to a set of points and snap such that the direction of the skew is preserved.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param constraint The direction or line along which snapping must occur.
- * \param s Proposed skew; the final skew can only be calculated after snapping has occurred
- * \param o Origin of the proposed skew
- * \param d Dimension in which to apply proposed skew.
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param constraint The direction or line along which snapping must occur.
+ * @param s Proposed skew; the final skew can only be calculated after snapping has occurred
+ * @param o Origin of the proposed skew
+ * @param d Dimension in which to apply proposed skew.
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::constrainedSnapSkew(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Inkscape::Snapper::SnapConstraint const &constraint,
@@ -1101,15 +1082,14 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapSkew(std::vector<Inkscape::Sn
}
/**
- * \brief Apply a rotation to a set of points and snap, without scaling
+ * Apply a rotation to a set of points and snap, without scaling.
*
- * \param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
- * \param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
- * \param angle Proposed rotation (in radians); the final rotation can only be calculated after snapping has occurred
- * \param o Origin of the rotation
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
+ * @param p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
+ * @param pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
+ * @param angle Proposed rotation (in radians); the final rotation can only be calculated after snapping has occurred
+ * @param o Origin of the rotation
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.
*/
-
Inkscape::SnappedPoint SnapManager::constrainedSnapRotate(std::vector<Inkscape::SnapCandidatePoint> const &p,
Geom::Point const &pointer,
Geom::Coord const &angle,
@@ -1132,16 +1112,15 @@ Inkscape::SnappedPoint SnapManager::constrainedSnapRotate(std::vector<Inkscape::
}
/**
- * \brief Given a set of possible snap targets, find the best target (which is not necessarily
- * also the nearest target), and show the snap indicator if requested
+ * Given a set of possible snap targets, find the best target (which is not necessarily
+ * also the nearest target), and show the snap indicator if requested.
*
- * \param p Source point to be snapped
- * \param isr A structure holding all snap targets that have been found so far
- * \param constrained True if the snap is constrained, e.g. for stretching or for purely horizontal translation.
- * \param allowOffScreen If true, then snapping to points which are off the screen is allowed (needed for example when pasting to the grid)
- * \return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics
+ * @param p Source point to be snapped
+ * @param isr A structure holding all snap targets that have been found so far
+ * @param constrained True if the snap is constrained, e.g. for stretching or for purely horizontal translation.
+ * @param allowOffScreen If true, then snapping to points which are off the screen is allowed (needed for example when pasting to the grid)
+ * @return An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics
*/
-
Inkscape::SnappedPoint SnapManager::findBestSnap(Inkscape::SnapCandidatePoint const &p,
IntermSnapResults const &isr,
bool constrained,
@@ -1291,21 +1270,20 @@ void SnapManager::setup(SPDesktop const *desktop,
}
/**
- * \brief Prepare the snap manager for the actual snapping, which includes building a list of snap targets
- * to ignore and toggling the snap indicator
+ * Prepare the snap manager for the actual snapping, which includes building a list of snap targets
+ * to ignore and toggling the snap indicator.
*
* There are two overloaded setup() methods, of which the other one only allows for a single item to be ignored
* whereas this one will take a list of items to ignore
*
- * \param desktop Reference to the desktop to which this snap manager is attached
- * \param snapindicator If true then a snap indicator will be displayed automatically (when enabled in the preferences)
- * \param items_to_ignore These items will not be snapped to, e.g. the items that are currently being dragged. This avoids "self-snapping"
- * \param unselected_nodes Stationary nodes of the path that is currently being edited in the node tool and
+ * @param desktop Reference to the desktop to which this snap manager is attached
+ * @param snapindicator If true then a snap indicator will be displayed automatically (when enabled in the preferences)
+ * @param items_to_ignore These items will not be snapped to, e.g. the items that are currently being dragged. This avoids "self-snapping"
+ * @param unselected_nodes Stationary nodes of the path that is currently being edited in the node tool and
* that can be snapped too. Nodes not in this list will not be snapped to, to avoid "self-snapping". Of each
* unselected node both the position (Geom::Point) and the type (Inkscape::SnapTargetType) will be stored
- * \param guide_to_ignore Guide that is currently being dragged and should not be snapped to
+ * @param guide_to_ignore Guide that is currently being dragged and should not be snapped to
*/
-
void SnapManager::setup(SPDesktop const *desktop,
bool snapindicator,
std::vector<SPItem const *> &items_to_ignore,
@@ -1355,17 +1333,16 @@ SPDocument *SnapManager::getDocument() const
}
/**
- * \brief Takes an untransformed point, applies the given transformation, and returns the transformed point. Eliminates lots of duplicated code
+ * Takes an untransformed point, applies the given transformation, and returns the transformed point. Eliminates lots of duplicated code.
*
- * \param p The untransformed position of the point, paired with an identifier of the type of the snap source.
- * \param transformation_type Type of transformation to apply.
- * \param transformation Mathematical description of the transformation; details depend on the type.
- * \param origin Origin of the transformation, if applicable.
- * \param dim Dimension to which the transformation applies, if applicable.
- * \param uniform true if the transformation should be uniform; only applicable for stretching and scaling.
- * \return The position of the point after transformation
+ * @param p The untransformed position of the point, paired with an identifier of the type of the snap source.
+ * @param transformation_type Type of transformation to apply.
+ * @param transformation Mathematical description of the transformation; details depend on the type.
+ * @param origin Origin of the transformation, if applicable.
+ * @param dim Dimension to which the transformation applies, if applicable.
+ * @param uniform true if the transformation should be uniform; only applicable for stretching and scaling.
+ * @return The position of the point after transformation
*/
-
Geom::Point SnapManager::_transformPoint(Inkscape::SnapCandidatePoint const &p,
Transformation const transformation_type,
Geom::Point const &transformation,
@@ -1413,12 +1390,11 @@ Geom::Point SnapManager::_transformPoint(Inkscape::SnapCandidatePoint const &p,
}
/**
- * \brief Mark the location of the snap source (not the snap target!) on the canvas by drawing a symbol
+ * Mark the location of the snap source (not the snap target!) on the canvas by drawing a symbol.
*
- * \param point_type Category of points to which the source point belongs: node, guide or bounding box
- * \param p The transformed position of the source point, paired with an identifier of the type of the snap source.
+ * @param point_type Category of points to which the source point belongs: node, guide or bounding box
+ * @param p The transformed position of the source point, paired with an identifier of the type of the snap source.
*/
-
void SnapManager::_displaySnapsource(Inkscape::SnapCandidatePoint const &p) const {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();