Code

Pot and Dutch translation update
[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 <cstring>
14 using std::memcpy;
16 namespace Inkscape {
17 namespace LivePathEffect {
20 LPEdoEffectStackTest::LPEdoEffectStackTest(LivePathEffectObject *lpeobject) :
21     Effect(lpeobject),
22     step(_("Stack step"), ("How deep we should go into the stack"), "step", &wr, this),
23     point(_("point param"), "tooltip of point parameter", "point_param", &wr, this),
24     path(_("path param"), "tooltip of path parameter", "path_param", &wr, this,"M 0,100 100,0")
25 {
26     registerParameter( dynamic_cast<Parameter *>(&step) );
27     registerParameter( dynamic_cast<Parameter *>(&point) );
28     registerParameter( dynamic_cast<Parameter *>(&path) );
30     point.set_oncanvas_looks(SP_KNOT_SHAPE_SQUARE, SP_KNOT_MODE_XOR, 0x00ff0000);
31 }
33 LPEdoEffectStackTest::~LPEdoEffectStackTest()
34 {
36 }
38 void
39 LPEdoEffectStackTest::doEffect (SPCurve * curve)
40 {
41     if (step >= 1) {
42         Effect::doEffect(curve);
43     } else {
44         // return here
45         return;
46     }
47 }
49 std::vector<Geom::Path>
50 LPEdoEffectStackTest::doEffect_path (std::vector<Geom::Path> const & path_in)
51 {
52     if (step >= 2) {
53         return Effect::doEffect_path(path_in);
54     } else {
55         // return here
56         std::vector<Geom::Path> path_out = path_in;
57         return path_out;
58     }
59 }
61 Geom::Piecewise<Geom::D2<Geom::SBasis> > 
62 LPEdoEffectStackTest::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
63 {
64     Geom::Piecewise<Geom::D2<Geom::SBasis> > output = pwd2_in;
66     return output;
67 }
70 } // namespace LivePathEffect
71 } /* namespace Inkscape */
73 /*
74   Local Variables:
75   mode:c++
76   c-file-style:"stroustrup"
77   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
78   indent-tabs-mode:nil
79   fill-column:99
80   End:
81 */
82 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :