1 #ifndef SEEN_GUIDE_SNAPPER_H
2 #define SEEN_GUIDE_SNAPPER_H
4 /**
5 * \file guide-snapper.h
6 * \brief Snapping things to guides.
7 *
8 * Authors:
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 * Frank Felfe <innerspace@iname.com>
11 * Carl Hetherington <inkscape@carlh.net>
12 *
13 * Copyright (C) 1999-2002 Authors
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include "line-snapper.h"
20 struct SPNamedView;
22 namespace Inkscape
23 {
25 /// Snap to guides
26 class GuideSnapper : public LineSnapper
27 {
28 public:
29 GuideSnapper(SnapManager *sm, Geom::Coord const d);
30 bool ThisSnapperMightSnap() const;
32 Geom::Coord getSnapperTolerance() const; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom)
33 bool getSnapperAlwaysSnap() const; //if true, then the snapper will always snap, regardless of its tolerance
35 private:
36 LineList _getSnapLines(Geom::Point const &p) const;
37 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;
38 void _addSnappedLinesOrigin(SnappedConstraints &sc, Geom::Point const origin, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const;
39 void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const;
40 };
42 }
44 #endif
48 /*
49 Local Variables:
50 mode:c++
51 c-file-style:"stroustrup"
52 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
53 indent-tabs-mode:nil
54 fill-column:99
55 End:
56 */
57 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :