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

« back to all changes in this revision

Viewing changes to src/libnr/n-art-bpath.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:
1
 
#ifndef SEEN_LIBNR_N_ART_BPATH_H
2
 
#define SEEN_LIBNR_N_ART_BPATH_H
3
 
 
4
 
/** \file
5
 
 * NArtBpath: old-style path segment.
6
 
 */
7
 
 
8
 
#include <stdlib.h>
9
 
 
10
 
#include "libnr/nr-point.h"
11
 
#include "libnr/nr-path-code.h"
12
 
#include <cstdlib>
13
 
 
14
 
/**
15
 
 * Old-style path segment.
16
 
 *
17
 
 * Arrays of paths segment start with a MOVETO or MOVETO_OPEN segment
18
 
 * where the former indicates the beginning of a closed subpath.
19
 
 * \see subpath_from_bpath()
20
 
 */
21
 
class NArtBpath {
22
 
public:
23
 
    NRPathcode code; ///< Type of segment
24
 
    double x1, y1;   ///< Position of control point in case of NR_CURVETO
25
 
    double x2, y2;   ///< Position of control point in case of NR_CURVETO
26
 
    double x3, y3;   ///< Position of next point
27
 
 
28
 
    /// Convert i-th position data pair to Point object
29
 
    /// \pre 1 <= i <= 3
30
 
    NR::Point c(unsigned const i) const {
31
 
        switch (i) {
32
 
            case 1: return NR::Point(x1, y1);
33
 
            case 2: return NR::Point(x2, y2);
34
 
            case 3: return NR::Point(x3, y3);
35
 
            default: std::abort();
36
 
        }
37
 
    }
38
 
 
39
 
    /// Set i-th position data pair from Point
40
 
    /// \pre 1 <= i <= 3
41
 
    void setC(unsigned const i, NR::Point const &p) {
42
 
        using NR::X; using NR::Y;
43
 
        switch (i) {
44
 
            case 1: x1 = p[X]; y1 = p[Y]; break;
45
 
            case 2: x2 = p[X]; y2 = p[Y]; break;
46
 
            case 3: x3 = p[X]; y3 = p[Y]; break;
47
 
            default: std::abort();
48
 
        }
49
 
    }
50
 
};
51
 
 
52
 
 
53
 
#endif /* !SEEN_LIBNR_N_ART_BPATH_H */
54
 
 
55
 
/*
56
 
  Local Variables:
57
 
  mode:c++
58
 
  c-file-style:"stroustrup"
59
 
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
60
 
  indent-tabs-mode:nil
61
 
  fill-column:99
62
 
  End:
63
 
*/
64
 
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :