diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /src/live_effects/lpe-mirror_symmetry.h | |
parent | Initial commit. (diff) | |
download | inkscape-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 'src/live_effects/lpe-mirror_symmetry.h')
-rw-r--r-- | src/live_effects/lpe-mirror_symmetry.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h new file mode 100644 index 0000000..fb0c39f --- /dev/null +++ b/src/live_effects/lpe-mirror_symmetry.h @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef INKSCAPE_LPE_MIRROR_SYMMETRY_H +#define INKSCAPE_LPE_MIRROR_SYMMETRY_H + +/** \file + * LPE <mirror_symmetry> implementation: mirrors a path with respect to a given line. + */ +/* + * Authors: + * Maximilian Albert + * Johan Engelen + * Jabiertxof + * + * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl> + * Copyright (C) Maximilin Albert 2008 <maximilian.albert@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/lpeobject-reference.h" +#include "live_effects/lpeobject.h" +#include "live_effects/parameter/enum.h" +#include "live_effects/parameter/parameter.h" +#include "live_effects/parameter/point.h" +#include "live_effects/parameter/satellitearray.h" +#include "live_effects/parameter/text.h" + +namespace Inkscape { +namespace LivePathEffect { + +enum ModeType { + MT_V, + MT_H, + MT_FREE, + MT_X, + MT_Y, + MT_END +}; + +class LPEMirrorSymmetry : public Effect, GroupBBoxEffect { +public: + LPEMirrorSymmetry(LivePathEffectObject *lpeobject); + ~LPEMirrorSymmetry() override; + void doOnApply (SPLPEItem const* lpeitem) override; + void doBeforeEffect (SPLPEItem const* lpeitem) override; + void doAfterEffect (SPLPEItem const* lpeitem, SPCurve *curve) override; + bool doOnOpen(SPLPEItem const * /*lpeitem*/) override; + Geom::PathVector doEffect_path (Geom::PathVector const & path_in) override; + void doOnRemove (SPLPEItem const* /*lpeitem*/) override; + void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) override; + Gtk::Widget * newWidget() override; + void cloneStyle(SPObject *orig, SPObject *dest); + void toMirror(Geom::Affine transform); + void cloneD(SPObject *orig, SPObject *dest); + Inkscape::XML::Node * createPathBase(SPObject *elemref); + void centerVert(); + void centerHoriz(); + BoolParam split_items; + +protected: + void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector<Geom::PathVector> &hp_vec) override; + +private: + SatelliteArrayParam lpesatellites; + EnumParam<ModeType> mode; + BoolParam discard_orig_path; + BoolParam fuse_paths; + BoolParam oposite_fuse; + BoolParam split_open; + BoolParam link_styles; + PointParam start_point; + PointParam end_point; + PointParam center_point; + Geom::Point previous_center; + SPObject *container; + bool reset; + bool prev_split = false; + bool prev_discard_orig_path = false; + bool center_vert; + bool center_horiz; + LPEMirrorSymmetry(const LPEMirrorSymmetry&) = delete; + LPEMirrorSymmetry& operator=(const LPEMirrorSymmetry&) = delete; +}; + +} //namespace LivePathEffect +} //namespace Inkscape + +#endif |