1
#ifndef INKSCAPE_LIVEPATHEFFECT_H
2
#define INKSCAPE_LIVEPATHEFFECT_H
5
* Inkscape::LivePathEffect
7
* Copyright (C) Johan Engelen 2007-2008 <j.b.c.engelen@utwente.nl>
9
* Released under GNU GPL, read the file 'COPYING' for more information
13
#include "display/display-forward.h"
15
#include <glibmm/ustring.h>
16
#include <2geom/path.h>
17
#include "ui/widget/registry.h"
18
#include "util/enums.h"
20
#define LPE_CONVERSION_TOLERANCE 0.01 // FIXME: find good solution for this.
22
//#define LPE_ENABLE_TEST_EFFECTS
28
struct LivePathEffectObject;
50
namespace LivePathEffect {
55
#ifdef LPE_ENABLE_TEST_EFFECTS
61
INVALID_LPE // This must be last
64
extern const Util::EnumData<EffectType> LPETypeData[INVALID_LPE];
65
extern const Util::EnumDataConverter<EffectType> LPETypeConverter;
71
static Effect* New(EffectType lpenr, LivePathEffectObject *lpeobj);
75
virtual void doEffect (SPCurve * curve);
77
virtual Gtk::Widget * newWidget(Gtk::Tooltips * tooltips);
79
virtual void resetDefaults(SPItem * item);
81
virtual void setup_nodepath(Inkscape::NodePath::Path *np);
83
virtual void transform_multiply(Geom::Matrix const& postmul, bool set);
85
Glib::ustring getName();
86
Inkscape::XML::Node * getRepr();
87
SPDocument * getSPDoc();
88
LivePathEffectObject * getLPEObj() {return lpeobj;};
89
Parameter * getParameter(const char * key);
91
void readallParameters(Inkscape::XML::Node * repr);
92
void setParameter(const gchar * key, const gchar * new_value);
94
void editNextParamOncanvas(SPItem * item, SPDesktop * desktop);
97
Effect(LivePathEffectObject *lpeobject);
99
// provide a set of doEffect functions so the developer has a choice
100
// of what kind of input/output parameters he desires.
101
// the order in which they appear is the order in which they are
102
// called by this base class. (i.e. doEffect(SPCurve * curve) defaults to calling
103
// doEffect(std::vector<Geom::Path> )
105
doEffect_nartbpath (NArtBpath * path_in);
106
virtual std::vector<Geom::Path>
107
doEffect_path (std::vector<Geom::Path> & path_in);
108
virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
109
doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
111
void registerParameter(Parameter * param);
112
Parameter * getNextOncanvasEditableParam();
114
std::vector<Parameter *> param_vector;
118
Inkscape::UI::Widget::Registry wr;
120
LivePathEffectObject *lpeobj;
123
Effect(const Effect&);
124
Effect& operator=(const Effect&);
128
} //namespace LivePathEffect
129
} //namespace Inkscape