summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-powerstroke.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/live_effects/lpe-powerstroke.h
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/live_effects/lpe-powerstroke.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/live_effects/lpe-powerstroke.h b/src/live_effects/lpe-powerstroke.h
new file mode 100644
index 0000000..6ac1496
--- /dev/null
+++ b/src/live_effects/lpe-powerstroke.h
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/** @file
+ * @brief PowerStroke LPE effect, see lpe-powerstroke.cpp.
+ */
+/* Authors:
+ * Johan Engelen <j.b.c.engelen@alumnus.utwente.nl>
+ *
+ * Copyright (C) 2010-2011 Authors
+ *
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#ifndef INKSCAPE_LPE_POWERSTROKE_H
+#define INKSCAPE_LPE_POWERSTROKE_H
+
+#include "live_effects/effect.h"
+#include "live_effects/parameter/bool.h"
+#include "live_effects/parameter/enum.h"
+#include "live_effects/parameter/hidden.h"
+#include "live_effects/parameter/powerstrokepointarray.h"
+
+namespace Inkscape {
+namespace LivePathEffect {
+
+enum LineCapType { LINECAP_BUTT, LINECAP_SQUARE, LINECAP_ROUND, LINECAP_PEAK, LINECAP_ZERO_WIDTH };
+
+static const Util::EnumData<unsigned> LineCapTypeData[] = { { LINECAP_BUTT, N_("Butt"), "butt" },
+ { LINECAP_SQUARE, N_("Square"), "square" },
+ { LINECAP_ROUND, N_("Round"), "round" },
+ { LINECAP_PEAK, N_("Peak"), "peak" },
+ { LINECAP_ZERO_WIDTH, N_("Zero width"), "zerowidth" } };
+static const Util::EnumDataConverter<unsigned> LineCapTypeConverter(LineCapTypeData,
+ sizeof(LineCapTypeData) / sizeof(*LineCapTypeData));
+
+class LPEPowerStroke : public Effect {
+public:
+ LPEPowerStroke(LivePathEffectObject *lpeobject);
+ ~LPEPowerStroke() override;
+ LPEPowerStroke(const LPEPowerStroke&) = delete;
+ LPEPowerStroke& operator=(const LPEPowerStroke&) = delete;
+
+ Geom::PathVector doEffect_path (Geom::PathVector const & path_in) override;
+ void doBeforeEffect(SPLPEItem const *lpeItem) override;
+ void doOnApply(SPLPEItem const* lpeitem) override;
+ void doOnRemove(SPLPEItem const* lpeitem) override;
+ void doAfterEffect(SPLPEItem const *lpeitem) override;
+ void transform_multiply(Geom::Affine const &postmul, bool set) override;
+ void applyStyle(SPLPEItem *lpeitem);
+ // methods called by path-manipulator upon edits
+ void adjustForNewPath(Geom::PathVector const & path_in);
+
+ PowerStrokePointArrayParam offset_points;
+private:
+ BoolParam sort_points;
+ EnumParam<unsigned> interpolator_type;
+ ScalarParam interpolator_beta;
+ ScalarParam scale_width;
+ EnumParam<unsigned> start_linecap_type;
+ EnumParam<unsigned> linejoin_type;
+ ScalarParam miter_limit;
+ EnumParam<unsigned> end_linecap_type;
+ size_t recusion_limit;
+ bool has_recursion;
+};
+
+} //namespace LivePathEffect
+} //namespace Inkscape
+
+#endif
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :