summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-parallel.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
committerMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
commit5a4fb2325f60d292b47330f540b26a3279341c90 (patch)
treed2aa7967be25450b83e625025366c618101ae49f /src/live_effects/lpe-parallel.cpp
parentThe Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff)
parentRemove Snap menu item and improve grid menu item text (diff)
downloadinkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz
inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/live_effects/lpe-parallel.cpp')
-rw-r--r--src/live_effects/lpe-parallel.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp
index 95340fcf4..bb37fd42c 100644
--- a/src/live_effects/lpe-parallel.cpp
+++ b/src/live_effects/lpe-parallel.cpp
@@ -1,4 +1,3 @@
-#define INKSCAPE_LPE_PARALLEL_CPP
/** \file
* LPE <parallel> implementation
*/
@@ -12,6 +11,8 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <glibmm/i18n.h>
+
#include "live_effects/lpe-parallel.h"
#include "sp-shape.h"
#include "display/curve.h"
@@ -31,14 +32,14 @@ class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity {
public:
KnotHolderEntityLeftEnd(LPEParallel *effect) : LPEKnotHolderEntity(effect) {};
virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
- virtual Geom::Point knot_get();
+ virtual Geom::Point knot_get() const;
};
class KnotHolderEntityRightEnd : public LPEKnotHolderEntity {
public:
KnotHolderEntityRightEnd(LPEParallel *effect) : LPEKnotHolderEntity(effect) {};
virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
- virtual Geom::Point knot_get();
+ virtual Geom::Point knot_get() const;
};
} // namespace Pl
@@ -47,8 +48,8 @@ LPEParallel::LPEParallel(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
// initialise your parameters here:
offset_pt(_("Offset"), _("Adjust the offset"), "offset_pt", &wr, this),
- length_left(_("Length left"), _("Specifies the left end of the parallel"), "length-left", &wr, this, 150),
- length_right(_("Length right"), _("Specifies the right end of the parallel"), "length-right", &wr, this, 150)
+ length_left(_("Length left:"), _("Specifies the left end of the parallel"), "length-left", &wr, this, 150),
+ length_right(_("Length right:"), _("Specifies the right end of the parallel"), "length-right", &wr, this, 150)
{
show_orig_path = true;
_provides_knotholder_entities = true;
@@ -64,7 +65,7 @@ LPEParallel::~LPEParallel()
}
void
-LPEParallel::doOnApply (SPLPEItem *lpeitem)
+LPEParallel::doOnApply (SPLPEItem const* lpeitem)
{
SPCurve const *curve = SP_SHAPE(lpeitem)->_curve;
@@ -112,13 +113,13 @@ void LPEParallel::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *deskt
namespace Pl {
void
-KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
using namespace Geom;
LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect);
- Geom::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p, state);
double lambda = L2(s - lpe->offset_pt) * sgn(dot(s - lpe->offset_pt, lpe->dir));
lpe->length_left.param_set_value(-lambda);
@@ -127,13 +128,13 @@ KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*ori
}
void
-KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
using namespace Geom;
LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect);
- Geom::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p, state);
double lambda = L2(s - lpe->offset_pt) * sgn(dot(s - lpe->offset_pt, lpe->dir));
lpe->length_right.param_set_value(lambda);
@@ -142,16 +143,16 @@ KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*or
}
Geom::Point
-KnotHolderEntityLeftEnd::knot_get()
+KnotHolderEntityLeftEnd::knot_get() const
{
- LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect);
+ LPEParallel const *lpe = dynamic_cast<LPEParallel const*>(_effect);
return lpe->C;
}
Geom::Point
-KnotHolderEntityRightEnd::knot_get()
+KnotHolderEntityRightEnd::knot_get() const
{
- LPEParallel *lpe = dynamic_cast<LPEParallel *>(_effect);
+ LPEParallel const *lpe = dynamic_cast<LPEParallel const*>(_effect);
return lpe->D;
}