Code

powerstroke: redefine meaning of offset point parameter values. now knots move with...
[inkscape.git] / src / live_effects / parameter / powerstrokepointarray.h
1 #ifndef INKSCAPE_LIVEPATHEFFECT_POWERSTROKE_POINT_ARRAY_H
2 #define INKSCAPE_LIVEPATHEFFECT_POWERSTROKE_POINT_ARRAY_H
4 /*
5  * Inkscape::LivePathEffectParameters
6  *
7 * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
8  *
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #include <glib/gtypes.h>
13 #include <2geom/point.h>
15 #include <gtkmm/tooltips.h>
17 #include "live_effects/parameter/array.h"
19 #include "knot-holder-entity.h"
21 namespace Inkscape {
23 namespace LivePathEffect {
25 class PowerStrokePointArrayParamKnotHolderEntity;
27 class PowerStrokePointArrayParam : public ArrayParam<Geom::Point> {
28 public:
29     PowerStrokePointArrayParam( const Glib::ustring& label,
30                 const Glib::ustring& tip,
31                 const Glib::ustring& key,
32                 Inkscape::UI::Widget::Registry* wr,
33                 Effect* effect,
34                 const gchar *handle_tip = NULL); // tip for automatically associated on-canvas handle
35     virtual ~PowerStrokePointArrayParam();
37     virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips);
39     virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/);
41     void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color);
43     virtual bool providesKnotHolderEntities() { return true; }
44     virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item);
46     void set_pwd2(Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in) { last_pwd2 = pwd2_in; }
47     Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2() { return last_pwd2; }
48     void set_pwd2_normal(Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in) { last_pwd2_normal = pwd2_in; }
49     Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2_normal() { return last_pwd2_normal; }
51     friend class PowerStrokePointArrayParamKnotHolderEntity;
53 private:
54     PowerStrokePointArrayParam(const PowerStrokePointArrayParam&);
55     PowerStrokePointArrayParam& operator=(const PowerStrokePointArrayParam&);
57     SPKnotShapeType knot_shape;
58     SPKnotModeType knot_mode;
59     guint32 knot_color;
60     gchar *handle_tip;
62     Geom::Piecewise<Geom::D2<Geom::SBasis> > last_pwd2;
63     Geom::Piecewise<Geom::D2<Geom::SBasis> > last_pwd2_normal;
64 };
67 } //namespace LivePathEffect
69 } //namespace Inkscape
71 #endif