Code

change doEffect functions to use const& parameters
[inkscape.git] / src / live_effects / lpe-vonkoch.h
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 #include "live_effects/n-art-bpath-2geom.h"
20 // needed for on-canvas editting:
21 #include "tools-switch.h"
22 #include "shape-editor.h"
23 #include "node-context.h"
24 #include "desktop-handles.h"
25 #include "selection.h"
26 #include "nodepath.h"
29 namespace Inkscape {
30 namespace LivePathEffect {
32 enum VonKochRefType {
33     VKREF_BBOX = 0,
34     VKREF_SEG,
35     VKREF_END // This must be last
36 };
38 class VonKochPathParam : public PathParam{
39 public:
40     VonKochPathParam ( const Glib::ustring& label,
41                        const Glib::ustring& tip,
42                        const Glib::ustring& key,
43                        Inkscape::UI::Widget::Registry* wr,
44                        Effect* effect,
45                        const gchar * default_value = "M0,0 L1,1"):PathParam(label,tip,key,wr,effect,default_value){};
46     virtual ~VonKochPathParam();
47     virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);  
48   };
50 class LPEVonKoch : public Effect {
51 public:
52     LPEVonKoch(LivePathEffectObject *lpeobject);
53     virtual ~LPEVonKoch();
55     virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);
57     virtual void resetDefaults(SPItem * item);
59     virtual void transform_multiply(Geom::Matrix const& postmul, bool set);
61 private:
62     ScalarParam  nbgenerations;
63     VonKochPathParam    generator;
64     BoolParam    drawall;
65     EnumParam<VonKochRefType> reftype;
66     ScalarParam  maxComplexity;
68     //void on_pattern_pasted();
70     LPEVonKoch(const LPEVonKoch&);
71     LPEVonKoch& operator=(const LPEVonKoch&);
72 };
74 }; //namespace LivePathEffect
75 }; //namespace Inkscape
77 #endif