summaryrefslogtreecommitdiffstats
path: root/src/live_effects/effect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects/effect.cpp')
-rw-r--r--src/live_effects/effect.cpp14
1 files changed, 11 insertions, 3 deletions
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