~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/line-snapper.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *
8
8
 *    Authors:
9
9
 *      Carl Hetherington <inkscape@carlh.net>
 
10
 *              Diederik van Lierop <mail@diedenrezi.nl>
 
11
 *
 
12
 *        Copyright (C) 1999-2008 Authors
10
13
 *
11
14
 *    Released under GNU GPL, read the file 'COPYING' for more information.
12
15
 */
19
22
class LineSnapper : public Snapper
20
23
{
21
24
public:
22
 
  LineSnapper(SPNamedView const *nv, NR::Coord const d);
 
25
  LineSnapper(SnapManager *sm, Geom::Coord const d);
 
26
 
 
27
  void freeSnap(SnappedConstraints &sc,
 
28
                   Inkscape::SnapPreferences::PointType const &t,
 
29
                   Geom::Point const &p,
 
30
                   SnapSourceType const &source_type,
 
31
                   bool const &first_point,
 
32
                   Geom::OptRect const &bbox_to_snap,
 
33
                   std::vector<SPItem const *> const *it,
 
34
                   std::vector<std::pair<Geom::Point, int> > *unselected_nodes) const;
 
35
 
 
36
  void constrainedSnap(SnappedConstraints &sc,
 
37
                          Inkscape::SnapPreferences::PointType const &t,
 
38
                          Geom::Point const &p,
 
39
                          SnapSourceType const &source_type,
 
40
                          bool const &first_point,
 
41
                          Geom::OptRect const &bbox_to_snap,
 
42
                          ConstraintLine const &c,
 
43
                          std::vector<SPItem const *> const *it) const;
23
44
 
24
45
protected:
25
 
  typedef std::list<std::pair<NR::Point, NR::Point> > LineList; 
 
46
  typedef std::list<std::pair<Geom::Point, Geom::Point> > LineList;
26
47
  //first point is a vector normal to the line
27
48
  //second point is a point on the line
28
49
 
29
50
private:
30
 
  void _doFreeSnap(SnappedConstraints &sc,
31
 
                   Inkscape::Snapper::PointType const &t,
32
 
                   NR::Point const &p,
33
 
                   bool const &first_point,
34
 
                   std::vector<NR::Point> &points_to_snap,
35
 
                   std::list<SPItem const *> const &it) const;
36
 
  
37
 
  void _doConstrainedSnap(SnappedConstraints &sc,
38
 
                          Inkscape::Snapper::PointType const &t,
39
 
                          NR::Point const &p,
40
 
                          bool const &first_point,
41
 
                          std::vector<NR::Point> &points_to_snap,
42
 
                          ConstraintLine const &c,
43
 
                          std::list<SPItem const *> const &it) const;
44
 
  
45
51
  /**
46
52
   *  \param p Point that we are trying to snap.
47
53
   *  \return List of lines that we should try snapping to.
48
54
   */
49
 
  virtual LineList _getSnapLines(NR::Point const &p) const = 0;
50
 
  
51
 
  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;
 
55
  virtual LineList _getSnapLines(Geom::Point const &p) const = 0;
 
56
 
 
57
  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;
 
58
  virtual void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source) const = 0;
52
59
};
53
60
 
54
61
}