summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-20 19:02:23 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-20 19:02:23 +0000
commitb598f6ee0c07654733dd7ceecc3990cd5c6f50f3 (patch)
tree9beba81a4da5f8725ac73dc57e61284203c41396 /src
parentoptimize nodepath editing of lpe pathparam's a bit. (diff)
downloadinkscape-b598f6ee0c07654733dd7ceecc3990cd5c6f50f3.tar.gz
inkscape-b598f6ee0c07654733dd7ceecc3990cd5c6f50f3.zip
purge LivePathEffect::PathType
(bzr r6373)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp9
-rw-r--r--src/live_effects/parameter/bool.h2
-rw-r--r--src/live_effects/parameter/enum.h2
-rw-r--r--src/live_effects/parameter/parameter.h16
-rw-r--r--src/live_effects/parameter/path.h2
-rw-r--r--src/live_effects/parameter/point.h2
-rw-r--r--src/live_effects/parameter/random.h2
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<Parameter *>::iterator p = param_vector.begin(); p != param_vector.end(); ++p) {
- if ((*p)->paramType() == POINT_PARAM) {
- PointParam *pparam = static_cast<PointParam *>(*p);
+ if ( Inkscape::LivePathEffect::PointParam *pparam = dynamic_cast<Inkscape::LivePathEffect::PointParam*>(*p) ) {
KnotHolderEntity *e = dynamic_cast<KnotHolderEntity *>(*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<Parameter *>::iterator p = param_vector.begin(); p != param_vector.end(); ++p) {
- if ((*p)->paramType() == Inkscape::LivePathEffect::PATH_PARAM) {
- SPCurve *c = new SPCurve(static_cast<Inkscape::LivePathEffect::PathParam*>(*p)->get_pathvector());
+ if ( Inkscape::LivePathEffect::PathParam *pathparam = dynamic_cast<Inkscape::LivePathEffect::PathParam*>(*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<Parameter *>::iterator p = param_vector.begin(); p != param_vector.end(); ++p) {
- if ((*p)->paramType() == Inkscape::LivePathEffect::POINT_PARAM) {
+ if ( Inkscape::LivePathEffect::PointParam *pointparam = dynamic_cast<Inkscape::LivePathEffect::PointParam*>(*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<E> *regenum = Gtk::manage (
new Inkscape::UI::Widget::RegisteredEnum<E>( 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<Geom::Path> const & get_pathvector();
Geom::Piecewise<Geom::D2<Geom::SBasis> > 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();