summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-clone-original.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-01-12 21:06:16 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2012-01-12 21:06:16 +0000
commit76f0853b7d6bbe1233daa3141ce1379e2df1e934 (patch)
treecaeee88d187ec0312914f48953729d6f7f0b21d9 /src/live_effects/lpe-clone-original.cpp
parentInitial C++ification of SPCanvas. (diff)
downloadinkscape-76f0853b7d6bbe1233daa3141ce1379e2df1e934.tar.gz
inkscape-76f0853b7d6bbe1233daa3141ce1379e2df1e934.zip
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)
Diffstat (limited to 'src/live_effects/lpe-clone-original.cpp')
-rw-r--r--src/live_effects/lpe-clone-original.cpp50
1 files changed, 50 insertions, 0 deletions
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 <j.b.c.engelen@alumnus.utwente.nl>
+ *
+ * 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<Parameter *>(&linked_path) );
+}
+
+LPECloneOriginal::~LPECloneOriginal()
+{
+
+}
+
+void LPECloneOriginal::doEffect (SPCurve * curve)
+{
+ if ( linked_path.linksToPath() ) {
+ std::vector<Geom::Path> 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 :