summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 658c306)
raw | patch | inline | side by side (parent: 658c306)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 20 Jul 2008 19:02:23 +0000 (19:02 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 20 Jul 2008 19:02:23 +0000 (19:02 +0000) |
index ad9024772bd0483c8fec0d223c231530941b3176..85f392321559418b2663c5edfe9d6b181a692a03 100644 (file)
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());
}
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);
// 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;
}
}
index 4496740e00ac028cce73a01db9d576ed4c8a4071..8f5196dadf49da1132fd185375727f02de20bf2c 100644 (file)
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);
index 567eabcbb13bcfc953c096e3208669090e1b6770..aec256f11cca141fab76134c3432d5ea2ed3fcd0 100644 (file)
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,
index c4e58c8d5d21ae3d5d3cb82ef055a9dfca7f483d..3b3b1467395429eecc851ca4fd874d1942953e98 100644 (file)
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,
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;
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;
index e2d9c0e19074880485d637b651e1c20a59bbd18e..267ff48eae2d2ddecc787134ea5f6b3fea788986 100644 (file)
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();
index 4c0e6e356f016e8cc2a078267feaec00a1cfdfbb..90c318b5ee19919938e09e680912fe9cb93b28c6 100644 (file)
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);
index 49b1140617689119bf694e21e0dd4c10dafe06ee..4417a812618a1857519a19a23e904bb0741650ad 100644 (file)
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();