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

« back to all changes in this revision

Viewing changes to src/2geom/svg-path.cpp

  • 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:
28
28
 *
29
29
 */
30
30
 
31
 
#include "sbasis-to-bezier.h"
32
 
#include "svg-path.h"
 
31
#include <2geom/sbasis-to-bezier.h>
 
32
#include <2geom/svg-path.h>
 
33
#include <2geom/exception.h>
33
34
 
34
35
namespace Geom {
35
36
 
36
37
void output(Curve const &curve, SVGPathSink &sink) {
37
 
    std::vector<Point> pts = sbasis_to_bezier(curve.toSBasis(), 2); //TODO: use something better!
 
38
    std::vector<Point> pts;
 
39
    sbasis_to_bezier(pts, curve.toSBasis(), 2); //TODO: use something better!
38
40
    sink.curveTo(pts[0], pts[1], pts[2]);
39
41
}
40
42
 
 
43
void output(HLineSegment const &curve, SVGPathSink &sink) {
 
44
    sink.hlineTo(curve.finalPoint()[X]);
 
45
}
 
46
 
 
47
void output(VLineSegment const &curve, SVGPathSink &sink) {
 
48
    sink.vlineTo(curve.finalPoint()[Y]);
 
49
}
 
50
 
41
51
void output(LineSegment const &curve, SVGPathSink &sink) {
42
52
    sink.lineTo(curve[1]);
43
53
}
51
61
}
52
62
 
53
63
void output(SVGEllipticalArc const &curve, SVGPathSink &sink) {
54
 
    // FIXME
 
64
    sink.arcTo( curve.ray(X), curve.ray(Y), curve.rotation_angle(),
 
65
                        curve.large_arc_flag(), curve.sweep_flag(),
 
66
                        curve.finalPoint() );
55
67
}
56
68
 
57
69
template <typename T>
70
82
 
71
83
    Path::iterator iter;
72
84
    for ( iter = path.begin() ; iter != path.end() ; ++iter ) {
 
85
        output_as<HLineSegment>(*iter, sink) ||
 
86
        output_as<VLineSegment>(*iter, sink) ||
73
87
        output_as<LineSegment>(*iter, sink) ||
74
88
        output_as<CubicBezier>(*iter, sink) ||
75
89
        output_as<QuadraticBezier>(*iter, sink) ||