1 #ifndef INKSCAPE_LPE_VONKOCH_H
2 #define INKSCAPE_LPE_VONKOCH_H
4 /*
5 * Inkscape::LPEVonKoch
6 *
7 * Copyright (C) JF Barraud 2007 <jf.barraud@gmail.com>
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #include "live_effects/effect.h"
13 #include "live_effects/parameter/parameter.h"
14 #include "live_effects/parameter/path.h"
15 #include "live_effects/parameter/enum.h"
16 #include "live_effects/parameter/bool.h"
18 // needed for on-canvas editting:
19 #include "tools-switch.h"
20 #include "shape-editor.h"
21 #include "node-context.h"
22 #include "desktop-handles.h"
23 #include "selection.h"
24 #include "nodepath.h"
27 namespace Inkscape {
28 namespace LivePathEffect {
30 enum VonKochRefType {
31 VKREF_BBOX = 0,
32 VKREF_SEG,
33 VKREF_END // This must be last
34 };
36 class VonKochPathParam : public PathParam{
37 public:
38 VonKochPathParam ( const Glib::ustring& label,
39 const Glib::ustring& tip,
40 const Glib::ustring& key,
41 Inkscape::UI::Widget::Registry* wr,
42 Effect* effect,
43 const gchar * default_value = "M0,0 L1,1"):PathParam(label,tip,key,wr,effect,default_value){};
44 virtual ~VonKochPathParam();
45 virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);
46 };
48 class LPEVonKoch : public Effect {
49 public:
50 LPEVonKoch(LivePathEffectObject *lpeobject);
51 virtual ~LPEVonKoch();
53 virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);
55 virtual void resetDefaults(SPItem * item);
57 virtual void transform_multiply(Geom::Matrix const& postmul, bool set);
59 private:
60 ScalarParam nbgenerations;
61 VonKochPathParam generator;
62 BoolParam drawall;
63 EnumParam<VonKochRefType> reftype;
64 ScalarParam maxComplexity;
66 //void on_pattern_pasted();
68 LPEVonKoch(const LPEVonKoch&);
69 LPEVonKoch& operator=(const LPEVonKoch&);
70 };
72 }; //namespace LivePathEffect
73 }; //namespace Inkscape
75 #endif