~danieljabailey/inkscape/arc_node_editor

« back to all changes in this revision

Viewing changes to src/sp-hatch-path.h

  • Committer: scislac
  • Date: 2009-08-12 07:57:52 UTC
  • Revision ID: scislac@users.sourceforge.net-20090812075752-3zt99jgeqr3bm16j
much better quality multi-size windows icon, thanks ChrisMorgan

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * @file
3
 
 * SVG <hatchPath> implementation
4
 
 */
5
 
/*
6
 
 * Author:
7
 
 *   Tomasz Boczkowski <penginsbacon@gmail.com>
8
 
 *   Jon A. Cruz <jon@joncruz.org>
9
 
 *
10
 
 * Copyright (C) 2014 Tomasz Boczkowski
11
 
 *
12
 
 * Released under GNU GPL, read the file 'COPYING' for more information
13
 
 */
14
 
 
15
 
#ifndef SEEN_SP_HATCH_PATH_H
16
 
#define SEEN_SP_HATCH_PATH_H
17
 
 
18
 
#include <list>
19
 
#include <stddef.h>
20
 
#include <glibmm/ustring.h>
21
 
#include <sigc++/connection.h>
22
 
 
23
 
#include "svg/svg-length.h"
24
 
 
25
 
namespace Inkscape {
26
 
 
27
 
class Drawing;
28
 
class DrawingShape;
29
 
 
30
 
}
31
 
 
32
 
class SPHatchPath : public SPObject {
33
 
public:
34
 
    SPHatchPath();
35
 
    virtual ~SPHatchPath();
36
 
 
37
 
    SVGLength offset;
38
 
 
39
 
    void setCurve(SPCurve *curve, bool owner);
40
 
 
41
 
    bool isValid() const;
42
 
 
43
 
    Inkscape::DrawingItem *show(Inkscape::Drawing &drawing, unsigned int key, Geom::OptInterval extents);
44
 
    void hide(unsigned int key);
45
 
 
46
 
    void setStripExtents(unsigned int key, Geom::OptInterval const &extents);
47
 
    Geom::Interval bounds() const;
48
 
 
49
 
    SPCurve *calculateRenderCurve(unsigned key) const;
50
 
 
51
 
protected:
52
 
    virtual void build(SPDocument* doc, Inkscape::XML::Node* repr);
53
 
    virtual void release();
54
 
    virtual void set(unsigned int key, const gchar* value);
55
 
    virtual void update(SPCtx* ctx, unsigned int flags);
56
 
 
57
 
private:
58
 
    class View {
59
 
    public:
60
 
        View(Inkscape::DrawingShape *arenaitem, int key);
61
 
        //Do not delete arenaitem in destructor.
62
 
 
63
 
        ~View();
64
 
 
65
 
        Inkscape::DrawingShape *arenaitem;
66
 
        Geom::OptInterval extents;
67
 
        unsigned int key;
68
 
    };
69
 
 
70
 
    typedef std::list<SPHatchPath::View>::iterator ViewIterator;
71
 
    typedef std::list<SPHatchPath::View>::const_iterator ConstViewIterator;
72
 
    std::list<View> _display;
73
 
 
74
 
    gdouble _repeatLength() const;
75
 
    void _updateView(View &view);
76
 
    SPCurve *_calculateRenderCurve(View const &view) const;
77
 
 
78
 
    void _readHatchPathVector(char const *str, Geom::PathVector &pathv, bool &continous_join);
79
 
 
80
 
    SPCurve *_curve;
81
 
    bool _continuous;
82
 
};
83
 
 
84
 
#endif // SEEN_SP_HATCH_PATH_H
85
 
 
86
 
/*
87
 
  Local Variables:
88
 
  mode:c++
89
 
  c-file-style:"stroustrup"
90
 
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
91
 
  indent-tabs-mode:nil
92
 
  fill-column:99
93
 
  End:
94
 
*/
95
 
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :