From ecda720053ff791e35dae3c5c1177bc225b6cdf1 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Wed, 9 Apr 2008 21:12:17 +0000 Subject: [PATCH] change doEffect functions to use const& parameters --- src/live_effects/effect.cpp | 4 ++-- src/live_effects/effect.h | 4 ++-- src/live_effects/lpe-bendpath.cpp | 2 +- src/live_effects/lpe-bendpath.h | 2 +- src/live_effects/lpe-circle_with_radius.cpp | 2 +- src/live_effects/lpe-circle_with_radius.h | 2 +- src/live_effects/lpe-curvestitch.cpp | 2 +- src/live_effects/lpe-curvestitch.h | 2 +- src/live_effects/lpe-gears.cpp | 2 +- src/live_effects/lpe-gears.h | 2 +- src/live_effects/lpe-knot.cpp | 12 ++++++------ src/live_effects/lpe-knot.h | 2 +- src/live_effects/lpe-patternalongpath.cpp | 4 ++-- src/live_effects/lpe-patternalongpath.h | 2 +- src/live_effects/lpe-perspective_path.cpp | 2 +- src/live_effects/lpe-perspective_path.h | 2 +- src/live_effects/lpe-skeleton.cpp | 2 +- src/live_effects/lpe-skeleton.h | 2 +- src/live_effects/lpe-sketch.cpp | 4 ++-- src/live_effects/lpe-sketch.h | 2 +- src/live_effects/lpe-test-doEffect-stack.cpp | 4 ++-- src/live_effects/lpe-test-doEffect-stack.h | 4 ++-- src/live_effects/lpe-vonkoch.cpp | 2 +- src/live_effects/lpe-vonkoch.h | 2 +- 24 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 3c8ad8d50..fdeda8a62 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -196,7 +196,7 @@ Effect::doEffect_nartbpath (NArtBpath * path_in) } std::vector -Effect::doEffect_path (std::vector & path_in) +Effect::doEffect_path (std::vector const & path_in) { std::vector path_out; @@ -225,7 +225,7 @@ Effect::doEffect_path (std::vector & path_in) } Geom::Piecewise > -Effect::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +Effect::doEffect_pwd2 (Geom::Piecewise > const & 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 1726613c5..7988ed22a 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -112,9 +112,9 @@ protected: virtual NArtBpath * doEffect_nartbpath (NArtBpath * path_in); virtual std::vector - doEffect_path (std::vector & path_in); + doEffect_path (std::vector const & path_in); virtual Geom::Piecewise > - doEffect_pwd2 (Geom::Piecewise > & pwd2_in); + doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); void registerParameter(Parameter * param); Parameter * getNextOncanvasEditableParam(); diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index d5bd53247..b9f414df0 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -104,7 +104,7 @@ LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem) } Geom::Piecewise > -LPEBendPath::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) { using namespace Geom; diff --git a/src/live_effects/lpe-bendpath.h b/src/live_effects/lpe-bendpath.h index 53e580c3a..47a26ac83 100644 --- a/src/live_effects/lpe-bendpath.h +++ b/src/live_effects/lpe-bendpath.h @@ -35,7 +35,7 @@ public: virtual void doBeforeEffect (SPLPEItem *lpeitem); - virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); virtual void resetDefaults(SPItem * item); diff --git a/src/live_effects/lpe-circle_with_radius.cpp b/src/live_effects/lpe-circle_with_radius.cpp index ec9d4f74d..c5dfebfad 100644 --- a/src/live_effects/lpe-circle_with_radius.cpp +++ b/src/live_effects/lpe-circle_with_radius.cpp @@ -65,7 +65,7 @@ void _circle(Geom::Point center, double radius, std::vector &path_ou } std::vector -LPECircleWithRadius::doEffect_path (std::vector &path_in) +LPECircleWithRadius::doEffect_path (std::vector const & path_in) { std::vector path_out = std::vector(); diff --git a/src/live_effects/lpe-circle_with_radius.h b/src/live_effects/lpe-circle_with_radius.h index e783e0aab..19330eb33 100644 --- a/src/live_effects/lpe-circle_with_radius.h +++ b/src/live_effects/lpe-circle_with_radius.h @@ -28,7 +28,7 @@ public: virtual ~LPECircleWithRadius(); // Choose to implement one of the doEffect functions. You can delete or comment out the others. - virtual std::vector doEffect_path (std::vector & path_in); + virtual std::vector doEffect_path (std::vector const & path_in); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp index dc9cfe635..18647cf48 100644 --- a/src/live_effects/lpe-curvestitch.cpp +++ b/src/live_effects/lpe-curvestitch.cpp @@ -72,7 +72,7 @@ LPECurveStitch::~LPECurveStitch() } std::vector -LPECurveStitch::doEffect_path (std::vector & path_in) +LPECurveStitch::doEffect_path (std::vector const & path_in) { if (path_in.size() >= 2) { startpoint_edge_variation.resetRandomizer(); diff --git a/src/live_effects/lpe-curvestitch.h b/src/live_effects/lpe-curvestitch.h index a0050760c..8a8e43f2c 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_path (std::vector & path_in); + virtual std::vector doEffect_path (std::vector const & path_in); virtual void resetDefaults(SPItem * item); diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index 699f2c83b..7dcd32fcc 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -231,7 +231,7 @@ LPEGears::~LPEGears() } std::vector -LPEGears::doEffect_path (std::vector & path_in) +LPEGears::doEffect_path (std::vector const & 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 d046c3640..4c3a9938b 100644 --- a/src/live_effects/lpe-gears.h +++ b/src/live_effects/lpe-gears.h @@ -22,7 +22,7 @@ public: LPEGears(LivePathEffectObject *lpeobject); virtual ~LPEGears(); - virtual std::vector doEffect_path (std::vector & path_in); + virtual std::vector doEffect_path (std::vector const & path_in); virtual void setup_nodepath(Inkscape::NodePath::Path *np); diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index bd9c0ca68..245b6df0f 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -101,13 +101,13 @@ findShadowedTime(Geom::Path &patha, //Just a try; this should be moved to 2geom if ever it works. std::vector -split_loopy_bezier (std::vector & path_in){ +split_loopy_bezier (std::vector const & path_in){ std::vector ret; - std::vector::iterator pi=path_in.begin(); + std::vector::const_iterator pi=path_in.begin(); for(; pi != path_in.end(); pi++) { ret.push_back(Geom::Path()); - for (Geom::Path::iterator curve(pi->begin()),end(pi->end()); curve != end; ++curve){ + for (Geom::Path::const_iterator curve(pi->begin()),end(pi->end()); curve != end; ++curve){ //is the current curve a cubic bezier? if(Geom::CubicBezier const *cubic_bezier = dynamic_cast(&(*curve))){ @@ -149,13 +149,13 @@ split_loopy_bezier (std::vector & path_in){ std::vector -LPEKnot::doEffect_path (std::vector & path_in) +LPEKnot::doEffect_path (std::vector const & input_path) { using namespace Geom; std::vector path_out; double width = interruption_width; - - path_in = split_loopy_bezier(path_in); + + std::vector path_in = split_loopy_bezier(input_path); CrossingSet crossingTable = crossings_among(path_in); for (unsigned i = 0; i < crossingTable.size(); i++){ diff --git a/src/live_effects/lpe-knot.h b/src/live_effects/lpe-knot.h index a030f7567..521c2d7c9 100644 --- a/src/live_effects/lpe-knot.h +++ b/src/live_effects/lpe-knot.h @@ -28,7 +28,7 @@ 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 (NArtBpath * path_in); - virtual std::vector doEffect_path (std::vector & path_in); + virtual std::vector doEffect_path (std::vector const & input_path); // virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); private: diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp index 9b2819219..7d11a5172 100644 --- a/src/live_effects/lpe-patternalongpath.cpp +++ b/src/live_effects/lpe-patternalongpath.cpp @@ -92,7 +92,7 @@ LPEPatternAlongPath::~LPEPatternAlongPath() //TODO: does this already exist in 2Geom? if not, move this there... static std::vector > > -split_at_discontinuities (Geom::Piecewise > & pwsbin, double tol = .0001) +split_at_discontinuities (Geom::Piecewise > const & pwsbin, double tol = .0001) { using namespace Geom; std::vector > > ret; @@ -114,7 +114,7 @@ split_at_discontinuities (Geom::Piecewise > & pwsbin, dou Geom::Piecewise > -LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) { using namespace Geom; diff --git a/src/live_effects/lpe-patternalongpath.h b/src/live_effects/lpe-patternalongpath.h index 2909ab078..8a3e78aa5 100644 --- a/src/live_effects/lpe-patternalongpath.h +++ b/src/live_effects/lpe-patternalongpath.h @@ -30,7 +30,7 @@ public: LPEPatternAlongPath(LivePathEffectObject *lpeobject); virtual ~LPEPatternAlongPath(); - virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); virtual void transform_multiply(Geom::Matrix const& postmul, bool set); diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp index 923a4baa4..1418f1892 100644 --- a/src/live_effects/lpe-perspective_path.cpp +++ b/src/live_effects/lpe-perspective_path.cpp @@ -66,7 +66,7 @@ LPEPerspectivePath::~LPEPerspectivePath() } Geom::Piecewise > -LPEPerspectivePath::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +LPEPerspectivePath::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) { using namespace Geom; diff --git a/src/live_effects/lpe-perspective_path.h b/src/live_effects/lpe-perspective_path.h index f02df30f0..dc4a9969e 100644 --- a/src/live_effects/lpe-perspective_path.h +++ b/src/live_effects/lpe-perspective_path.h @@ -29,7 +29,7 @@ public: LPEPerspectivePath(LivePathEffectObject *lpeobject); virtual ~LPEPerspectivePath(); - virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > & pwd2_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-skeleton.cpp b/src/live_effects/lpe-skeleton.cpp index a2c4cf1fb..571503d8e 100644 --- a/src/live_effects/lpe-skeleton.cpp +++ b/src/live_effects/lpe-skeleton.cpp @@ -83,7 +83,7 @@ LPESkeleton::doEffect_path (std::vector & path_in) */ Geom::Piecewise > -LPESkeleton::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +LPESkeleton::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) { Geom::Piecewise > output; diff --git a/src/live_effects/lpe-skeleton.h b/src/live_effects/lpe-skeleton.h index 9ebb55e7d..290b8a724 100644 --- a/src/live_effects/lpe-skeleton.h +++ b/src/live_effects/lpe-skeleton.h @@ -30,7 +30,7 @@ public: // virtual void doEffect (SPCurve * curve); // 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); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-sketch.cpp b/src/live_effects/lpe-sketch.cpp index 79f4d67f9..e4e7cddcc 100644 --- a/src/live_effects/lpe-sketch.cpp +++ b/src/live_effects/lpe-sketch.cpp @@ -136,7 +136,7 @@ addLinearEnds (Geom::Piecewise > & m){ //TODO: does this already exist in 2Geom? if not, move this there... std::vector > > -split_at_discontinuities (Geom::Piecewise > & pwsbin, double tol = .0001) +split_at_discontinuities (Geom::Piecewise > const & pwsbin, double tol = .0001) { using namespace Geom; std::vector > > ret; @@ -193,7 +193,7 @@ LPESketch::computePerturbation (double s0, double s1){ // Main effect body... Geom::Piecewise > -LPESketch::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +LPESketch::doEffect_pwd2 (Geom::Piecewise > const & pwd2_in) { using namespace Geom; //If the input path is empty, do nothing. diff --git a/src/live_effects/lpe-sketch.h b/src/live_effects/lpe-sketch.h index 95d9ea94f..051240665 100644 --- a/src/live_effects/lpe-sketch.h +++ b/src/live_effects/lpe-sketch.h @@ -31,7 +31,7 @@ public: // virtual void doEffect (SPCurve * curve); // 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); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-test-doEffect-stack.cpp b/src/live_effects/lpe-test-doEffect-stack.cpp index 93e1add0a..cafe693b7 100644 --- a/src/live_effects/lpe-test-doEffect-stack.cpp +++ b/src/live_effects/lpe-test-doEffect-stack.cpp @@ -65,7 +65,7 @@ LPEdoEffectStackTest::doEffect_nartbpath (NArtBpath * path_in) } std::vector -LPEdoEffectStackTest::doEffect_path (std::vector & path_in) +LPEdoEffectStackTest::doEffect_path (std::vector const & path_in) { if (step >= 3) { return Effect::doEffect_path(path_in); @@ -77,7 +77,7 @@ LPEdoEffectStackTest::doEffect_path (std::vector & path_in) } Geom::Piecewise > -LPEdoEffectStackTest::doEffect_pwd2 (Geom::Piecewise > & pwd2_in) +LPEdoEffectStackTest::doEffect_pwd2 (Geom::Piecewise > const & 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 1417512d1..a48865399 100644 --- a/src/live_effects/lpe-test-doEffect-stack.h +++ b/src/live_effects/lpe-test-doEffect-stack.h @@ -27,8 +27,8 @@ public: virtual void doEffect (SPCurve * curve); 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); + virtual std::vector doEffect_path (std::vector const & path_in); + virtual Geom::Piecewise > doEffect_pwd2 (Geom::Piecewise > const & pwd2_in); private: ScalarParam step; diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index 760295ed7..a4b3062d9 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -76,7 +76,7 @@ LPEVonKoch::~LPEVonKoch() } std::vector -LPEVonKoch::doEffect_path (std::vector & path_in) +LPEVonKoch::doEffect_path (std::vector const & path_in) { using namespace Geom; std::vector generating_path = path_from_piecewise(generator.get_pwd2(),.01);//TODO what should that tolerance be? diff --git a/src/live_effects/lpe-vonkoch.h b/src/live_effects/lpe-vonkoch.h index 46f118536..45e97295c 100644 --- a/src/live_effects/lpe-vonkoch.h +++ b/src/live_effects/lpe-vonkoch.h @@ -52,7 +52,7 @@ public: LPEVonKoch(LivePathEffectObject *lpeobject); virtual ~LPEVonKoch(); - virtual std::vector doEffect_path (std::vector & path_in); + virtual std::vector doEffect_path (std::vector const & path_in); virtual void resetDefaults(SPItem * item); -- 2.30.2