From 27390442faeb882de49277b7471bdcd35a8827f6 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 20 Jul 2008 19:02:23 +0000 Subject: [PATCH] purge LivePathEffect::PathType --- src/live_effects/effect.cpp | 9 ++++----- src/live_effects/parameter/bool.h | 2 -- src/live_effects/parameter/enum.h | 2 -- src/live_effects/parameter/parameter.h | 16 ---------------- src/live_effects/parameter/path.h | 2 -- src/live_effects/parameter/point.h | 2 -- src/live_effects/parameter/random.h | 2 -- 7 files changed, 4 insertions(+), 31 deletions(-) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index ad9024772..85f392321 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -431,8 +431,7 @@ void Effect::addPointParamHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { using namespace Inkscape::LivePathEffect; for (std::vector::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { - if ((*p)->paramType() == POINT_PARAM) { - PointParam *pparam = static_cast(*p); + if ( Inkscape::LivePathEffect::PointParam *pparam = dynamic_cast(*p) ) { KnotHolderEntity *e = dynamic_cast(*p); e->create(desktop, item, knotholder, pparam->handleTip(), pparam->knotShape(), pparam->knotMode(), pparam->knotColor()); @@ -457,8 +456,8 @@ Effect::addHelperPaths(SPLPEItem *lpeitem, SPDesktop *desktop) } for (std::vector::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { - if ((*p)->paramType() == Inkscape::LivePathEffect::PATH_PARAM) { - SPCurve *c = new SPCurve(static_cast(*p)->get_pathvector()); + if ( Inkscape::LivePathEffect::PathParam *pathparam = dynamic_cast(*p) ) { + SPCurve *c = new SPCurve(pathparam->get_pathvector()); // TODO: factor this out (also the copied code above); see also lpe-lattice.cpp SPCanvasItem *canvasitem = sp_nodepath_generate_helperpath(desktop, c, SP_ITEM(lpeitem), 0x009000ff); @@ -617,7 +616,7 @@ Effect::providesKnotholder() // otherwise: are there any PointParams? for (std::vector::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { - if ((*p)->paramType() == Inkscape::LivePathEffect::POINT_PARAM) { + if ( Inkscape::LivePathEffect::PointParam *pointparam = dynamic_cast(*p) ) { return true; } } diff --git a/src/live_effects/parameter/bool.h b/src/live_effects/parameter/bool.h index 4496740e0..8f5196dad 100644 --- a/src/live_effects/parameter/bool.h +++ b/src/live_effects/parameter/bool.h @@ -28,8 +28,6 @@ public: bool default_value = false); virtual ~BoolParam(); - virtual ParamType paramType() { return BOOL_PARAM; } - virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips); virtual bool param_readSVGValue(const gchar * strvalue); diff --git a/src/live_effects/parameter/enum.h b/src/live_effects/parameter/enum.h index 567eabcbb..aec256f11 100644 --- a/src/live_effects/parameter/enum.h +++ b/src/live_effects/parameter/enum.h @@ -40,8 +40,6 @@ public: virtual ~EnumParam() { }; - virtual ParamType paramType() { return ENUM_PARAM; } - virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * /*tooltips*/) { Inkscape::UI::Widget::RegisteredEnum *regenum = Gtk::manage ( new Inkscape::UI::Widget::RegisteredEnum( param_label, param_tooltip, diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index c4e58c8d5..3b3b14673 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -36,17 +36,6 @@ namespace LivePathEffect { class Effect; -enum ParamType { - GENERAL_PARAM, - SCALAR_PARAM, - BOOL_PARAM, - PATH_PARAM, - POINT_PARAM, - RANDOM_PARAM, - ENUM_PARAM, - INVALID_PARAM -}; - class Parameter { public: Parameter( const Glib::ustring& label, @@ -62,9 +51,6 @@ public: virtual void param_set_default() = 0; - void printTypeName(); - virtual ParamType paramType() { return GENERAL_PARAM; } - // This creates a new widget (newed with Gtk::manage(new ...);) virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips) = 0; @@ -104,8 +90,6 @@ public: gdouble default_value = 1.0); virtual ~ScalarParam(); - virtual ParamType paramType() { return SCALAR_PARAM; } - virtual bool param_readSVGValue(const gchar * strvalue); virtual gchar * param_getSVGValue() const; diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index e2d9c0e19..267ff48ea 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -32,8 +32,6 @@ public: const gchar * default_value = "M0,0 L1,1"); virtual ~PathParam(); - virtual ParamType paramType() { return PATH_PARAM; } - std::vector const & get_pathvector(); Geom::Piecewise > const & get_pwd2(); diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h index 4c0e6e356..90c318b5e 100644 --- a/src/live_effects/parameter/point.h +++ b/src/live_effects/parameter/point.h @@ -34,8 +34,6 @@ public: Geom::Point default_value = Geom::Point(0,0) ); // tip for automatically associated on-canvas handle virtual ~PointParam(); - virtual ParamType paramType() { return POINT_PARAM; } - virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips); bool param_readSVGValue(const gchar * strvalue); diff --git a/src/live_effects/parameter/random.h b/src/live_effects/parameter/random.h index 49b114061..4417a8126 100644 --- a/src/live_effects/parameter/random.h +++ b/src/live_effects/parameter/random.h @@ -29,8 +29,6 @@ public: long default_seed = 0); virtual ~RandomParam(); - virtual ParamType paramType() { return RANDOM_PARAM; } - virtual bool param_readSVGValue(const gchar * strvalue); virtual gchar * param_getSVGValue() const; virtual void param_set_default(); -- 2.30.2