X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fline-snapper.h;h=cdc45c286bce947b2cb86904c88f7095025702db;hb=6aba22359627ef015ee03b85e4b7b5b98684b834;hp=e5fc95dcba82c4950744dbd9832fd915bc54b021;hpb=c3d71eeb981927093e5a6284277181d1d6b83985;p=inkscape.git diff --git a/src/line-snapper.h b/src/line-snapper.h index e5fc95dcb..cdc45c286 100644 --- a/src/line-snapper.h +++ b/src/line-snapper.h @@ -7,6 +7,9 @@ * * Authors: * Carl Hetherington + * Diederik van Lierop + * + * Copyright (C) 1999-2008 Authors * * Released under GNU GPL, read the file 'COPYING' for more information. */ @@ -15,30 +18,28 @@ namespace Inkscape { +class SnapCandidatePoint; class LineSnapper : public Snapper { public: - LineSnapper(SPNamedView const *nv, NR::Coord const d); + LineSnapper(SnapManager *sm, Geom::Coord const d); void freeSnap(SnappedConstraints &sc, - Inkscape::Snapper::PointType const &t, - NR::Point const &p, - bool const &first_point, - NR::Maybe const &bbox_to_snap, + Inkscape::SnapCandidatePoint const &p, + 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::Snapper::PointType const &t, - NR::Point const &p, - bool const &first_point, - NR::Maybe const &bbox_to_snap, - ConstraintLine const &c, - std::vector const *it) const; + Inkscape::SnapCandidatePoint const &p, + Geom::OptRect const &bbox_to_snap, + SnapConstraint const &c, + std::vector const *it, + std::vector *unselected_nodes) 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 @@ -47,9 +48,14 @@ private: * \param p Point that we are trying to snap. * \return List of lines that we should try snapping to. */ - virtual LineList _getSnapLines(NR::Point const &p) const = 0; - - 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; + virtual LineList _getSnapLines(Geom::Point const &p) const = 0; + + virtual void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, 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, long source_num, bool constrained_snap) const; + + virtual void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const = 0; }; }