From: johanengelen Date: Mon, 12 Nov 2007 18:59:48 +0000 (+0000) Subject: LPE: no longer overload doEffect methods, but name them according to accepted argumen... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5675f17bbbc00f2c970b4d4966ce55d86775f7a6;p=inkscape.git LPE: no longer overload doEffect methods, but name them according to accepted arguments. This saves developer brain time because of 'hiding' issues. --- diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 77e89ddf4..f87e365bc 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -122,7 +122,7 @@ Effect::getName() void Effect::doEffect (SPCurve * curve) { - NArtBpath *new_bpath = doEffect(SP_CURVE_BPATH(curve)); + NArtBpath *new_bpath = doEffect_nartbpath(SP_CURVE_BPATH(curve)); if (new_bpath && new_bpath != SP_CURVE_BPATH(curve)) { // FIXME, add function to SPCurve to change bpath? or a copy function? if (curve->_bpath) { @@ -133,12 +133,12 @@ Effect::doEffect (SPCurve * curve) } NArtBpath * -Effect::doEffect (NArtBpath * path_in) +Effect::doEffect_nartbpath (NArtBpath * path_in) { try { std::vector orig_pathv = BPath_to_2GeomPath(path_in); - std::vector result_pathv = doEffect(orig_pathv); + std::vector result_pathv = doEffect_path(orig_pathv); NArtBpath *new_bpath = BPath_from_2GeomPath(result_pathv); @@ -164,7 +164,7 @@ Effect::doEffect (NArtBpath * path_in) } std::vector -Effect::doEffect (std::vector & path_in) +Effect::doEffect_path (std::vector & path_in) { Geom::Piecewise > pwd2_in; @@ -172,7 +172,7 @@ Effect::doEffect (std::vector & path_in) pwd2_in.concat( path_in[i].toPwSb() ); } - Geom::Piecewise > pwd2_out = doEffect(pwd2_in); + Geom::Piecewise > pwd2_out = doEffect_pwd2(pwd2_in); std::vector path_out = Geom::path_from_piecewise( pwd2_out, LPE_CONVERSION_TOLERANCE); @@ -180,7 +180,7 @@ Effect::doEffect (std::vector & path_in) } Geom::Piecewise > -Effect::doEffect (Geom::Piecewise > & pwd2_in) +Effect::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) { g_warning("Effect has no doEffect implementation"); return pwd2_in; diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 221f94b40..f6732f9b2 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -96,11 +96,11 @@ protected: // called by this base class. (i.e. doEffect(SPCurve * curve) defaults to calling // doEffect(std::vector ) virtual NArtBpath * - doEffect (NArtBpath * path_in); + doEffect_nartbpath (NArtBpath * path_in); virtual std::vector - doEffect (std::vector & path_in); + doEffect_path (std::vector & path_in); virtual Geom::Piecewise > - doEffect (Geom::Piecewise > & pwd2_in); + doEffect_pwd2 (Geom::Piecewise > & pwd2_in); void registerParameter(Parameter * param); Parameter * getNextOncanvasEditableParam(); diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp index 0268cec33..f0573beb8 100644 --- a/src/live_effects/lpe-curvestitch.cpp +++ b/src/live_effects/lpe-curvestitch.cpp @@ -67,7 +67,7 @@ LPECurveStitch::~LPECurveStitch() } std::vector -LPECurveStitch::doEffect (std::vector & path_in) +LPECurveStitch::doEffect_path (std::vector & path_in) { if (path_in.size() >= 2) { startpoint_variation.resetRandomizer(); diff --git a/src/live_effects/lpe-curvestitch.h b/src/live_effects/lpe-curvestitch.h index db09a34ee..803625c93 100644 --- a/src/live_effects/lpe-curvestitch.h +++ b/src/live_effects/lpe-curvestitch.h @@ -28,7 +28,7 @@ public: LPECurveStitch(LivePathEffectObject *lpeobject); virtual ~LPECurveStitch(); - virtual std::vector doEffect (std::vector & path_in); + virtual std::vector doEffect_path (std::vector & path_in); virtual void resetDefaults(SPItem * item); diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index d5bb8e5ef..2fdc0116e 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -222,7 +222,7 @@ LPEGears::~LPEGears() } std::vector -LPEGears::doEffect (std::vector & path_in) +LPEGears::doEffect_path (std::vector & path_in) { std::vector path_out; Geom::Path gearpath = path_in[0]; diff --git a/src/live_effects/lpe-gears.h b/src/live_effects/lpe-gears.h index 01d74943a..fe210adda 100644 --- a/src/live_effects/lpe-gears.h +++ b/src/live_effects/lpe-gears.h @@ -22,9 +22,9 @@ public: LPEGears(LivePathEffectObject *lpeobject); virtual ~LPEGears(); - std::vector doEffect (std::vector & path_in); + virtual std::vector doEffect_path (std::vector & path_in); - void setup_notepath(Inkscape::NodePath::Path *np); + virtual void setup_notepath(Inkscape::NodePath::Path *np); private: ScalarParam teeth; diff --git a/src/live_effects/lpe-pathalongpath.cpp b/src/live_effects/lpe-pathalongpath.cpp index cd9c433f7..499b77f8c 100644 --- a/src/live_effects/lpe-pathalongpath.cpp +++ b/src/live_effects/lpe-pathalongpath.cpp @@ -92,7 +92,7 @@ LPEPathAlongPath::~LPEPathAlongPath() Geom::Piecewise > -LPEPathAlongPath::doEffect (Geom::Piecewise > & pwd2_in) +LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) { using namespace Geom; diff --git a/src/live_effects/lpe-pathalongpath.h b/src/live_effects/lpe-pathalongpath.h index 59ae8b4d2..d404e0f67 100644 --- a/src/live_effects/lpe-pathalongpath.h +++ b/src/live_effects/lpe-pathalongpath.h @@ -30,9 +30,9 @@ public: LPEPathAlongPath(LivePathEffectObject *lpeobject); virtual ~LPEPathAlongPath(); - Geom::Piecewise > doEffect (Geom::Piecewise > & pwd2_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); - void resetDefaults(SPItem * item); + virtual void resetDefaults(SPItem * item); private: PathParam bend_path; diff --git a/src/live_effects/lpe-skeletalstrokes.cpp b/src/live_effects/lpe-skeletalstrokes.cpp index d351c3553..8e70f8a87 100644 --- a/src/live_effects/lpe-skeletalstrokes.cpp +++ b/src/live_effects/lpe-skeletalstrokes.cpp @@ -88,7 +88,7 @@ LPESkeletalStrokes::~LPESkeletalStrokes() Geom::Piecewise > -LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in) +LPESkeletalStrokes::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) { using namespace Geom; diff --git a/src/live_effects/lpe-skeletalstrokes.h b/src/live_effects/lpe-skeletalstrokes.h index d18bb7cb5..b7739471c 100644 --- a/src/live_effects/lpe-skeletalstrokes.h +++ b/src/live_effects/lpe-skeletalstrokes.h @@ -30,7 +30,7 @@ public: LPESkeletalStrokes(LivePathEffectObject *lpeobject); virtual ~LPESkeletalStrokes(); - Geom::Piecewise > doEffect (Geom::Piecewise > & pwd2_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); private: PathParam pattern; diff --git a/src/live_effects/lpe-skeleton.cpp b/src/live_effects/lpe-skeleton.cpp index 13356972e..c0fe0adc0 100644 --- a/src/live_effects/lpe-skeleton.cpp +++ b/src/live_effects/lpe-skeleton.cpp @@ -56,7 +56,7 @@ LPESkeleton::doEffect (SPCurve * curve) } NArtBpath * -LPESkeleton::doEffect (NArtBpath * path_in) +LPESkeleton::doEffect_nartbpath (NArtBpath * path_in) { NArtBpath *path_out; unsigned ret = 0; @@ -72,7 +72,7 @@ LPESkeleton::doEffect (NArtBpath * path_in) } std::vector -LPESkeleton::doEffect (std::vector & path_in) +LPESkeleton::doEffect_path (std::vector & path_in) { std::vector path_out; @@ -83,7 +83,7 @@ LPESkeleton::doEffect (std::vector & path_in) */ Geom::Piecewise > -LPESkeleton::doEffect (Geom::Piecewise > & pwd2_in) +LPESkeleton::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) { Geom::Piecewise > output; diff --git a/src/live_effects/lpe-skeleton.h b/src/live_effects/lpe-skeleton.h index ed63d6388..6999cfac0 100644 --- a/src/live_effects/lpe-skeleton.h +++ b/src/live_effects/lpe-skeleton.h @@ -28,9 +28,9 @@ public: // Choose to implement one of the doEffect functions. You can delete or comment out the others. // virtual void doEffect (SPCurve * curve); -// virtual NArtBpath * doEffect (NArtBpath * path_in); -// virtual std::vector doEffect (std::vector & path_in); - virtual Geom::Piecewise > doEffect (Geom::Piecewise > & pwd2_in); +// virtual NArtBpath * doEffect_nartbpath (NArtBpath * path_in); +// virtual std::vector doEffect_path (std::vector & path_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-slant.h b/src/live_effects/lpe-slant.h index bdfe55383..43c736945 100644 --- a/src/live_effects/lpe-slant.h +++ b/src/live_effects/lpe-slant.h @@ -24,7 +24,6 @@ public: LPESlant(LivePathEffectObject *lpeobject); virtual ~LPESlant(); - using Effect::doEffect; virtual void doEffect(SPCurve * curve); private: diff --git a/src/live_effects/lpe-test-doEffect-stack.cpp b/src/live_effects/lpe-test-doEffect-stack.cpp index d071050e9..f6ecad562 100644 --- a/src/live_effects/lpe-test-doEffect-stack.cpp +++ b/src/live_effects/lpe-test-doEffect-stack.cpp @@ -40,10 +40,10 @@ LPEdoEffectStackTest::doEffect (SPCurve * curve) } NArtBpath * -LPEdoEffectStackTest::doEffect (NArtBpath * path_in) +LPEdoEffectStackTest::doEffect_nartbpath (NArtBpath * path_in) { if (step >= 2) { - return Effect::doEffect(path_in); + return Effect::doEffect_nartbpath(path_in); } else { // return here NArtBpath *path_out; @@ -61,10 +61,10 @@ LPEdoEffectStackTest::doEffect (NArtBpath * path_in) } std::vector -LPEdoEffectStackTest::doEffect (std::vector & path_in) +LPEdoEffectStackTest::doEffect_path (std::vector & path_in) { if (step >= 3) { - return Effect::doEffect(path_in); + return Effect::doEffect_path(path_in); } else { // return here std::vector path_out = path_in; @@ -73,7 +73,7 @@ LPEdoEffectStackTest::doEffect (std::vector & path_in) } Geom::Piecewise > -LPEdoEffectStackTest::doEffect (Geom::Piecewise > & pwd2_in) +LPEdoEffectStackTest::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) { Geom::Piecewise > output = pwd2_in; diff --git a/src/live_effects/lpe-test-doEffect-stack.h b/src/live_effects/lpe-test-doEffect-stack.h index dd0cf76cc..3d853aa8c 100644 --- a/src/live_effects/lpe-test-doEffect-stack.h +++ b/src/live_effects/lpe-test-doEffect-stack.h @@ -25,9 +25,9 @@ public: virtual ~LPEdoEffectStackTest(); virtual void doEffect (SPCurve * curve); - virtual NArtBpath * doEffect (NArtBpath * path_in); - virtual std::vector doEffect (std::vector & path_in); - virtual Geom::Piecewise > doEffect (Geom::Piecewise > & pwd2_in); + virtual NArtBpath * doEffect_nartbpath (NArtBpath * path_in); + virtual std::vector doEffect_path (std::vector & path_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); private: ScalarParam step;