Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / live_effects / lpe-ruler.h
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"
23 namespace Inkscape {
24 namespace LivePathEffect {
26 enum MarkType {
27     MARK_MAJOR,
28     MARK_MINOR
29 };
31 enum MarkDirType {
32     MARKDIR_LEFT,
33     MARKDIR_RIGHT,
34     MARKDIR_BOTH,
35 };
37 enum BorderMarkType {
38     BORDERMARK_NONE,
39     BORDERMARK_START,
40     BORDERMARK_END,
41     BORDERMARK_BOTH,
42 };
44 class LPERuler : public Effect {
45 public:
46     LPERuler(LivePathEffectObject *lpeobject);
47     virtual ~LPERuler();
49     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
51 private:
52     Geom::Piecewise<Geom::D2<Geom::SBasis> > ruler_mark(Geom::Point const &A, Geom::Point const &n, MarkType const &marktype);
54     ScalarParam mark_distance;
55     ScalarParam mark_length;
56     ScalarParam minor_mark_length;
57     ScalarParam major_mark_steps;
58     ScalarParam shift;
59     EnumParam<MarkDirType> mark_dir;
60     ScalarParam offset;
61     EnumParam<BorderMarkType> border_marks;
63     static Geom::Point n_major, n_minor; // used for internal computations
65     LPERuler(const LPERuler&);
66     LPERuler& operator=(const LPERuler&);
67 };
69 } //namespace LivePathEffect
70 } //namespace Inkscape
72 #endif
74 /*
75   Local Variables:
76   mode:c++
77   c-file-style:"stroustrup"
78   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
79   indent-tabs-mode:nil
80   fill-column:99
81   End:
82 */
83 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :