Code

Win32 post-GSoC fixups.
[inkscape.git] / src / live_effects / lpe-skeleton.cpp
1 #define INKSCAPE_LPE_SKELETON_CPP
2 /** \file
3  * @brief Minimal dummy LPE effect implementation, used as an example for a base
4  * starting class when implementing new LivePathEffects.
5  *
6  * In vi, three global search-and-replaces will let you rename everything
7  * in this and the .h file:
8  *
9  *   :%s/SKELETON/YOURNAME/g
10  *   :%s/Skeleton/Yourname/g
11  *   :%s/skeleton/yourname/g
12  */
13 /* Authors:
14  *   Johan Engelen <j.b.c.engelen@utwente.nl>
15  *
16  * Copyright (C) 2007 Authors
17  *
18  * Released under GNU GPL, read the file 'COPYING' for more information
19  */
21 #include "live_effects/lpe-skeleton.h"
23 // You might need to include other 2geom files. You can add them here:
24 #include <2geom/path.h>
26 namespace Inkscape {
27 namespace LivePathEffect {
29 LPESkeleton::LPESkeleton(LivePathEffectObject *lpeobject) :
30     Effect(lpeobject),
31     // initialise your parameters here:
32     number(_("Float parameter"), _("just a real number like 1.4!"), "svgname", &wr, this, 1.2)
33 {
34     /* uncomment the following line to have the original path displayed while the item is selected */
35     //show_orig_path = true;
37     /* register all your parameters here, so Inkscape knows which parameters this effect has: */
38     registerParameter( dynamic_cast<Parameter *>(&number) );
40     /* register all your knotholder handles here: */
41     //registerKnotHolderHandle(new Skeleton::KnotHolderEntityAttachMyHandle(), _("help message"));
42 }
44 LPESkeleton::~LPESkeleton()
45 {
47 }
50 /* ########################
51  *  Choose to implement one of the doEffect functions. You can delete or comment out the others.
52  */
54 /*
55 void
56 LPESkeleton::doEffect (SPCurve * curve)
57 {
58     // spice this up to make the effect actually *do* something!
59 }
61 std::vector<Geom::Path>
62 LPESkeleton::doEffect_path (std::vector<Geom::Path> const & path_in)
63 {
64         std::vector<Geom::Path> path_out;
66         path_out = path_in;   // spice this up to make the effect actually *do* something!
68         return path_out;
69 }
70 */
72 Geom::Piecewise<Geom::D2<Geom::SBasis> >
73 LPESkeleton::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
74 {
75     Geom::Piecewise<Geom::D2<Geom::SBasis> > output;
77     output = pwd2_in;   // spice this up to make the effect actually *do* something!
79     return output;
80 }
82 /* ########################
83  *  Define the classes for your knotholder handles here
84  */
86 /*
87 namespace Skeleton {
89 class KnotHolderEntityMyHandle : public LPEKnotHolderEntity
90 {
91 public:
92     // the set() and get() methods must be implemented, click() is optional
93     virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
94     virtual Geom::Point knot_get();
95     //virtual void knot_click(guint state);
96 };
98 } // namespace Skeleton
99 */
101 /* ######################## */
103 } //namespace LivePathEffect
104 } /* namespace Inkscape */
106 /*
107   Local Variables:
108   mode:c++
109   c-file-style:"stroustrup"
110   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
111   indent-tabs-mode:nil
112   fill-column:99
113   End:
114 */
115 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :