Code

Rename LPE: mirror reflect --> mirror symmetry
[inkscape.git] / src / live_effects / lpe-vonkoch.h
index f32242d74c49da026cbc2c62e8a50b634e244d53..c4126e5e66b5dde0b0dab6ffceda11c13b25d134 100644 (file)
@@ -4,25 +4,55 @@
 /*
  * Inkscape::LPEVonKoch
  *
-* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
+ * Copyright (C) JF Barraud 2007 <jf.barraud@gmail.com>
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
 #include "live_effects/effect.h"
+#include "live_effects/parameter/parameter.h"
 #include "live_effects/parameter/path.h"
 #include "live_effects/parameter/enum.h"
 #include "live_effects/parameter/bool.h"
 
+#include "libnr/n-art-bpath-2geom.h"
+
+// needed for on-canvas editting:
+#include "tools-switch.h"
+#include "shape-editor.h"
+#include "node-context.h"
+#include "desktop-handles.h"
+#include "selection.h"
+#include "nodepath.h"
+
+
 namespace Inkscape {
 namespace LivePathEffect {
 
+enum VonKochRefType {
+    VKREF_BBOX = 0,
+    VKREF_SEG,
+    VKREF_END // This must be last
+};
+
+class VonKochPathParam : public PathParam{
+public:
+    VonKochPathParam ( const Glib::ustring& label,
+                      const Glib::ustring& tip,
+                      const Glib::ustring& key,
+                      Inkscape::UI::Widget::Registry* wr,
+                      Effect* effect,
+                      const gchar * default_value = "M0,0 L1,1"):PathParam(label,tip,key,wr,effect,default_value){};
+    virtual ~VonKochPathParam();
+    virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);  
+  };
+
 class LPEVonKoch : public Effect {
 public:
     LPEVonKoch(LivePathEffectObject *lpeobject);
     virtual ~LPEVonKoch();
 
-    virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> & path_in);
+    virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);
 
     virtual void resetDefaults(SPItem * item);
 
@@ -30,11 +60,12 @@ public:
 
 private:
     ScalarParam  nbgenerations;
-    PathParam    generator;
+    VonKochPathParam    generator;
     BoolParam    drawall;
-    BoolParam    vertical_pattern;
+    EnumParam<VonKochRefType> reftype;
+    ScalarParam  maxComplexity;
 
-    void on_pattern_pasted();
+    //void on_pattern_pasted();
 
     LPEVonKoch(const LPEVonKoch&);
     LPEVonKoch& operator=(const LPEVonKoch&);