19
22
class LineSnapper : public Snapper
22
LineSnapper(SPNamedView const *nv, NR::Coord const d);
25
LineSnapper(SnapManager *sm, Geom::Coord const d);
27
void freeSnap(SnappedConstraints &sc,
28
Inkscape::SnapPreferences::PointType const &t,
30
SnapSourceType const &source_type,
31
bool const &first_point,
32
Geom::OptRect const &bbox_to_snap,
33
std::vector<SPItem const *> const *it,
34
std::vector<std::pair<Geom::Point, int> > *unselected_nodes) const;
36
void constrainedSnap(SnappedConstraints &sc,
37
Inkscape::SnapPreferences::PointType const &t,
39
SnapSourceType const &source_type,
40
bool const &first_point,
41
Geom::OptRect const &bbox_to_snap,
42
ConstraintLine const &c,
43
std::vector<SPItem const *> const *it) const;
25
typedef std::list<std::pair<NR::Point, NR::Point> > LineList;
46
typedef std::list<std::pair<Geom::Point, Geom::Point> > LineList;
26
47
//first point is a vector normal to the line
27
48
//second point is a point on the line
30
void _doFreeSnap(SnappedConstraints &sc,
31
Inkscape::Snapper::PointType const &t,
33
bool const &first_point,
34
std::vector<NR::Point> &points_to_snap,
35
std::list<SPItem const *> const &it) const;
37
void _doConstrainedSnap(SnappedConstraints &sc,
38
Inkscape::Snapper::PointType const &t,
40
bool const &first_point,
41
std::vector<NR::Point> &points_to_snap,
42
ConstraintLine const &c,
43
std::list<SPItem const *> const &it) const;
46
52
* \param p Point that we are trying to snap.
47
53
* \return List of lines that we should try snapping to.
49
virtual LineList _getSnapLines(NR::Point const &p) const = 0;
51
virtual void _addSnappedLine(SnappedConstraints &sc, NR::Point const snapped_point, NR::Coord const snapped_distance, NR::Point const normal_to_line, NR::Point const point_on_line) const = 0;
55
virtual LineList _getSnapLines(Geom::Point const &p) const = 0;
57
virtual void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, Geom::Point const normal_to_line, Geom::Point const point_on_line) const = 0;
58
virtual void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source) const = 0;