Code

LPE: no longer overload doEffect methods, but name them according to accepted argumen...
authorjohanengelen <johanengelen@users.sourceforge.net>
Mon, 12 Nov 2007 18:59:48 +0000 (18:59 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Mon, 12 Nov 2007 18:59:48 +0000 (18:59 +0000)
15 files changed:
src/live_effects/effect.cpp
src/live_effects/effect.h
src/live_effects/lpe-curvestitch.cpp
src/live_effects/lpe-curvestitch.h
src/live_effects/lpe-gears.cpp
src/live_effects/lpe-gears.h
src/live_effects/lpe-pathalongpath.cpp
src/live_effects/lpe-pathalongpath.h
src/live_effects/lpe-skeletalstrokes.cpp
src/live_effects/lpe-skeletalstrokes.h
src/live_effects/lpe-skeleton.cpp
src/live_effects/lpe-skeleton.h
src/live_effects/lpe-slant.h
src/live_effects/lpe-test-doEffect-stack.cpp
src/live_effects/lpe-test-doEffect-stack.h

index 77e89ddf4a4e91968e5623676bac7a1afe76897a..f87e365bc337416847b58d1b3313e4cd1e8aedc8 100644 (file)
@@ -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<Geom::Path> orig_pathv = BPath_to_2GeomPath(path_in);
 
-        std::vector<Geom::Path> result_pathv = doEffect(orig_pathv);
+        std::vector<Geom::Path> 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<Geom::Path>
-Effect::doEffect (std::vector<Geom::Path> & path_in)
+Effect::doEffect_path (std::vector<Geom::Path> & path_in)
 {
     Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in;
 
@@ -172,7 +172,7 @@ Effect::doEffect (std::vector<Geom::Path> & path_in)
         pwd2_in.concat( path_in[i].toPwSb() );
     }
 
-    Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_out = doEffect(pwd2_in);
+    Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_out = doEffect_pwd2(pwd2_in);
 
     std::vector<Geom::Path> path_out = Geom::path_from_piecewise( pwd2_out, LPE_CONVERSION_TOLERANCE);
 
@@ -180,7 +180,7 @@ Effect::doEffect (std::vector<Geom::Path> & path_in)
 }
 
 Geom::Piecewise<Geom::D2<Geom::SBasis> >
-Effect::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
+Effect::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
 {
     g_warning("Effect has no doEffect implementation");
     return pwd2_in;
index 221f94b4026f8276b0e4d27eca7d0e51f050be9e..f6732f9b2e095e2cf033e75afa730ea5372452cf 100644 (file)
@@ -96,11 +96,11 @@ protected:
     // called by this base class. (i.e. doEffect(SPCurve * curve) defaults to calling
     // doEffect(std::vector<Geom::Path> )
     virtual NArtBpath *
-            doEffect (NArtBpath * path_in);
+            doEffect_nartbpath (NArtBpath * path_in);
     virtual std::vector<Geom::Path> 
-            doEffect (std::vector<Geom::Path> & path_in);
+            doEffect_path (std::vector<Geom::Path> & path_in);
     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > 
-            doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
+            doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
 
     void registerParameter(Parameter * param);
     Parameter * getNextOncanvasEditableParam();
index 0268cec33c6192c01c16b117791ee5d5915d02f9..f0573beb8eace883f041fe38b965bf31793b90cc 100644 (file)
@@ -67,7 +67,7 @@ LPECurveStitch::~LPECurveStitch()
 }
 
 std::vector<Geom::Path>
-LPECurveStitch::doEffect (std::vector<Geom::Path> & path_in)
+LPECurveStitch::doEffect_path (std::vector<Geom::Path> & path_in)
 {
     if (path_in.size() >= 2) {
         startpoint_variation.resetRandomizer();
index db09a34ee53f5909fa181c69abb7afd18f7a2016..803625c93c5d694ccfbd601d0f9421bfbc68fe9c 100644 (file)
@@ -28,7 +28,7 @@ public:
     LPECurveStitch(LivePathEffectObject *lpeobject);
     virtual ~LPECurveStitch();
 
-    virtual std::vector<Geom::Path> doEffect (std::vector<Geom::Path> & path_in);
+    virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> & path_in);
 
     virtual void resetDefaults(SPItem * item);
 
index d5bb8e5ef1ea919d46e067960aff24593f2d90f2..2fdc0116e2129c0f8e7929ab90e0d3c0fe809807 100644 (file)
@@ -222,7 +222,7 @@ LPEGears::~LPEGears()
 }
 
 std::vector<Geom::Path>
-LPEGears::doEffect (std::vector<Geom::Path> & path_in)
+LPEGears::doEffect_path (std::vector<Geom::Path> & path_in)
 {
     std::vector<Geom::Path> path_out;
     Geom::Path gearpath = path_in[0];
index 01d74943a9c0d6d64fa856f0f462f277825187ae..fe210addac6fbb5a35497e66caf8bcfb2ee1b1f6 100644 (file)
@@ -22,9 +22,9 @@ public:
     LPEGears(LivePathEffectObject *lpeobject);
     virtual ~LPEGears();
 
-    std::vector<Geom::Path> doEffect (std::vector<Geom::Path> & path_in);
+    virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> & path_in);
 
-    void setup_notepath(Inkscape::NodePath::Path *np);
+    virtual void setup_notepath(Inkscape::NodePath::Path *np);
 
 private:
     ScalarParam teeth;
index cd9c433f7d9cd87b6f386b994888f774936a13b2..499b77f8c4099524f946ffcddfb5a387f6d433b5 100644 (file)
@@ -92,7 +92,7 @@ LPEPathAlongPath::~LPEPathAlongPath()
 \r
 \r
 Geom::Piecewise<Geom::D2<Geom::SBasis> >\r
-LPEPathAlongPath::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)\r
+LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)\r
 {\r
     using namespace Geom;\r
 \r
index 59ae8b4d20874cf00dfc1044a19bec4ca4fd8c5f..d404e0f6752e69a39f00ce9915fcc3c1c9be15ad 100644 (file)
@@ -30,9 +30,9 @@ public:
     LPEPathAlongPath(LivePathEffectObject *lpeobject);\r
     virtual ~LPEPathAlongPath();\r
 \r
-    Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);\r
+    virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);\r
 \r
-    void resetDefaults(SPItem * item);\r
+    virtual void resetDefaults(SPItem * item);\r
 \r
 private:\r
     PathParam  bend_path;\r
index d351c3553ee39f21927c763b59f59500f91d2d50..8e70f8a87e334524936d2dee88bd97f7f68454ee 100644 (file)
@@ -88,7 +88,7 @@ LPESkeletalStrokes::~LPESkeletalStrokes()
 
 
 Geom::Piecewise<Geom::D2<Geom::SBasis> >
-LPESkeletalStrokes::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
+LPESkeletalStrokes::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
 {
     using namespace Geom;
 
index d18bb7cb5c074887d29f17aeed400dc7f934730f..b7739471c08d47dd9314941354956c072b1850a0 100644 (file)
@@ -30,7 +30,7 @@ public:
     LPESkeletalStrokes(LivePathEffectObject *lpeobject);
     virtual ~LPESkeletalStrokes();
 
-    Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
+    virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
 
 private:
     PathParam  pattern;
index 13356972e544b19809bf2571a15333656d4105d2..c0fe0adc03e3cd9814b222019f23a2ead6dc002f 100644 (file)
@@ -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<Geom::Path>
-LPESkeleton::doEffect (std::vector<Geom::Path> & path_in)
+LPESkeleton::doEffect_path (std::vector<Geom::Path> & path_in)
 {
         std::vector<Geom::Path> path_out;
 
@@ -83,7 +83,7 @@ LPESkeleton::doEffect (std::vector<Geom::Path> & path_in)
 */
 
 Geom::Piecewise<Geom::D2<Geom::SBasis> >
-LPESkeleton::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
+LPESkeleton::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
 {
     Geom::Piecewise<Geom::D2<Geom::SBasis> > output;
 
index ed63d63886ca5894f1e1df400ad859ab3a6f7a8d..6999cfac0b291a47d01b50f95431cead4f135340 100644 (file)
@@ -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<Geom::Path> doEffect (std::vector<Geom::Path> & path_in);
-    virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
+//    virtual NArtBpath * doEffect_nartbpath (NArtBpath * path_in);
+//    virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> & path_in);
+    virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
 
 private:
     // add the parameters for your effect here:
index bdfe55383451f6f9c5a3aeb2ba8e0a6584a21733..43c7369459958444849adcb3527e3d6388b9e358 100644 (file)
@@ -24,7 +24,6 @@ public:
     LPESlant(LivePathEffectObject *lpeobject);
     virtual ~LPESlant();
 
-    using Effect::doEffect;
     virtual void doEffect(SPCurve * curve);
 
 private:
index d071050e905df4fe2b8a55e4c09a5139cc405d94..f6ecad562f13ac37b8246312a814ae3d68a41401 100644 (file)
@@ -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<Geom::Path>
-LPEdoEffectStackTest::doEffect (std::vector<Geom::Path> & path_in)
+LPEdoEffectStackTest::doEffect_path (std::vector<Geom::Path> & path_in)
 {
     if (step >= 3) {
-        return Effect::doEffect(path_in);
+        return Effect::doEffect_path(path_in);
     } else {
         // return here
         std::vector<Geom::Path> path_out = path_in;
@@ -73,7 +73,7 @@ LPEdoEffectStackTest::doEffect (std::vector<Geom::Path> & path_in)
 }
 
 Geom::Piecewise<Geom::D2<Geom::SBasis> > 
-LPEdoEffectStackTest::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
+LPEdoEffectStackTest::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in)
 {
     Geom::Piecewise<Geom::D2<Geom::SBasis> > output = pwd2_in;
 
index dd0cf76cc461033fd4b7b7a64a5b39a7a9f1e3a1..3d853aa8cd2334426dbbfea987ef6f1b69b7c332 100644 (file)
@@ -25,9 +25,9 @@ public:
     virtual ~LPEdoEffectStackTest();
 
     virtual void                                     doEffect (SPCurve * curve);
-    virtual NArtBpath *                              doEffect (NArtBpath * path_in);
-    virtual std::vector<Geom::Path>                  doEffect (std::vector<Geom::Path> & path_in);
-    virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
+    virtual NArtBpath *                              doEffect_nartbpath (NArtBpath * path_in);
+    virtual std::vector<Geom::Path>                  doEffect_path (std::vector<Geom::Path> & path_in);
+    virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
 
 private:
     ScalarParam step;