Code

fixed another typo
[inkscape.git] / src / live_effects / lpe-test-doEffect-stack.cpp
1 #define INKSCAPE_LPE_DOEFFECT_STACK_CPP
3 /*
4  * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
5  *
6  * Released under GNU GPL, read the file 'COPYING' for more information
7  */
9 #include "live_effects/lpe-test-doEffect-stack.h"
11 #include <2geom/piecewise.h>
12 #include <vector>
13 #include <libnr/n-art-bpath.h>
14 #include <cstring>
15 using std::memcpy;
17 namespace Inkscape {
18 namespace LivePathEffect {
21 LPEdoEffectStackTest::LPEdoEffectStackTest(LivePathEffectObject *lpeobject) :
22     Effect(lpeobject),
23     step(_("Stack step"), ("How deep we should go into the stack"), "step", &wr, this),
24     point(_("point param"), "tooltip of point parameter", "point_param", &wr, this)
25 {
26     registerParameter( dynamic_cast<Parameter *>(&step) );
27     registerParameter( dynamic_cast<Parameter *>(&point) );
29     point.set_oncanvas_looks(SP_KNOT_SHAPE_SQUARE, SP_KNOT_MODE_XOR, 0x00ff0000);
30 }
32 LPEdoEffectStackTest::~LPEdoEffectStackTest()
33 {
35 }
37 void
38 LPEdoEffectStackTest::doEffect (SPCurve * curve)
39 {
40     if (step >= 1) {
41         Effect::doEffect(curve);
42     } else {
43         // return here
44         return;
45     }
46 }
48 std::vector<Geom::Path>
49 LPEdoEffectStackTest::doEffect_path (std::vector<Geom::Path> const & path_in)
50 {
51     if (step >= 2) {
52         return Effect::doEffect_path(path_in);
53     } else {
54         // return here
55         std::vector<Geom::Path> path_out = path_in;
56         return path_out;
57     }
58 }
60 Geom::Piecewise<Geom::D2<Geom::SBasis> > 
61 LPEdoEffectStackTest::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
62 {
63     Geom::Piecewise<Geom::D2<Geom::SBasis> > output = pwd2_in;
65     return output;
66 }
69 } // namespace LivePathEffect
70 } /* namespace Inkscape */
72 /*
73   Local Variables:
74   mode:c++
75   c-file-style:"stroustrup"
76   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
77   indent-tabs-mode:nil
78   fill-column:99
79   End:
80 */
81 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :