diff --git a/src/line-snapper.h b/src/line-snapper.h
index 7767fe2ea5a0f25a4fbc87313ca3399b086e9c4c..4ad08a99f95fe1f73ab8dbeb739569a32caadd23 100644 (file)
--- a/src/line-snapper.h
+++ b/src/line-snapper.h
*
* Authors:
* Carl Hetherington <inkscape@carlh.net>
+ * Diederik van Lierop <mail@diedenrezi.nl>
+ *
+ * Copyright (C) 1999-2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information.
*/
class LineSnapper : public Snapper
{
public:
- LineSnapper(SnapManager const *sm, Geom::Coord const d);
+ LineSnapper(SnapManager *sm, Geom::Coord const d);
void freeSnap(SnappedConstraints &sc,
- Inkscape::Snapper::PointType const &t,
+ Inkscape::SnapPreferences::PointType const &t,
Geom::Point const &p,
+ SnapSourceType const &source_type,
bool const &first_point,
- boost::optional<Geom::Rect> const &bbox_to_snap,
+ Geom::OptRect const &bbox_to_snap,
std::vector<SPItem const *> const *it,
- std::vector<Geom::Point> *unselected_nodes) const;
-
+ std::vector<std::pair<Geom::Point, int> > *unselected_nodes) const;
+
void constrainedSnap(SnappedConstraints &sc,
- Inkscape::Snapper::PointType const &t,
+ Inkscape::SnapPreferences::PointType const &t,
Geom::Point const &p,
+ SnapSourceType const &source_type,
bool const &first_point,
- boost::optional<Geom::Rect> const &bbox_to_snap,
+ Geom::OptRect const &bbox_to_snap,
ConstraintLine const &c,
std::vector<SPItem const *> const *it) const;
protected:
- typedef std::list<std::pair<Geom::Point, Geom::Point> > LineList;
+ typedef std::list<std::pair<Geom::Point, Geom::Point> > LineList;
//first point is a vector normal to the line
//second point is a point on the line
* \return List of lines that we should try snapping to.
*/
virtual LineList _getSnapLines(Geom::Point const &p) const = 0;
-
- virtual void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, Geom::Point const normal_to_line, Geom::Point const point_on_line) const = 0;
+
+ 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;
+
+ // Will only be implemented for guide lines, because grid lines don't have an origin
+ virtual void _addSnappedLinesOrigin(SnappedConstraints &sc, Geom::Point const origin, Geom::Coord const snapped_distance, SnapSourceType const &source) const;
+
+ virtual void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source) const = 0;
};
}