1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef SEEN_GUIDE_SNAPPER_H
3 #define SEEN_GUIDE_SNAPPER_H
4 /*
5  * Authors:
6  *   Lauris Kaplinski <lauris@kaplinski.com>
7  *   Frank Felfe <innerspace@iname.com>
8  *   Carl Hetherington <inkscape@carlh.net>
9  *
10  * Copyright (C) 1999-2002 Authors
11  *
12  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
13  */
14 
15 #include "line-snapper.h"
16 
17 class SPNamedView;
18 
19 namespace Inkscape
20 {
21 
22 /**
23  * Snap to guides.
24  */
25 class GuideSnapper : public LineSnapper
26 {
27 public:
28     GuideSnapper(SnapManager *sm, Geom::Coord const d);
29     bool ThisSnapperMightSnap() const override;
30 
31     Geom::Coord getSnapperTolerance() const override; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom)
32     bool getSnapperAlwaysSnap() const override; //if true, then the snapper will always snap, regardless of its tolerance
33 
34 private:
35     LineList _getSnapLines(Geom::Point const &p) const override;
36     void _addSnappedLine(IntermSnapResults &isr, 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 override;
37     void _addSnappedLinesOrigin(IntermSnapResults &isr, Geom::Point const &origin, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override;
38     void _addSnappedLinePerpendicularly(IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override;
39     void _addSnappedPoint(IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override;
40 };
41 
42 }
43 
44 #endif
45 
46 
47 
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 :
58