From 76f0853b7d6bbe1233daa3141ce1379e2df1e934 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 12 Jan 2012 22:06:16 +0100 Subject: LPE: add new LPE that outputs the original path data. used to make a clone (without LPE) of a path with an LPE applied (bzr r10874) --- src/live_effects/lpe-clone-original.cpp | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/live_effects/lpe-clone-original.cpp (limited to 'src/live_effects/lpe-clone-original.cpp') diff --git a/src/live_effects/lpe-clone-original.cpp b/src/live_effects/lpe-clone-original.cpp new file mode 100644 index 000000000..ce51f4aa2 --- /dev/null +++ b/src/live_effects/lpe-clone-original.cpp @@ -0,0 +1,50 @@ +#define INKSCAPE_LPE_CLONE_ORIGINAL_CPP + +/* + * Copyright (C) Johan Engelen 2012 + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "live_effects/lpe-clone-original.h" + +#include "display/curve.h" + +namespace Inkscape { +namespace LivePathEffect { + +LPECloneOriginal::LPECloneOriginal(LivePathEffectObject *lpeobject) : + Effect(lpeobject), + linked_path(_("Linked path:"), _("Path from which to take the original path data"), "linkedpath", &wr, this) +{ + registerParameter( dynamic_cast(&linked_path) ); +} + +LPECloneOriginal::~LPECloneOriginal() +{ + +} + +void LPECloneOriginal::doEffect (SPCurve * curve) +{ + if ( linked_path.linksToPath() ) { + std::vector linked_pathv = linked_path.get_pathvector(); + if ( !linked_pathv.empty() ) { + curve->set_pathvector(linked_pathv); + } + } +} + +} // namespace LivePathEffect +} /* namespace Inkscape */ + +/* + 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 : -- cgit v1.2.3