1 #ifndef SEEN_SNAPPEDCURVE_H
2 #define SEEN_SNAPPEDCURVE_H
4 /**
5 * \file src/snapped-curve.h
6 * \brief SnappedCurve class.
7 *
8 * Authors:
9 * Diederik van Lierop <mail@diedenrezi.nl>
10 *
11 * Released under GNU GPL, read the file 'COPYING' for more information.
12 */
14 #include <vector>
15 #include <list>
16 #include "snapped-point.h"
17 #include <2geom/forward.h>
19 namespace Inkscape
20 {
22 /// Class describing the result of an attempt to snap to a curve.
23 class SnappedCurve : public SnappedPoint
24 {
25 public:
26 SnappedCurve();
27 SnappedCurve(Geom::Point const &snapped_point, int num_path, int num_segm, Geom::Coord const &snapped_distance, Geom::Coord const &snapped_tolerance, bool const &always_snap, bool const &fully_constrained, Geom::Curve const *curve, SnapSourceType source, long source_num, SnapTargetType target, Geom::OptRect target_bbox);
28 ~SnappedCurve();
29 Inkscape::SnappedPoint intersect(SnappedCurve const &curve, Geom::Point const &p, Geom::Matrix dt2doc) const; //intersect with another SnappedCurve
31 private:
32 Geom::Curve const *_curve;
33 int _num_path; // Unique id of the path to which this segment belongs too
34 int _num_segm; // Sequence number of this segment in the path
35 };
37 }
39 bool getClosestCurve(std::list<Inkscape::SnappedCurve> const &list, Inkscape::SnappedCurve &result);
40 bool getClosestIntersectionCS(std::list<Inkscape::SnappedCurve> const &list, Geom::Point const &p, Inkscape::SnappedPoint &result, Geom::Matrix dt2doc);
43 #endif /* !SEEN_SNAPPEDCURVE_H */
45 /*
46 Local Variables:
47 mode:c++
48 c-file-style:"stroustrup"
49 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
50 indent-tabs-mode:nil
51 fill-column:99
52 End:
53 */
54 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :