summaryrefslogtreecommitdiffstats
path: root/src/snapped-curve.h
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-08-08 22:28:49 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-08-08 22:28:49 +0000
commitef22647ff7f24ab39aac0020f01187587364dae0 (patch)
treeeac1d153a371f342562f63b8f05ed3329b7a2421 /src/snapped-curve.h
parentfix marker behavior for moveto-only paths (diff)
downloadinkscape-ef22647ff7f24ab39aac0020f01187587364dae0.tar.gz
inkscape-ef22647ff7f24ab39aac0020f01187587364dae0.zip
Snap to intersections of any kind of path (were we previously only could snap to intersections of line-segments)
(bzr r6597)
Diffstat (limited to 'src/snapped-curve.h')
-rw-r--r--src/snapped-curve.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/snapped-curve.h b/src/snapped-curve.h
new file mode 100644
index 000000000..28908c42f
--- /dev/null
+++ b/src/snapped-curve.h
@@ -0,0 +1,55 @@
+#ifndef SEEN_SNAPPEDCURVE_H
+#define SEEN_SNAPPEDCURVE_H
+
+/**
+ * \file src/snapped-curve.h
+ * \brief SnappedCurve class.
+ *
+ * Authors:
+ * Diederik van Lierop <mail@diedenrezi.nl>
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information.
+ */
+
+#include <vector>
+#include <list>
+#include "libnr/nr-coord.h"
+#include "libnr/nr-point.h"
+#include <libnr/nr-point-fns.h>
+#include "snapped-point.h"
+#include <2geom/forward.h>
+
+namespace Inkscape
+{
+
+/// Class describing the result of an attempt to snap to a curve.
+class SnappedCurve : public SnappedPoint
+{
+public:
+ SnappedCurve();
+ SnappedCurve(NR::Point const &snapped_point, NR::Coord const &snapped_distance, NR::Coord const &snapped_tolerance, bool const &always_snap, Geom::Curve const *curve);
+ ~SnappedCurve();
+ Inkscape::SnappedPoint intersect(SnappedCurve const &curve, NR::Point const &p) const; //intersect with another SnappedCurve
+
+private:
+ Geom::Curve const *_curve;
+};
+
+}
+
+bool getClosestCurve(std::list<Inkscape::SnappedCurve> const &list, Inkscape::SnappedCurve &result);
+bool getClosestIntersectionCS(std::list<Inkscape::SnappedCurve> const &list, NR::Point const &p, Inkscape::SnappedPoint &result);
+
+
+#endif /* !SEEN_SNAPPEDCURVE_H */
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :