summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9a493a9)
raw | patch | inline | side by side (parent: 9a493a9)
author | Johan Engelen <goejendaagh@zonnet.nl> | |
Mon, 26 Jul 2010 23:43:02 +0000 (01:43 +0200) | ||
committer | Johan Engelen <goejendaagh@zonnet.nl> | |
Mon, 26 Jul 2010 23:43:02 +0000 (01:43 +0200) |
index c3de621eefdccc53e388f3aca4ec5c72b866a1d8..b349f9aa6c5b0b1958fc50b23c0df4d7d446a234 100644 (file)
Effect(lpeobject),
offset_1(_("Start Offset"), _("Handle to control the distance of the offset from the curve"), "offset_1", &wr, this),
offset_2(_("End Offset"), _("Handle to control the distance of the offset from the curve"), "offset_2", &wr, this),
- offset_3(_("End Offset"), _("Handle to control the distance of the offset from the curve"), "offset_3", &wr, this)
-// offset_points(_("Offset points"), _("Offset points"), "offset_points", &wr, this)
+ offset_3(_("End Offset"), _("Handle to control the distance of the offset from the curve"), "offset_3", &wr, this),
+ offset_points(_("Offset points"), _("Offset points"), "offset_points", &wr, this)
{
show_orig_path = true;
registerParameter( dynamic_cast<Parameter *>(&offset_1) );
registerParameter( dynamic_cast<Parameter *>(&offset_2) );
registerParameter( dynamic_cast<Parameter *>(&offset_3) );
-// registerParameter( dynamic_cast<Parameter *>(&offset_points) );
-
- /* register all your knotholder handles here: */
- //registerKnotHolderHandle(new PowerStroke::KnotHolderEntityAttachMyHandle(), _("help message"));
+ registerParameter( dynamic_cast<Parameter *>(&offset_points) );
}
LPEPowerStroke::~LPEPowerStroke()
@@ -119,26 +116,6 @@ LPEPowerStroke::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const &
return output;
}
-
-/* ########################
- * Define the classes for your knotholder handles here
- */
-
-/*
-namespace PowerStroke {
-
-class KnotHolderEntityMyHandle : public LPEKnotHolderEntity
-{
-public:
- // the set() and get() methods must be implemented, click() is optional
- virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
- virtual Geom::Point knot_get();
- //virtual void knot_click(guint state);
-};
-
-} // namespace PowerStroke
-*/
-
/* ######################## */
} //namespace LivePathEffect
index 9c6e3effe9065e71a2a3d6b3008b94077e3cb15e..811c63259e345251a74988e61b06fa19461f0eb4 100644 (file)
#include "live_effects/effect.h"
#include "live_effects/parameter/point.h"
-#include "live_effects/parameter/array.h"
+#include "live_effects/parameter/powerstrokepointarray.h"
namespace Inkscape {
namespace LivePathEffect {
-// each knotholder handle for your LPE requires a separate class derived from KnotHolderEntity;
-// define it in lpe-powerstroke.cpp and register it in the effect's constructor
-/**
-namespace PowerStroke {
- // we need a separate namespace to avoid clashes with other LPEs
- class KnotHolderEntityMyHandle;
-}
-**/
-
class LPEPowerStroke : public Effect {
public:
LPEPowerStroke(LivePathEffectObject *lpeobject);
virtual void doOnApply(SPLPEItem *lpeitem);
- /* the knotholder entity classes (if any) must be declared friends */
- //friend class PowerStroke::KnotHolderEntityMyHandle;
-
private:
PointParam offset_1;
PointParam offset_2;
PointParam offset_3;
-// ArrayParam<Geom::Point> offset_points;
+ PowerStrokePointArrayParam offset_points;
LPEPowerStroke(const LPEPowerStroke&);
LPEPowerStroke& operator=(const LPEPowerStroke&);
index 2fa0d5bc698747cb2ce8896a044881b095f423ca..8657b2bec26cddf15aafe072c4c0eb737271861f 100644 (file)
path.cpp
path-reference.cpp
point.cpp
+powerstrokepointarray.cpp
random.cpp
text.cpp
unit.cpp
diff --git a/src/live_effects/parameter/Makefile_insert b/src/live_effects/parameter/Makefile_insert
index 74b166e8b152c1f6ffdcda3179200ab298b365d1..99cd88d62db4dcf08b8b925e61486b7c82dab07b 100644 (file)
live_effects/parameter/path-reference.h \
live_effects/parameter/path.cpp \
live_effects/parameter/path.h \
+ live_effects/parameter/powerstrokepointarray.cpp \
+ live_effects/parameter/powerstrokepointarray.h \
live_effects/parameter/text.cpp \
live_effects/parameter/text.h \
live_effects/parameter/unit.cpp \
index c576bedd5c1d72d10ffd1c1dbf9ecf3eab186914..d1c30edf719bbdf79aac484336a1a6aae0e2b65f 100644 (file)
#include "svg/stringstream.h"
#include <2geom/coord.h>
+#include <2geom/point.h>
namespace Inkscape {
return newx;
}
+template <>
+Geom::Point
+ArrayParam<Geom::Point>::readsvg(const gchar * str)
+{
+ gchar ** strarray = g_strsplit(str, ",", 2);
+ double newx, newy;
+ unsigned int success = sp_svg_number_read_d(strarray[0], &newx);
+ success += sp_svg_number_read_d(strarray[1], &newy);
+ g_strfreev (strarray);
+ if (success == 2) {
+ return Geom::Point(newx, newy);
+ }
+ return Geom::Point(Geom::infinity(),Geom::infinity());
+}
+
} /* namespace LivePathEffect */
} /* namespace Inkscape */