summaryrefslogtreecommitdiffstats
path: root/src/snapped-point.h
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-05-04 16:27:08 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-05-04 16:27:08 +0000
commit8dffa3e5ef1f8c53211bfa9e45aa5c2bcd589b3f (patch)
tree09e3531c7e1db43a75fc912bb95aa5ed35fa87fc /src/snapped-point.h
parentRemove warnings (diff)
downloadinkscape-8dffa3e5ef1f8c53211bfa9e45aa5c2bcd589b3f.tar.gz
inkscape-8dffa3e5ef1f8c53211bfa9e45aa5c2bcd589b3f.zip
Next steps in implementing the snapping indicator
(bzr r5600)
Diffstat (limited to 'src/snapped-point.h')
-rw-r--r--src/snapped-point.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/snapped-point.h b/src/snapped-point.h
index 309e322a6..372031955 100644
--- a/src/snapped-point.h
+++ b/src/snapped-point.h
@@ -20,18 +20,34 @@
namespace Inkscape
{
+
+enum SnapTargetType {
+ SNAPTARGET_UNDEFINED,
+ SNAPTARGET_GRID,
+ SNAPTARGET_GRID_INTERSECTION,
+ SNAPTARGET_GUIDE,
+ SNAPTARGET_GUIDE_INTERSECTION,
+ SNAPTARGET_GRID_GUIDE_INTERSECTION,
+ SNAPTARGET_NODE,
+ SNAPTARGET_PATH,
+ SNAPTARGET_PATH_INTERSECTION,
+ SNAPTARGET_BBOX_CORNER,
+ SNAPTARGET_BBOX_EDGE,
+ SNAPTARGET_GRADIENT
+};
/// Class describing the result of an attempt to snap.
class SnappedPoint
{
+
public:
SnappedPoint();
- SnappedPoint(NR::Point p, NR::Coord d, NR::Coord t, bool a, bool at_intersection, NR::Coord d2, NR::Coord t2, bool a2);
- SnappedPoint(NR::Point p, NR::Coord d, NR::Coord t, bool a);
+ SnappedPoint(NR::Point const &p, SnapTargetType const &target, NR::Coord const &d, NR::Coord const &t, bool const &a, bool const &at_intersection, NR::Coord const &d2, NR::Coord const &t2, bool const &a2);
+ SnappedPoint(NR::Point const &p, SnapTargetType const &target, NR::Coord const &d, NR::Coord const &t, bool const &a);
~SnappedPoint();
NR::Coord getDistance() const;
- void setDistance(NR::Coord d) {_distance = d;}
+ void setDistance(NR::Coord const d) {_distance = d;}
NR::Coord getTolerance() const;
bool getAlwaysSnap() const;
NR::Coord getSecondDistance() const;
@@ -41,10 +57,13 @@ public:
bool getAtIntersection() const {return _at_intersection;}
bool getSnapped() const {return _distance < NR_HUGE;}
NR::Point getTransformation() const {return _transformation;}
- void setTransformation(NR::Point t) {_transformation = t;}
+ void setTransformation(NR::Point const t) {_transformation = t;}
+ void setTarget(SnapTargetType const target) {_target = target;}
+ SnapTargetType getTarget() {return _target;}
protected:
NR::Point _point; // Location of the snapped point
+ SnapTargetType _target; // Describes to what we've snapped to
bool _at_intersection; // If true, the snapped point is at an intersection
/* Distance from original point to snapped point. If the snapped point is at