summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-05-13 06:50:42 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-05-13 06:50:42 +0000
commit9cd50c94d560a2372a755bdf58ccf7feb7afe083 (patch)
tree85383af36ab65580c0112314582ba2f6170422b2 /src/live_effects
parentFixed a bug in bspline with snaps and 1 sice segments. Pointed by LiamW (diff)
downloadinkscape-9cd50c94d560a2372a755bdf58ccf7feb7afe083.tar.gz
inkscape-9cd50c94d560a2372a755bdf58ccf7feb7afe083.zip
Add Simplify LPE
(bzr r13341.1.13)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/CMakeLists.txt4
-rw-r--r--src/live_effects/Makefile_insert2
-rw-r--r--src/live_effects/effect-enum.h1
-rw-r--r--src/live_effects/effect.cpp14
-rw-r--r--src/live_effects/parameter/Makefile_insert2
5 files changed, 20 insertions, 3 deletions
diff --git a/src/live_effects/CMakeLists.txt b/src/live_effects/CMakeLists.txt
index 7aeb911b0..5979cd028 100644
--- a/src/live_effects/CMakeLists.txt
+++ b/src/live_effects/CMakeLists.txt
@@ -29,6 +29,7 @@ set(live_effects_SRC
lpe-recursiveskeleton.cpp
lpe-rough-hatches.cpp
lpe-ruler.cpp
+ lpe-simplify.cpp
# lpe-skeleton.cpp
lpe-sketch.cpp
lpe-spiro.cpp
@@ -53,6 +54,7 @@ set(live_effects_SRC
parameter/powerstrokepointarray.cpp
parameter/random.cpp
parameter/text.cpp
+ parameter/togglebutton.cpp
parameter/unit.cpp
parameter/vector.cpp
@@ -90,6 +92,7 @@ set(live_effects_SRC
lpe-recursiveskeleton.h
lpe-rough-hatches.h
lpe-ruler.h
+ lpe-simplify.h
lpe-skeleton.h
lpe-sketch.h
lpe-spiro.h
@@ -115,6 +118,7 @@ set(live_effects_SRC
parameter/powerstrokepointarray.h
parameter/random.h
parameter/text.h
+ parameter/togglebutton.h
parameter/unit.h
parameter/vector.h
diff --git a/src/live_effects/Makefile_insert b/src/live_effects/Makefile_insert
index 248030e8c..a9da81d5b 100644
--- a/src/live_effects/Makefile_insert
+++ b/src/live_effects/Makefile_insert
@@ -42,6 +42,8 @@ ink_common_sources += \
live_effects/lpe-bspline.h \
live_effects/lpe-lattice.cpp \
live_effects/lpe-lattice.h \
+ live_effects/lpe-simplify.cpp \
+ live_effects/lpe-simplify.h \
live_effects/lpe-envelope.cpp \
live_effects/lpe-envelope.h \
live_effects/lpe-spiro.cpp \
diff --git a/src/live_effects/effect-enum.h b/src/live_effects/effect-enum.h
index 342a2c849..cacb1190f 100644
--- a/src/live_effects/effect-enum.h
+++ b/src/live_effects/effect-enum.h
@@ -28,6 +28,7 @@ enum EffectType {
PERSPECTIVE_PATH,
SPIRO,
LATTICE,
+ SIMPLIFY,
ENVELOPE,
CONSTRUCT_GRID,
PERP_BISECTOR,
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 9006e5359..66bce9c1d 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -26,6 +26,7 @@
#include "live_effects/lpe-perspective_path.h"
#include "live_effects/lpe-spiro.h"
#include "live_effects/lpe-lattice.h"
+#include "live_effects/lpe-simplify.h"
#include "live_effects/lpe-envelope.h"
#include "live_effects/lpe-constructgrid.h"
#include "live_effects/lpe-perp_bisector.h"
@@ -122,6 +123,7 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{POWERSTROKE, N_("Power stroke"), "powerstroke"},
{CLONE_ORIGINAL, N_("Clone original path"), "clone_original"},
{BSPLINE, N_("BSpline"), "bspline"},
+ {SIMPLIFY, N_("Simplify"), "simplify"},
};
const Util::EnumDataConverter<EffectType> LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData));
@@ -248,6 +250,9 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj)
case CLONE_ORIGINAL:
neweffect = static_cast<Effect*> ( new LPECloneOriginal(lpeobj) );
break;
+ case SIMPLIFY:
+ neweffect = static_cast<Effect*> ( new LPESimplify(lpeobj) );
+ break;
default:
g_warning("LivePathEffect::Effect::New called with invalid patheffect type (%d)", lpenr);
neweffect = NULL;
@@ -499,9 +504,12 @@ Effect::getCanvasIndicators(SPLPEItem const* lpeitem)
{
std::vector<Geom::PathVector> hp_vec;
- if (!SP_IS_SHAPE(lpeitem)) {
-// g_print ("How to handle helperpaths for non-shapes?\n"); // non-shapes are for example SPGroups.
- return hp_vec;
+ // TODO: we can probably optimize this by using a lot more references
+ // rather than copying PathVectors all over the place
+ if (SP_IS_SHAPE(lpeitem) && show_orig_path) {
+ // add original path to helperpaths
+ SPCurve* curve = SP_SHAPE(lpeitem)->getCurve ();
+ hp_vec.push_back(curve->get_pathvector());
}
// add indicators provided by the effect itself
diff --git a/src/live_effects/parameter/Makefile_insert b/src/live_effects/parameter/Makefile_insert
index efdda686a..30f1f510b 100644
--- a/src/live_effects/parameter/Makefile_insert
+++ b/src/live_effects/parameter/Makefile_insert
@@ -22,6 +22,8 @@ ink_common_sources += \
live_effects/parameter/powerstrokepointarray.h \
live_effects/parameter/text.cpp \
live_effects/parameter/text.h \
+ live_effects/parameter/togglebutton.cpp \
+ live_effects/parameter/togglebutton.h \
live_effects/parameter/unit.cpp \
live_effects/parameter/unit.h \
live_effects/parameter/vector.cpp \