summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-vonkoch.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
commitcca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch)
tree146f39ded1c938019e1ed42d30923c2ac9e86789 /src/live_effects/lpe-vonkoch.h
parentInitial commit. (diff)
downloadinkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz
inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/live_effects/lpe-vonkoch.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/live_effects/lpe-vonkoch.h b/src/live_effects/lpe-vonkoch.h
new file mode 100644
index 0000000..f24b94f
--- /dev/null
+++ b/src/live_effects/lpe-vonkoch.h
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+#ifndef INKSCAPE_LPE_VONKOCH_H
+#define INKSCAPE_LPE_VONKOCH_H
+
+/*
+ * Inkscape::LPEVonKoch
+ *
+ * Copyright (C) JF Barraud 2007 <jf.barraud@gmail.com>
+ *
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#include "live_effects/effect.h"
+#include "live_effects/lpegroupbbox.h"
+#include "live_effects/parameter/path.h"
+#include "live_effects/parameter/point.h"
+#include "live_effects/parameter/bool.h"
+
+namespace Inkscape {
+namespace LivePathEffect {
+
+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){}
+ ~VonKochPathParam() override= default;
+ void param_setup_nodepath(Inkscape::NodePath::Path *np) override;
+ };
+
+ //FIXME: a path is used here instead of 2 points to work around path/point param incompatibility bug.
+class VonKochRefPathParam : public PathParam{
+public:
+ VonKochRefPathParam ( 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){}
+ ~VonKochRefPathParam() override= default;
+ void param_setup_nodepath(Inkscape::NodePath::Path *np) override;
+ bool param_readSVGValue(const gchar * strvalue) override;
+ };
+
+class LPEVonKoch : public Effect, GroupBBoxEffect {
+public:
+ LPEVonKoch(LivePathEffectObject *lpeobject);
+ ~LPEVonKoch() override;
+ bool doOnOpen(SPLPEItem const *lpeitem) override;
+ Geom::PathVector doEffect_path (Geom::PathVector const & path_in) override;
+
+ void resetDefaults(SPItem const* item) override;
+
+ void doBeforeEffect(SPLPEItem const* item) override;
+
+ //Useful??
+ // protected:
+ //virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector<Geom::PathVector> &hp_vec);
+
+private:
+ ScalarParam nbgenerations;
+ VonKochPathParam generator;
+ BoolParam similar_only;
+ BoolParam drawall;
+ //BoolParam draw_boxes;
+ //FIXME: a path is used here instead of 2 points to work around path/point param incompatibility bug.
+ VonKochRefPathParam ref_path;
+ // PointParam refA;
+ // PointParam refB;
+ ScalarParam maxComplexity;
+
+ LPEVonKoch(const LPEVonKoch&) = delete;
+ LPEVonKoch& operator=(const LPEVonKoch&) = delete;
+};
+
+}; //namespace LivePathEffect
+}; //namespace Inkscape
+
+#endif