X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=src%2Fline-snapper.h;h=4ad08a99f95fe1f73ab8dbeb739569a32caadd23;hb=0974913b991ec9600541134006189f7851352d68;hp=593e8bd73fcf58f2b6ea659da22f85bc0d97d247;hpb=e9b6af083e34e2397a8ddbe9781920733d09d151;p=inkscape.git diff --git a/src/line-snapper.h b/src/line-snapper.h index 593e8bd73..4ad08a99f 100644 --- a/src/line-snapper.h +++ b/src/line-snapper.h @@ -7,8 +7,8 @@ * * Authors: * Carl Hetherington - * Diederik van Lierop - * + * Diederik van Lierop + * * Copyright (C) 1999-2008 Authors * * Released under GNU GPL, read the file 'COPYING' for more information. @@ -22,26 +22,28 @@ namespace Inkscape 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::SnapPreferences::PointType const &t, Geom::Point const &p, + SnapSourceType const &source_type, bool const &first_point, - boost::optional const &bbox_to_snap, + Geom::OptRect const &bbox_to_snap, std::vector const *it, - std::vector *unselected_nodes) const; - + std::vector > *unselected_nodes) const; + void constrainedSnap(SnappedConstraints &sc, Inkscape::SnapPreferences::PointType const &t, Geom::Point const &p, + SnapSourceType const &source_type, bool const &first_point, - boost::optional const &bbox_to_snap, + Geom::OptRect const &bbox_to_snap, ConstraintLine const &c, std::vector const *it) const; protected: - typedef std::list > LineList; + typedef std::list > LineList; //first point is a vector normal to the line //second point is a point on the line @@ -51,8 +53,13 @@ private: * \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; }; }