Code

011602eaf4d545db6b248b0c5432fe9f1ab8899d
[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/lpegroupbbox.h"
14 #include "live_effects/parameter/path.h"
15 #include "live_effects/parameter/enum.h"
16 #include "live_effects/parameter/bool.h"
18 namespace Inkscape {
19 namespace LivePathEffect {
21 enum VonKochRefType {
22     VKREF_BBOX = 0,
23     VKREF_SEG,
24     VKREF_END // This must be last
25 };
27 class VonKochPathParam : public PathParam{
28 public:
29     VonKochPathParam ( const Glib::ustring& label,
30                        const Glib::ustring& tip,
31                        const Glib::ustring& key,
32                        Inkscape::UI::Widget::Registry* wr,
33                        Effect* effect,
34                        const gchar * default_value = "M0,0 L1,1"):PathParam(label,tip,key,wr,effect,default_value){};
35     virtual ~VonKochPathParam();
36     virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);
37   };
39 class LPEVonKoch : public Effect, GroupBBoxEffect {
40 public:
41     LPEVonKoch(LivePathEffectObject *lpeobject);
42     virtual ~LPEVonKoch();
44     virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);
46     virtual void resetDefaults(SPItem * item);
48     virtual void doBeforeEffect(SPLPEItem * item);
50     virtual void transform_multiply(Geom::Matrix const& postmul, bool set);
52 private:
53     ScalarParam  nbgenerations;
54     VonKochPathParam    generator;
55     BoolParam    similar_only;
56     BoolParam    drawall;
57     EnumParam<VonKochRefType> reftype;
58     ScalarParam  maxComplexity;
60     //void on_pattern_pasted();
62     LPEVonKoch(const LPEVonKoch&);
63     LPEVonKoch& operator=(const LPEVonKoch&);
64 };
66 }; //namespace LivePathEffect
67 }; //namespace Inkscape
69 #endif