From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/live_effects/lpe-embrodery-stitch.h | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/live_effects/lpe-embrodery-stitch.h (limited to 'src/live_effects/lpe-embrodery-stitch.h') diff --git a/src/live_effects/lpe-embrodery-stitch.h b/src/live_effects/lpe-embrodery-stitch.h new file mode 100644 index 0000000..6bbd931 --- /dev/null +++ b/src/live_effects/lpe-embrodery-stitch.h @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Embroidery stitch live path effect + * + * Copyright (C) 2016 Michael Soegtrop + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#ifndef INKSCAPE_LPE_EMBRODERY_STITCH_H +#define INKSCAPE_LPE_EMBRODERY_STITCH_H + +#include "live_effects/effect.h" +#include "live_effects/parameter/parameter.h" +#include "live_effects/parameter/bool.h" +#include "live_effects/parameter/enum.h" +#include "live_effects/lpe-embrodery-stitch-ordering.h" + +namespace Inkscape { +namespace LivePathEffect { + +using namespace LPEEmbroderyStitchOrdering; + +class LPEEmbroderyStitch : public Effect { +public: + + LPEEmbroderyStitch(LivePathEffectObject *lpeobject); + ~LPEEmbroderyStitch() override; + + Geom::PathVector doEffect_path(Geom::PathVector const &path_in) override; + + void resetDefaults(SPItem const *item) override; + + enum order_method { + order_method_no_reorder, + order_method_zigzag, + order_method_zigzag_rev_first, + order_method_closest, + order_method_closest_rev_first, + order_method_tsp_kopt_2, + order_method_tsp_kopt_3, + order_method_tsp_kopt_4, + order_method_tsp_kopt_5, + order_method_count + }; + enum connect_method { + connect_method_line, + connect_method_move_point_from, + connect_method_move_point_mid, + connect_method_move_point_to, + connect_method_count + }; + +private: + EnumParam ordering; + EnumParam connection; + ScalarParam stitch_length; + ScalarParam stitch_min_length; + ScalarParam stitch_pattern; + BoolParam show_stitches; + ScalarParam show_stitch_gap; + ScalarParam jump_if_longer; + + LPEEmbroderyStitch(const LPEEmbroderyStitch &) = delete; + LPEEmbroderyStitch &operator=(const LPEEmbroderyStitch &) = delete; + + double GetPatternInitialStep(int pattern, int line); + Geom::Point GetStartPointInterpolAfterRev(std::vector const &info, unsigned i); + Geom::Point GetEndPointInterpolAfterRev(std::vector const &info, unsigned i); + Geom::Point GetStartPointInterpolBeforeRev(std::vector const &info, unsigned i); + Geom::Point GetEndPointInterpolBeforeRev(std::vector const &info, unsigned i); +}; + +} //namespace LivePathEffect +} //namespace Inkscape + +#endif -- cgit v1.2.3