1 #ifndef INKSCAPE_LPE_RULER_H
2 #define INKSCAPE_LPE_RULER_H
4 /** \file
5 * LPE <ruler> implementation, see lpe-ruler.cpp.
6 */
8 /*
9 * Authors:
10 * Maximilian Albert
11 * Johan Engelen
12 *
13 * Copyright (C) Maximilian Albert 2008 <maximilian.albert@gmail.com>
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include "live_effects/effect.h"
19 #include "live_effects/parameter/text.h"
20 #include "live_effects/parameter/enum.h"
21 #include "live_effects/parameter/bool.h"
22 #include "live_effects/parameter/unit.h"
24 namespace Inkscape {
25 namespace LivePathEffect {
27 enum MarkType {
28 MARK_MAJOR,
29 MARK_MINOR
30 };
32 enum MarkDirType {
33 MARKDIR_LEFT,
34 MARKDIR_RIGHT,
35 MARKDIR_BOTH,
36 };
38 enum BorderMarkType {
39 BORDERMARK_NONE,
40 BORDERMARK_START,
41 BORDERMARK_END,
42 BORDERMARK_BOTH,
43 };
45 class LPERuler : public Effect {
46 public:
47 LPERuler(LivePathEffectObject *lpeobject);
48 virtual ~LPERuler();
50 virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
52 private:
53 Geom::Piecewise<Geom::D2<Geom::SBasis> > ruler_mark(Geom::Point const &A, Geom::Point const &n, MarkType const &marktype);
55 ScalarParam mark_distance;
56 UnitParam unit;
57 ScalarParam mark_length;
58 ScalarParam minor_mark_length;
59 ScalarParam major_mark_steps;
60 ScalarParam shift;
61 EnumParam<MarkDirType> mark_dir;
62 ScalarParam offset;
63 EnumParam<BorderMarkType> border_marks;
65 static Geom::Point n_major, n_minor; // used for internal computations
67 LPERuler(const LPERuler&);
68 LPERuler& operator=(const LPERuler&);
69 };
71 } //namespace LivePathEffect
72 } //namespace Inkscape
74 #endif
76 /*
77 Local Variables:
78 mode:c++
79 c-file-style:"stroustrup"
80 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
81 indent-tabs-mode:nil
82 fill-column:99
83 End:
84 */
85 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :