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

« back to all changes in this revision

Viewing changes to src/snapped-line.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:
13
13
 
14
14
#include <vector>
15
15
#include <list>
16
 
#include "libnr/nr-coord.h"
17
 
#include "libnr/nr-point.h"
18
 
#include <libnr/nr-point-fns.h>
19
16
#include "snapped-point.h"
20
17
 
21
18
namespace Inkscape
26
23
{
27
24
public:
28
25
    SnappedLineSegment();
29
 
    SnappedLineSegment(NR::Point snapped_point, NR::Coord snapped_distance, NR::Coord snapped_tolerance, bool always_snap, NR::Point start_point_of_line, NR::Point end_point_of_line);
 
26
    SnappedLineSegment(Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, SnapTargetType const &target, Geom::Coord const &snapped_tolerance,bool const &always_snap, Geom::Point const &start_point_of_line, Geom::Point const &end_point_of_line);
30
27
    ~SnappedLineSegment();
31
28
    Inkscape::SnappedPoint intersect(SnappedLineSegment const &line) const; //intersect with another SnappedLineSegment
32
 
    
 
29
    Geom::LineSegment getLineSegment() const {return Geom::LineSegment(_start_point_of_line, _end_point_of_line);}
 
30
 
33
31
private:
34
 
    NR::Point _start_point_of_line;
35
 
    NR::Point _end_point_of_line;    
 
32
    Geom::Point _start_point_of_line;
 
33
    Geom::Point _end_point_of_line;
36
34
};
37
35
 
38
36
 
41
39
{
42
40
public:
43
41
    SnappedLine();
44
 
    SnappedLine(NR::Point snapped_point, NR::Coord snapped_distance, NR::Coord snapped_tolerance, bool always_snap, NR::Point normal_to_line, NR::Point point_on_line);
 
42
    SnappedLine(Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, SnapTargetType const &target, Geom::Coord const &snapped_tolerance, bool const &always_snap, Geom::Point const &normal_to_line, Geom::Point const &point_on_line);
45
43
    ~SnappedLine();
46
44
    Inkscape::SnappedPoint intersect(SnappedLine const &line) const; //intersect with another SnappedLine
47
45
    // This line is described by this equation:
48
46
    //        a*x + b*y = c  <->  nx*px + ny+py = c  <->  n.p = c
49
 
    NR::Point getNormal() const {return _normal_to_line;}                             // n = (nx, ny)
50
 
    NR::Point getPointOnLine() const {return _point_on_line;}                         // p = (px, py)
51
 
    NR::Coord getConstTerm() const {return dot(_normal_to_line, _point_on_line);}     // c = n.p = nx*px + ny*py;
52
 
    
 
47
    Geom::Point getNormal() const {return _normal_to_line;}                             // n = (nx, ny)
 
48
    Geom::Point getPointOnLine() const {return _point_on_line;}                         // p = (px, py)
 
49
    Geom::Coord getConstTerm() const {return dot(_normal_to_line, _point_on_line);}     // c = n.p = nx*px + ny*py;
 
50
    Geom::Line getLine() const {return Geom::Line(_point_on_line, _point_on_line + Geom::rot90(_normal_to_line));}
 
51
 
53
52
private:
54
 
    NR::Point _normal_to_line;
55
 
    NR::Point _point_on_line;    
 
53
    Geom::Point _normal_to_line;
 
54
    Geom::Point _point_on_line;
56
55
};
57
56
 
58
57
}
59
58
 
60
 
bool getClosestSLS(std::list<Inkscape::SnappedLineSegment> &list, Inkscape::SnappedLineSegment &result);
61
 
bool getClosestIntersectionSLS(std::list<Inkscape::SnappedLineSegment> &list, Inkscape::SnappedPoint &result);
62
 
bool getClosestSL(std::list<Inkscape::SnappedLine> &list, Inkscape::SnappedLine &result);
63
 
bool getClosestIntersectionSL(std::list<Inkscape::SnappedLine> &list, Inkscape::SnappedPoint &result);
64
 
bool getClosestIntersectionSL(std::list<Inkscape::SnappedLine> &list1, std::list<Inkscape::SnappedLine> &list2, Inkscape::SnappedPoint &result);
65
 
 
 
59
bool getClosestSLS(std::list<Inkscape::SnappedLineSegment> const &list, Inkscape::SnappedLineSegment &result);
 
60
bool getClosestIntersectionSLS(std::list<Inkscape::SnappedLineSegment> const &list, Inkscape::SnappedPoint &result);
 
61
bool getClosestSL(std::list<Inkscape::SnappedLine> const &list, Inkscape::SnappedLine &result);
 
62
bool getClosestIntersectionSL(std::list<Inkscape::SnappedLine> const &list, Inkscape::SnappedPoint &result);
 
63
bool getClosestIntersectionSL(std::list<Inkscape::SnappedLine> const &list1, std::list<Inkscape::SnappedLine> const &list2, Inkscape::SnappedPoint &result);
 
64
 
66
65
 
67
66
#endif /* !SEEN_SNAPPEDLINE_H */
68
67