diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2013-01-17 20:02:50 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2013-01-17 20:02:50 +0000 |
| commit | bf58d4cb9c86682d1416c64378d1cfc8a95554e8 (patch) | |
| tree | 573e206bdd797d1ca26d62a55dbff3078b0fe292 /src/live_effects | |
| parent | more const happiness (and removal of duplicate code in sp-object.h) (diff) | |
| download | inkscape-bf58d4cb9c86682d1416c64378d1cfc8a95554e8.tar.gz inkscape-bf58d4cb9c86682d1416c64378d1cfc8a95554e8.zip | |
const ....
(bzr r12039)
Diffstat (limited to 'src/live_effects')
35 files changed, 84 insertions, 84 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 26095d84b..b0be02b95 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -300,7 +300,7 @@ Effect::~Effect() } Glib::ustring -Effect::getName() +Effect::getName() const { if (lpeobj->effecttype_set && LPETypeConverter.is_valid_id(lpeobj->effecttype) ) return Glib::ustring( _(LPETypeConverter.get_label(lpeobj->effecttype).c_str()) ); @@ -325,7 +325,7 @@ Effect::doOnApply (SPLPEItem const*/*lpeitem*/) * Is performed each time before the effect is updated. */ void -Effect::doBeforeEffect (SPLPEItem */*lpeitem*/) +Effect::doBeforeEffect (SPLPEItem const*/*lpeitem*/) { //Do nothing for simple effects } @@ -370,7 +370,7 @@ Effect::writeParamsToSVG() { * your LPE. But don't forget to call the parent method so that is_ready is set to true! */ void -Effect::acceptParamPath (SPPath */*param_path*/) { +Effect::acceptParamPath (SPPath const*/*param_path*/) { setReady(); } @@ -424,7 +424,7 @@ Effect::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in) } void -Effect::readallParameters(Inkscape::XML::Node * repr) +Effect::readallParameters(Inkscape::XML::Node const* repr) { std::vector<Parameter *>::iterator it = param_vector.begin(); while (it != param_vector.end()) { @@ -491,7 +491,7 @@ Effect::addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { * This is the function called by external code like SPLPEItem. */ std::vector<Geom::PathVector> -Effect::getHelperPaths(SPLPEItem *lpeitem) +Effect::getHelperPaths(SPLPEItem const* lpeitem) { std::vector<Geom::PathVector> hp_vec; @@ -524,7 +524,7 @@ Effect::getHelperPaths(SPLPEItem *lpeitem) * This function should be overwritten by derived effects if they want to provide their own helperpaths. */ void -Effect::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector<Geom::PathVector> &/*hp_vec*/) +Effect::addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &/*hp_vec*/) { } diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 5862a24ba..f7a7155b0 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -54,13 +54,13 @@ public: EffectType effectType() const; virtual void doOnApply (SPLPEItem const* lpeitem); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); void writeParamsToSVG(); - virtual void acceptParamPath (SPPath *param_path); + virtual void acceptParamPath (SPPath const* param_path); static int acceptsNumClicks(EffectType type); - int acceptsNumClicks() { return acceptsNumClicks(effectType()); } + int acceptsNumClicks() const { return acceptsNumClicks(effectType()); } void doAcceptPathPreparations(SPLPEItem *lpeitem); /* @@ -90,20 +90,20 @@ public: // (but spiro lpe still needs it!) virtual LPEPathFlashType pathFlashType() const { return DEFAULT; } void addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); - std::vector<Geom::PathVector> getHelperPaths(SPLPEItem *lpeitem); + std::vector<Geom::PathVector> getHelperPaths(SPLPEItem const* lpeitem); inline bool providesOwnFlashPaths() const { return provides_own_flash_paths || show_orig_path; } inline bool showOrigPath() const { return show_orig_path; } - Glib::ustring getName(); + Glib::ustring getName() const; Inkscape::XML::Node * getRepr(); SPDocument * getSPDoc(); LivePathEffectObject * getLPEObj() {return lpeobj;}; Parameter * getParameter(const char * key); - void readallParameters(Inkscape::XML::Node * repr); + void readallParameters(Inkscape::XML::Node const* repr); void setParameter(const gchar * key, const gchar * new_value); inline bool isVisible() const { return is_visible; } @@ -128,7 +128,7 @@ protected: virtual void addKnotHolderEntities(KnotHolder * /*knotholder*/, SPDesktop * /*desktop*/, SPItem * /*item*/) {}; - virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector<Geom::PathVector> &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const* lpeitem, std::vector<Geom::PathVector> &hp_vec); std::vector<Parameter *> param_vector; bool _provides_knotholder_entities; diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp index 8aa88f1f0..91f779ef3 100644 --- a/src/live_effects/lpe-angle_bisector.cpp +++ b/src/live_effects/lpe-angle_bisector.cpp @@ -28,14 +28,14 @@ class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity { public: KnotHolderEntityLeftEnd(LPEAngleBisector* effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public LPEKnotHolderEntity { public: KnotHolderEntityRightEnd(LPEAngleBisector* effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace TtC @@ -125,16 +125,16 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPEAngleBisector *lpe = dynamic_cast<LPEAngleBisector *>(_effect); + LPEAngleBisector const* lpe = dynamic_cast<LPEAngleBisector const*>(_effect); return lpe->ptA - lpe->dir * lpe->length_left; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPEAngleBisector *lpe = dynamic_cast<LPEAngleBisector *>(_effect); + LPEAngleBisector const* lpe = dynamic_cast<LPEAngleBisector const*>(_effect); return lpe->ptA + lpe->dir * lpe->length_right; } diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index 59fd145d1..49660c91b 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -72,7 +72,7 @@ LPEBendPath::~LPEBendPath() } void -LPEBendPath::doBeforeEffect (SPLPEItem *lpeitem) +LPEBendPath::doBeforeEffect (SPLPEItem const* lpeitem) { // get the item bounding box original_bbox(lpeitem); diff --git a/src/live_effects/lpe-bendpath.h b/src/live_effects/lpe-bendpath.h index 0e4b3f726..3d336e2e7 100644 --- a/src/live_effects/lpe-bendpath.h +++ b/src/live_effects/lpe-bendpath.h @@ -33,7 +33,7 @@ public: LPEBendPath(LivePathEffectObject *lpeobject); virtual ~LPEBendPath(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in); diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index f946f0568..c1b72c3c7 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -34,14 +34,14 @@ class KnotHolderEntityStartingAngle : public LPEKnotHolderEntity { public: KnotHolderEntityStartingAngle(LPECopyRotate *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRotationAngle : public LPEKnotHolderEntity { public: KnotHolderEntityRotationAngle(LPECopyRotate *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace CR @@ -188,16 +188,16 @@ KnotHolderEntityRotationAngle::knot_set(Geom::Point const &p, Geom::Point const } Geom::Point -KnotHolderEntityStartingAngle::knot_get() +KnotHolderEntityStartingAngle::knot_get() const { - LPECopyRotate* lpe = dynamic_cast<LPECopyRotate *>(_effect); + LPECopyRotate const *lpe = dynamic_cast<LPECopyRotate const*>(_effect); return lpe->start_pos; } Geom::Point -KnotHolderEntityRotationAngle::knot_get() +KnotHolderEntityRotationAngle::knot_get() const { - LPECopyRotate* lpe = dynamic_cast<LPECopyRotate *>(_effect); + LPECopyRotate const *lpe = dynamic_cast<LPECopyRotate const*>(_effect); return lpe->rot_pos; } diff --git a/src/live_effects/lpe-envelope.cpp b/src/live_effects/lpe-envelope.cpp index bcd63e8cb..4f5623fba 100644 --- a/src/live_effects/lpe-envelope.cpp +++ b/src/live_effects/lpe-envelope.cpp @@ -50,7 +50,7 @@ LPEEnvelope::~LPEEnvelope() } void -LPEEnvelope::doBeforeEffect (SPLPEItem *lpeitem) +LPEEnvelope::doBeforeEffect (SPLPEItem const* lpeitem) { // get the item bounding box original_bbox(lpeitem); diff --git a/src/live_effects/lpe-envelope.h b/src/live_effects/lpe-envelope.h index 6a9fe1c0a..b5d6ceb50 100644 --- a/src/live_effects/lpe-envelope.h +++ b/src/live_effects/lpe-envelope.h @@ -31,7 +31,7 @@ public: LPEEnvelope(LivePathEffectObject *lpeobject); virtual ~LPEEnvelope(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in); diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index 61e457d35..27652bf0c 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -46,7 +46,7 @@ class KnotHolderEntityCrossingSwitcher : public LPEKnotHolderEntity { public: KnotHolderEntityCrossingSwitcher(LPEKnot *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_click(guint state); }; @@ -531,7 +531,7 @@ collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector<Geom::Path> &paths, void -LPEKnot::doBeforeEffect (SPLPEItem *lpeitem) +LPEKnot::doBeforeEffect (SPLPEItem const* lpeitem) { using namespace Geom; original_bbox(lpeitem); @@ -631,9 +631,9 @@ KnotHolderEntityCrossingSwitcher::knot_set(Geom::Point const &p, Geom::Point con } Geom::Point -KnotHolderEntityCrossingSwitcher::knot_get() +KnotHolderEntityCrossingSwitcher::knot_get() const { - LPEKnot* lpe = dynamic_cast<LPEKnot *>(_effect); + LPEKnot const *lpe = dynamic_cast<LPEKnot const*>(_effect); return lpe->switcher; } diff --git a/src/live_effects/lpe-knot.h b/src/live_effects/lpe-knot.h index 14c61a4e5..a25607981 100644 --- a/src/live_effects/lpe-knot.h +++ b/src/live_effects/lpe-knot.h @@ -56,7 +56,7 @@ public: LPEKnot(LivePathEffectObject *lpeobject); virtual ~LPEKnot(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & input_path); /* the knotholder entity classes must be declared friends */ diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp index 84fba4659..8136569e8 100644 --- a/src/live_effects/lpe-lattice.cpp +++ b/src/live_effects/lpe-lattice.cpp @@ -173,7 +173,7 @@ LPELattice::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2 } void -LPELattice::doBeforeEffect (SPLPEItem *lpeitem) +LPELattice::doBeforeEffect (SPLPEItem const* lpeitem) { original_bbox(lpeitem); } diff --git a/src/live_effects/lpe-lattice.h b/src/live_effects/lpe-lattice.h index 521875bcf..a44dda3fd 100644 --- a/src/live_effects/lpe-lattice.h +++ b/src/live_effects/lpe-lattice.h @@ -31,7 +31,7 @@ public: LPELattice(LivePathEffectObject *lpeobject); virtual ~LPELattice(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in); diff --git a/src/live_effects/lpe-line_segment.cpp b/src/live_effects/lpe-line_segment.cpp index 6619b85ce..2e7240e25 100644 --- a/src/live_effects/lpe-line_segment.cpp +++ b/src/live_effects/lpe-line_segment.cpp @@ -43,7 +43,7 @@ LPELineSegment::~LPELineSegment() } void -LPELineSegment::doBeforeEffect (SPLPEItem *lpeitem) +LPELineSegment::doBeforeEffect (SPLPEItem const* lpeitem) { lpetool_get_limiting_bbox_corners(lpeitem->document, bboxA, bboxB); } diff --git a/src/live_effects/lpe-line_segment.h b/src/live_effects/lpe-line_segment.h index b2bb0994f..1a57688b6 100644 --- a/src/live_effects/lpe-line_segment.h +++ b/src/live_effects/lpe-line_segment.h @@ -32,7 +32,7 @@ public: LPELineSegment(LivePathEffectObject *lpeobject); virtual ~LPELineSegment(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in); diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp index cbe3ba509..bb37fd42c 100644 --- a/src/live_effects/lpe-parallel.cpp +++ b/src/live_effects/lpe-parallel.cpp @@ -32,14 +32,14 @@ class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity { public: KnotHolderEntityLeftEnd(LPEParallel *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public LPEKnotHolderEntity { public: KnotHolderEntityRightEnd(LPEParallel *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace Pl @@ -143,16 +143,16 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect); + LPEParallel const *lpe = dynamic_cast<LPEParallel const*>(_effect); return lpe->C; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect); + LPEParallel const *lpe = dynamic_cast<LPEParallel const*>(_effect); return lpe->D; } diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp index 95e56f1ce..c2a25a187 100644 --- a/src/live_effects/lpe-perp_bisector.cpp +++ b/src/live_effects/lpe-perp_bisector.cpp @@ -38,25 +38,25 @@ class KnotHolderEntityLeftEnd : public KnotHolderEntityEnd { public: KnotHolderEntityLeftEnd(LPEPerpBisector *effect) : KnotHolderEntityEnd(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public KnotHolderEntityEnd { public: KnotHolderEntityRightEnd(LPEPerpBisector *effect) : KnotHolderEntityEnd(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; Geom::Point -KnotHolderEntityLeftEnd::knot_get() { - LPEPerpBisector *lpe = dynamic_cast<LPEPerpBisector *>(_effect); +KnotHolderEntityLeftEnd::knot_get() const { + LPEPerpBisector const* lpe = dynamic_cast<LPEPerpBisector const*>(_effect); return Geom::Point(lpe->C); } Geom::Point -KnotHolderEntityRightEnd::knot_get() { - LPEPerpBisector *lpe = dynamic_cast<LPEPerpBisector *>(_effect); +KnotHolderEntityRightEnd::knot_get() const { + LPEPerpBisector const* lpe = dynamic_cast<LPEPerpBisector const*>(_effect); return Geom::Point(lpe->D); } diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp index aeee77482..c255f8665 100644 --- a/src/live_effects/lpe-perspective_path.cpp +++ b/src/live_effects/lpe-perspective_path.cpp @@ -36,7 +36,7 @@ class KnotHolderEntityOffset : public LPEKnotHolderEntity public: KnotHolderEntityOffset(LPEPerspectivePath *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace PP @@ -71,7 +71,7 @@ LPEPerspectivePath::~LPEPerspectivePath() } void -LPEPerspectivePath::doBeforeEffect (SPLPEItem *lpeitem) +LPEPerspectivePath::doBeforeEffect (SPLPEItem const* lpeitem) { original_bbox(lpeitem, true); } @@ -165,9 +165,9 @@ KnotHolderEntityOffset::knot_set(Geom::Point const &p, Geom::Point const &origin } Geom::Point -KnotHolderEntityOffset::knot_get() +KnotHolderEntityOffset::knot_get() const { - LPEPerspectivePath* lpe = dynamic_cast<LPEPerspectivePath *>(_effect); + LPEPerspectivePath const *lpe = dynamic_cast<LPEPerspectivePath const*>(_effect); return lpe->orig + Geom::Point(lpe->offsetx, -lpe->offsety); } diff --git a/src/live_effects/lpe-perspective_path.h b/src/live_effects/lpe-perspective_path.h index 14321f52e..a9ee004f9 100644 --- a/src/live_effects/lpe-perspective_path.h +++ b/src/live_effects/lpe-perspective_path.h @@ -34,7 +34,7 @@ public: LPEPerspectivePath(LivePathEffectObject *lpeobject); virtual ~LPEPerspectivePath(); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in); diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp index 14b21fe39..96b0bb0ae 100644 --- a/src/live_effects/lpe-rough-hatches.cpp +++ b/src/live_effects/lpe-rough-hatches.cpp @@ -539,7 +539,7 @@ LPERoughHatches::smoothSnake(std::vector<std::vector<Point> > const &linearSnake } void -LPERoughHatches::doBeforeEffect (SPLPEItem */*lpeitem*/) +LPERoughHatches::doBeforeEffect (SPLPEItem const*/*lpeitem*/) { using namespace Geom; top_edge_variation.resetRandomizer(); diff --git a/src/live_effects/lpe-rough-hatches.h b/src/live_effects/lpe-rough-hatches.h index 867801e74..f8454e1ea 100644 --- a/src/live_effects/lpe-rough-hatches.h +++ b/src/live_effects/lpe-rough-hatches.h @@ -33,7 +33,7 @@ public: virtual void resetDefaults(SPItem const* item); - virtual void doBeforeEffect(SPLPEItem * item); + virtual void doBeforeEffect(SPLPEItem const* item); std::vector<double> generateLevels(Geom::Interval const &domain, double x_org); diff --git a/src/live_effects/lpe-skeleton.cpp b/src/live_effects/lpe-skeleton.cpp index 65faef216..c61e9773f 100644 --- a/src/live_effects/lpe-skeleton.cpp +++ b/src/live_effects/lpe-skeleton.cpp @@ -95,7 +95,7 @@ class KnotHolderEntityMyHandle : public LPEKnotHolderEntity public: // the set() and get() methods must be implemented, click() is optional virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; //virtual void knot_click(guint state); }; diff --git a/src/live_effects/lpe-sketch.cpp b/src/live_effects/lpe-sketch.cpp index ccc508144..8ad0e616f 100644 --- a/src/live_effects/lpe-sketch.cpp +++ b/src/live_effects/lpe-sketch.cpp @@ -362,7 +362,7 @@ LPESketch::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_ } void -LPESketch::doBeforeEffect (SPLPEItem */*lpeitem*/) +LPESketch::doBeforeEffect (SPLPEItem const*/*lpeitem*/) { //init random parameters. parallel_offset.resetRandomizer(); diff --git a/src/live_effects/lpe-sketch.h b/src/live_effects/lpe-sketch.h index b95f57682..3bef0cf5e 100644 --- a/src/live_effects/lpe-sketch.h +++ b/src/live_effects/lpe-sketch.h @@ -31,7 +31,7 @@ public: virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in); - virtual void doBeforeEffect (SPLPEItem *lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); private: // add the parameters for your effect here: diff --git a/src/live_effects/lpe-tangent_to_curve.cpp b/src/live_effects/lpe-tangent_to_curve.cpp index b40d404ae..dbebdf7fb 100644 --- a/src/live_effects/lpe-tangent_to_curve.cpp +++ b/src/live_effects/lpe-tangent_to_curve.cpp @@ -36,14 +36,14 @@ class KnotHolderEntityAttachPt : public LPEKnotHolderEntity { public: KnotHolderEntityAttachPt(LPETangentToCurve *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity { public: KnotHolderEntityLeftEnd(LPETangentToCurve *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; class KnotHolderEntityRightEnd : public LPEKnotHolderEntity @@ -51,7 +51,7 @@ class KnotHolderEntityRightEnd : public LPEKnotHolderEntity public: KnotHolderEntityRightEnd(LPETangentToCurve *effect) : LPEKnotHolderEntity(effect) {}; virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; }; } // namespace TtC @@ -172,23 +172,23 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or } Geom::Point -KnotHolderEntityAttachPt::knot_get() +KnotHolderEntityAttachPt::knot_get() const { - LPETangentToCurve* lpe = dynamic_cast<LPETangentToCurve *>(_effect); + LPETangentToCurve const *lpe = dynamic_cast<LPETangentToCurve const*>(_effect); return lpe->ptA; } Geom::Point -KnotHolderEntityLeftEnd::knot_get() +KnotHolderEntityLeftEnd::knot_get() const { - LPETangentToCurve *lpe = dynamic_cast<LPETangentToCurve *>(_effect); + LPETangentToCurve const *lpe = dynamic_cast<LPETangentToCurve const*>(_effect); return lpe->C; } Geom::Point -KnotHolderEntityRightEnd::knot_get() +KnotHolderEntityRightEnd::knot_get() const { - LPETangentToCurve *lpe = dynamic_cast<LPETangentToCurve *>(_effect); + LPETangentToCurve const *lpe = dynamic_cast<LPETangentToCurve const*>(_effect); return lpe->D; } diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index ee3daff82..f7b2beeba 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -241,7 +241,7 @@ LPEVonKoch::doEffect_path (std::vector<Geom::Path> const & path_in) */ void -LPEVonKoch::doBeforeEffect (SPLPEItem *lpeitem) +LPEVonKoch::doBeforeEffect (SPLPEItem const* lpeitem) { using namespace Geom; original_bbox(lpeitem); diff --git a/src/live_effects/lpe-vonkoch.h b/src/live_effects/lpe-vonkoch.h index 1a36ab410..2ea7c8169 100644 --- a/src/live_effects/lpe-vonkoch.h +++ b/src/live_effects/lpe-vonkoch.h @@ -53,7 +53,7 @@ public: virtual void resetDefaults(SPItem const* item); - virtual void doBeforeEffect(SPLPEItem * item); + virtual void doBeforeEffect(SPLPEItem const* item); //Usefull?? // protected: diff --git a/src/live_effects/lpegroupbbox.cpp b/src/live_effects/lpegroupbbox.cpp index e2378265a..2a1b70a6a 100644 --- a/src/live_effects/lpegroupbbox.cpp +++ b/src/live_effects/lpegroupbbox.cpp @@ -22,7 +22,7 @@ namespace LivePathEffect { * or of the transformed lpeitem (\c absolute = \c true) using sp_item_i2doc_affine. * @post Updated values of boundingbox_X and boundingbox_Y. These intervals are set to empty intervals when the precondition is not met. */ -void GroupBBoxEffect::original_bbox(SPLPEItem *lpeitem, bool absolute) +void GroupBBoxEffect::original_bbox(SPLPEItem const* lpeitem, bool absolute) { // Get item bounding box Geom::Affine transform; diff --git a/src/live_effects/lpegroupbbox.h b/src/live_effects/lpegroupbbox.h index 57577d20f..cc14203d1 100644 --- a/src/live_effects/lpegroupbbox.h +++ b/src/live_effects/lpegroupbbox.h @@ -22,7 +22,7 @@ protected: Geom::Interval boundingbox_Y; //This sets boundingbox_X and boundingbox_Y - void original_bbox(SPLPEItem *lpeitem, bool absolute = false); + void original_bbox(SPLPEItem const* lpeitem, bool absolute = false); }; }; //namespace LivePathEffect diff --git a/src/live_effects/parameter/originalpath.h b/src/live_effects/parameter/originalpath.h index 7dd17edb0..b3feec41f 100644 --- a/src/live_effects/parameter/originalpath.h +++ b/src/live_effects/parameter/originalpath.h @@ -31,7 +31,7 @@ public: /** Disable the canvas indicators of parent class by overriding this method */ virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {}; /** Disable the canvas indicators of parent class by overriding this method */ - virtual void addCanvasIndicators(SPLPEItem * /*lpeitem*/, std::vector<Geom::PathVector> & /*hp_vec*/) {}; + virtual void addCanvasIndicators(SPLPEItem const* /*lpeitem*/, std::vector<Geom::PathVector> & /*hp_vec*/) {}; protected: virtual void linked_modified_callback(SPObject *linked_obj, guint flags); diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 526708ed7..785ada92e 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -61,7 +61,7 @@ public: // overload these for your particular parameter to make it provide knotholder handles or canvas helperpaths virtual bool providesKnotHolderEntities() const { return false; } virtual void addKnotHolderEntities(KnotHolder */*knotholder*/, SPDesktop */*desktop*/, SPItem */*item*/) {}; - virtual void addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector<Geom::PathVector> &/*hp_vec*/) {}; + virtual void addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &/*hp_vec*/) {}; virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {}; virtual void param_setup_nodepath(Inkscape::NodePath::Path */*np*/) {}; diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index d076cc5d0..eca0d7a22 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -231,7 +231,7 @@ PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) } void -PathParam::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec) +PathParam::addCanvasIndicators(SPLPEItem const*/*lpeitem*/, std::vector<Geom::PathVector> &hp_vec) { hp_vec.push_back(_pathvector); } diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index d48b5422d..112a1ea13 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -46,7 +46,7 @@ public: virtual void param_editOncanvas(SPItem * item, SPDesktop * dt); virtual void param_setup_nodepath(Inkscape::NodePath::Path *np); - virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector<Geom::PathVector> &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const* lpeitem, std::vector<Geom::PathVector> &hp_vec); virtual void param_transform_multiply(Geom::Affine const& /*postmul*/, bool /*set*/); diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 2be87e048..53866f278 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -133,7 +133,7 @@ public: virtual ~PointParamKnotHolderEntity() {} virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_click(guint state); private: @@ -149,7 +149,7 @@ PointParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &/* } Geom::Point -PointParamKnotHolderEntity::knot_get() +PointParamKnotHolderEntity::knot_get() const { return *pparam; } diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index 93161ec0d..fecdfeda8 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -124,11 +124,11 @@ public: virtual ~PowerStrokePointArrayParamKnotHolderEntity() {} virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); - virtual Geom::Point knot_get(); + virtual Geom::Point knot_get() const; virtual void knot_click(guint state); /** Checks whether the index falls within the size of the parameter's vector */ - bool valid_index(unsigned int index) { + bool valid_index(unsigned int index) const { return (_pparam->_vector.size() > index); }; @@ -164,7 +164,7 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom: } Geom::Point -PowerStrokePointArrayParamKnotHolderEntity::knot_get() +PowerStrokePointArrayParamKnotHolderEntity::knot_get() const { using namespace Geom; diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp index a20c46042..edd6b863f 100644 --- a/src/live_effects/parameter/vector.cpp +++ b/src/live_effects/parameter/vector.cpp @@ -154,7 +154,7 @@ public: param->setOrigin(s); sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); }; - virtual Geom::Point knot_get(){ + virtual Geom::Point knot_get() const { return param->origin; }; virtual void knot_click(guint /*state*/){ @@ -176,7 +176,7 @@ public: param->setVector(s); sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false); }; - virtual Geom::Point knot_get(){ + virtual Geom::Point knot_get() const { return param->origin + param->vector; }; virtual void knot_click(guint /*state*/){ |
