summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-08-01 19:15:16 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-08-01 19:15:16 +0000
commita45a0820bec31c1611da0c8de6ecfec218d2419a (patch)
tree39a36f8323928a800aebc7266cce7e3bfadec308 /src/live_effects
parentreplace matrix division code. (diff)
downloadinkscape-a45a0820bec31c1611da0c8de6ecfec218d2419a.tar.gz
inkscape-a45a0820bec31c1611da0c8de6ecfec218d2419a.zip
2geomify a lot of NR::Points to Geom::Point
(bzr r6513)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-angle_bisector.cpp24
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp24
-rw-r--r--src/live_effects/lpe-parallel.cpp24
-rw-r--r--src/live_effects/lpe-perp_bisector.cpp58
-rw-r--r--src/live_effects/lpe-perspective_path.cpp10
-rw-r--r--src/live_effects/lpe-skeleton.cpp4
-rw-r--r--src/live_effects/lpe-tangent_to_curve.cpp36
-rw-r--r--src/live_effects/lpegroupbbox.cpp2
-rw-r--r--src/live_effects/parameter/point.cpp12
-rw-r--r--src/live_effects/parameter/pointparam-knotholder.cpp15
10 files changed, 104 insertions, 105 deletions
diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp
index 179d46a52..111928d13 100644
--- a/src/live_effects/lpe-angle_bisector.cpp
+++ b/src/live_effects/lpe-angle_bisector.cpp
@@ -33,15 +33,15 @@ namespace AB {
class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
class KnotHolderEntityRightEnd : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
} // namespace TtC
@@ -102,39 +102,39 @@ get_effect(SPItem *item)
}
void
-KnotHolderEntityLeftEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
LPEAngleBisector *lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = Geom::nearest_point(s.to_2geom(), lpe->ptA, lpe->dir);
+ double lambda = Geom::nearest_point(s, lpe->ptA, lpe->dir);
lpe->length_left.param_set_value(-lambda);
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
void
-KnotHolderEntityRightEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
LPEAngleBisector *lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = Geom::nearest_point(s.to_2geom(), lpe->ptA, lpe->dir);
+ double lambda = Geom::nearest_point(s, lpe->ptA, lpe->dir);
lpe->length_right.param_set_value(lambda);
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
-NR::Point
+Geom::Point
KnotHolderEntityLeftEnd::knot_get()
{
LPEAngleBisector *lpe = get_effect(item);
return lpe->ptA - lpe->dir * lpe->length_left;
}
-NR::Point
+Geom::Point
KnotHolderEntityRightEnd::knot_get()
{
LPEAngleBisector *lpe = get_effect(item);
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 5fd33605b..bfb9a7b99 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -29,15 +29,15 @@ namespace CR {
class KnotHolderEntityStartingAngle : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
class KnotHolderEntityRotationAngle : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
} // namespace CR
@@ -144,15 +144,15 @@ get_effect(SPItem *item)
}
void
-KnotHolderEntityStartingAngle::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint state)
+KnotHolderEntityStartingAngle::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
LPECopyRotate* lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
- lpe->starting_angle.param_set_value(rad_to_deg(-angle_between(lpe->dir, s.to_2geom() - lpe->origin)));
+ lpe->starting_angle.param_set_value(rad_to_deg(-angle_between(lpe->dir, s - lpe->origin)));
if (state & GDK_SHIFT_MASK) {
lpe->dist_angle_handle = L2(lpe->B - lpe->A);
} else {
@@ -164,15 +164,15 @@ KnotHolderEntityStartingAngle::knot_set(NR::Point const &p, NR::Point const &/*o
}
void
-KnotHolderEntityRotationAngle::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint state)
+KnotHolderEntityRotationAngle::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
LPECopyRotate* lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
- lpe->rotation_angle.param_set_value(rad_to_deg(-angle_between(lpe->dir, s.to_2geom() - lpe->origin)) - lpe->starting_angle);
+ lpe->rotation_angle.param_set_value(rad_to_deg(-angle_between(lpe->dir, s - lpe->origin)) - lpe->starting_angle);
if (state & GDK_SHIFT_MASK) {
lpe->dist_angle_handle = L2(lpe->B - lpe->A);
} else {
@@ -183,14 +183,14 @@ KnotHolderEntityRotationAngle::knot_set(NR::Point const &p, NR::Point const &/*o
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
-NR::Point
+Geom::Point
KnotHolderEntityStartingAngle::knot_get()
{
LPECopyRotate* lpe = get_effect(item);
return snap_knot_position(lpe->start_pos);
}
-NR::Point
+Geom::Point
KnotHolderEntityRotationAngle::knot_get()
{
LPECopyRotate* lpe = get_effect(item);
diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp
index e6d49b0b2..e169a3b8f 100644
--- a/src/live_effects/lpe-parallel.cpp
+++ b/src/live_effects/lpe-parallel.cpp
@@ -27,15 +27,15 @@ namespace Pl {
class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
class KnotHolderEntityRightEnd : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
} // namespace Pl
@@ -108,43 +108,43 @@ get_effect(SPItem *item)
}
void
-KnotHolderEntityLeftEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
using namespace Geom;
LPEParallel *lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = L2(s - lpe->offset_pt) * sgn(dot(s.to_2geom() - lpe->offset_pt, lpe->dir));
+ double lambda = L2(s - lpe->offset_pt) * sgn(dot(s - lpe->offset_pt, lpe->dir));
lpe->length_left.param_set_value(-lambda);
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
void
-KnotHolderEntityRightEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
using namespace Geom;
LPEParallel *lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = L2(s - lpe->offset_pt) * sgn(dot(s.to_2geom() - lpe->offset_pt, lpe->dir));
+ double lambda = L2(s - lpe->offset_pt) * sgn(dot(s - lpe->offset_pt, lpe->dir));
lpe->length_right.param_set_value(lambda);
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
-NR::Point
+Geom::Point
KnotHolderEntityLeftEnd::knot_get()
{
LPEParallel *lpe = get_effect(item);
return lpe->C;
}
-NR::Point
+Geom::Point
KnotHolderEntityRightEnd::knot_get()
{
LPEParallel *lpe = get_effect(item);
diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp
index f9aca2ada..35c6f0933 100644
--- a/src/live_effects/lpe-perp_bisector.cpp
+++ b/src/live_effects/lpe-perp_bisector.cpp
@@ -27,19 +27,19 @@ namespace PB {
class KnotHolderEntityEnd : public LPEKnotHolderEntity {
public:
- void bisector_end_set(NR::Point const &p, bool left = true);
+ void bisector_end_set(Geom::Point const &p, bool left = true);
};
class KnotHolderEntityLeftEnd : public KnotHolderEntityEnd {
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
class KnotHolderEntityRightEnd : public KnotHolderEntityEnd {
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
// TODO: Make this more generic
@@ -54,27 +54,27 @@ get_effect(SPItem *item)
return static_cast<LPEPerpBisector *>(effect);
}
-NR::Point
+Geom::Point
KnotHolderEntityLeftEnd::knot_get() {
Inkscape::LivePathEffect::LPEPerpBisector *lpe = get_effect(item);
- return NR::Point(lpe->C);
+ return Geom::Point(lpe->C);
}
-NR::Point
+Geom::Point
KnotHolderEntityRightEnd::knot_get() {
Inkscape::LivePathEffect::LPEPerpBisector *lpe = get_effect(item);
- return NR::Point(lpe->D);
+ return Geom::Point(lpe->D);
}
void
-KnotHolderEntityEnd::bisector_end_set(NR::Point const &p, bool left) {
+KnotHolderEntityEnd::bisector_end_set(Geom::Point const &p, bool left) {
Inkscape::LivePathEffect::LPEPerpBisector *lpe =
dynamic_cast<Inkscape::LivePathEffect::LPEPerpBisector *> (sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)));
if (!lpe) return;
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = Geom::nearest_point(s.to_2geom(), lpe->M, lpe->perp_dir);
+ double lambda = Geom::nearest_point(s, lpe->M, lpe->perp_dir);
if (left) {
lpe->C = lpe->M + lpe->perp_dir * lambda;
lpe->length_left.param_set_value(lambda);
@@ -88,48 +88,48 @@ KnotHolderEntityEnd::bisector_end_set(NR::Point const &p, bool left) {
}
void
-KnotHolderEntityLeftEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/) {
+KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/) {
bisector_end_set(p);
}
void
-KnotHolderEntityRightEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/) {
+KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/) {
bisector_end_set(p, false);
}
/**
-NR::Point path_start_get(SPItem *item) {
+Geom::Point path_start_get(SPItem *item) {
Inkscape::LivePathEffect::LPEPerpBisector *lpe =
dynamic_cast<Inkscape::LivePathEffect::LPEPerpBisector *> (sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)));
if (lpe)
- return NR::Point(lpe->A);
+ return Geom::Point(lpe->A);
else
- return NR::Point(0,0);
+ return Geom::Point(0,0);
}
-NR::Point path_end_get(SPItem *item) {
+Geom::Point path_end_get(SPItem *item) {
Inkscape::LivePathEffect::LPEPerpBisector *lpe =
dynamic_cast<Inkscape::LivePathEffect::LPEPerpBisector *> (sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)));
if (lpe)
- return NR::Point(lpe->B);
+ return Geom::Point(lpe->B);
else
- return NR::Point(0,0);
+ return Geom::Point(0,0);
}
void
-path_set_start_end(SPItem *item, NR::Point const &p, bool start) {
+path_set_start_end(SPItem *item, Geom::Point const &p, bool start) {
SPCurve* curve = sp_path_get_curve_for_edit (SP_PATH(item)); // TODO: Should we use sp_shape_get_curve()?
Geom::Matrix const i2d (sp_item_i2d_affine (SP_ITEM(item)));
Geom::Point A, B;
if (start) {
- A = p.to_2geom();
- B = (curve->last_point()).to_2geom();
+ A = p;
+ B = curve->last_point();
} else {
- A = (curve->first_point()).to_2geom();
- B = (p.to_2geom());
+ A = curve->first_point();
+ B = p;
}
SPCurve *c = new SPCurve();
@@ -140,11 +140,11 @@ path_set_start_end(SPItem *item, NR::Point const &p, bool start) {
}
**/
-//void path_start_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/) {
+//void path_start_set(SPItem *item, Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/) {
// path_set_start_end(item, p);
//}
-//void path_end_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/) {
+//void path_end_set(SPItem *item, Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/) {
// path_set_start_end(item, p, false);
//}
@@ -183,8 +183,8 @@ LPEPerpBisector::doOnApply (SPLPEItem */*lpeitem*/)
/**
SPCurve* curve = sp_path_get_curve_for_edit (SP_PATH(lpeitem)); // TODO: Should we use sp_shape_get_curve()?
- Geom::Point A((curve->first_point()).to_2geom());
- Geom::Point B((curve->last_point()).to_2geom());
+ Geom::Point A(curve->first_point());
+ Geom::Point B(curve->last_point());
SPCurve *c = new SPCurve();
c->moveto(A);
diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp
index 998554241..ff487f235 100644
--- a/src/live_effects/lpe-perspective_path.cpp
+++ b/src/live_effects/lpe-perspective_path.cpp
@@ -40,8 +40,8 @@ namespace PP {
class KnotHolderEntityOffset : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
} // namespace PP
@@ -162,13 +162,13 @@ get_effect(SPItem *item)
}
void
-KnotHolderEntityOffset::knot_set(NR::Point const &p, NR::Point const &origin, guint /*state*/)
+KnotHolderEntityOffset::knot_set(Geom::Point const &p, Geom::Point const &origin, guint /*state*/)
{
using namespace Geom;
LPEPerspectivePath* lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
lpe->offsetx.param_set_value((s - origin)[NR::X]);
lpe->offsety.param_set_value(-(s - origin)[NR::Y]); // additional minus sign is due to coordinate system flipping
@@ -177,7 +177,7 @@ KnotHolderEntityOffset::knot_set(NR::Point const &p, NR::Point const &origin, gu
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
-NR::Point
+Geom::Point
KnotHolderEntityOffset::knot_get()
{
LPEPerspectivePath* lpe = get_effect(item);
diff --git a/src/live_effects/lpe-skeleton.cpp b/src/live_effects/lpe-skeleton.cpp
index 5fc4ba6f2..c2ab7be51 100644
--- a/src/live_effects/lpe-skeleton.cpp
+++ b/src/live_effects/lpe-skeleton.cpp
@@ -91,8 +91,8 @@ class KnotHolderEntityMyHandle : public LPEKnotHolderEntity
{
public:
// the set() and get() methods must be implemented, click() is optional
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ 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);
};
diff --git a/src/live_effects/lpe-tangent_to_curve.cpp b/src/live_effects/lpe-tangent_to_curve.cpp
index 0d21b38e0..ede13e2d4 100644
--- a/src/live_effects/lpe-tangent_to_curve.cpp
+++ b/src/live_effects/lpe-tangent_to_curve.cpp
@@ -32,22 +32,22 @@ namespace TtC {
class KnotHolderEntityAttachPt : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
class KnotHolderEntityLeftEnd : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
class KnotHolderEntityRightEnd : public LPEKnotHolderEntity
{
public:
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
};
} // namespace TtC
@@ -111,13 +111,13 @@ get_effect(SPItem *item)
}
void
-KnotHolderEntityAttachPt::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityAttachPt::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
using namespace Geom;
LPETangentToCurve* lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
// FIXME: There must be a better way of converting the path's SPCurve* to pwd2.
SPCurve *curve = sp_path_get_curve_for_edit (SP_PATH(item));
@@ -127,7 +127,7 @@ KnotHolderEntityAttachPt::knot_set(NR::Point const &p, NR::Point const &/*origin
pwd2.concat(pathv[i].toPwSb());
}
- double t0 = nearest_point(s.to_2geom(), pwd2);
+ double t0 = nearest_point(s, pwd2);
lpe->t_attach.param_set_value(t0);
// FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating.
@@ -135,46 +135,46 @@ KnotHolderEntityAttachPt::knot_set(NR::Point const &p, NR::Point const &/*origin
}
void
-KnotHolderEntityLeftEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityLeftEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
LPETangentToCurve *lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = Geom::nearest_point(s.to_2geom(), lpe->ptA, lpe->derivA);
+ double lambda = Geom::nearest_point(s, lpe->ptA, lpe->derivA);
lpe->length_left.param_set_value(-lambda);
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
void
-KnotHolderEntityRightEnd::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+KnotHolderEntityRightEnd::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
LPETangentToCurve *lpe = get_effect(item);
- NR::Point const s = snap_knot_position(p);
+ Geom::Point const s = snap_knot_position(p);
- double lambda = Geom::nearest_point(s.to_2geom(), lpe->ptA, lpe->derivA);
+ double lambda = Geom::nearest_point(s, lpe->ptA, lpe->derivA);
lpe->length_right.param_set_value(lambda);
sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
}
-NR::Point
+Geom::Point
KnotHolderEntityAttachPt::knot_get()
{
LPETangentToCurve* lpe = get_effect(item);
return lpe->ptA;
}
-NR::Point
+Geom::Point
KnotHolderEntityLeftEnd::knot_get()
{
LPETangentToCurve *lpe = get_effect(item);
return lpe->C;
}
-NR::Point
+Geom::Point
KnotHolderEntityRightEnd::knot_get()
{
LPETangentToCurve *lpe = get_effect(item);
diff --git a/src/live_effects/lpegroupbbox.cpp b/src/live_effects/lpegroupbbox.cpp
index 1ec443a5f..e9cf05099 100644
--- a/src/live_effects/lpegroupbbox.cpp
+++ b/src/live_effects/lpegroupbbox.cpp
@@ -32,7 +32,7 @@ GroupBBoxEffect::original_bbox(SPLPEItem *lpeitem, bool absolute)
NR::Maybe<NR::Rect> itemBBox = item->getBounds(transform, SPItem::GEOMETRIC_BBOX);
// NR to Geom glue
- Geom::Rect geomBBox = Geom::Rect(itemBBox->min().to_2geom(), itemBBox->max().to_2geom());
+ Geom::Rect geomBBox = Geom::Rect(itemBBox->min(), itemBBox->max());
boundingbox_X = geomBBox[Geom::X];
boundingbox_Y = geomBBox[Geom::Y];
}
diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp
index 0cb57993e..0c7a701f1 100644
--- a/src/live_effects/parameter/point.cpp
+++ b/src/live_effects/parameter/point.cpp
@@ -138,8 +138,8 @@ public:
PointParamKnotHolderEntity(PointParam *p) { this->pparam = p; }
virtual ~PointParamKnotHolderEntity() {}
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
- virtual NR::Point knot_get();
+ 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);
private:
@@ -147,14 +147,14 @@ private:
};
void
-PointParamKnotHolderEntity::knot_set(NR::Point const &p, NR::Point const &/*origin*/, guint /*state*/)
+PointParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint /*state*/)
{
- NR::Point const s = snap_knot_position(p);
- pparam->param_setValue(s.to_2geom());
+ Geom::Point const s = snap_knot_position(p);
+ pparam->param_setValue(s);
sp_lpe_item_update_patheffect(SP_LPE_ITEM(item), false, false);
}
-NR::Point
+Geom::Point
PointParamKnotHolderEntity::knot_get()
{
return *pparam;
diff --git a/src/live_effects/parameter/pointparam-knotholder.cpp b/src/live_effects/parameter/pointparam-knotholder.cpp
index 434eff4f4..34c149b4b 100644
--- a/src/live_effects/parameter/pointparam-knotholder.cpp
+++ b/src/live_effects/parameter/pointparam-knotholder.cpp
@@ -17,7 +17,6 @@
#include "sp-shape.h"
#include "knot.h"
#include "knotholder.h"
-#include "knot-holder-entity.h"
#include <glibmm/i18n.h>
#include <2geom/point.h>
@@ -30,7 +29,7 @@ class SPDesktop;
namespace Inkscape {
static void pointparam_knot_clicked_handler (SPKnot *knot, guint state, PointParamKnotHolder *kh);
-static void pointparam_knot_moved_handler(SPKnot *knot, NR::Point const *p, guint state, PointParamKnotHolder *kh);
+static void pointparam_knot_moved_handler(SPKnot *knot, Geom::Point const *p, guint state, PointParamKnotHolder *kh);
static void pointparam_knot_ungrabbed_handler (SPKnot *knot, unsigned int state, PointParamKnotHolder *kh);
PointParamKnotHolder::PointParamKnotHolder(SPDesktop *desktop, SPObject *lpeobject, const gchar * key, SPItem *item)
@@ -61,17 +60,17 @@ PointParamKnotHolder::~PointParamKnotHolder()
class KnotHolderEntityPointParam : public LPEKnotHolderEntity {
public:
- virtual NR::Point knot_get();
- virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
+ virtual Geom::Point knot_get();
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
};
-NR::Point
+Geom::Point
KnotHolderEntityPointParam::knot_get() {
- return NR::Point(0,0);
+ return Geom::Point(0,0);
}
void
-KnotHolderEntityPointParam::knot_set(NR::Point const &/*p*/, NR::Point const &/*origin*/, guint /*state*/) {
+KnotHolderEntityPointParam::knot_set(Geom::Point const &/*p*/, Geom::Point const &/*origin*/, guint /*state*/) {
}
void
@@ -110,7 +109,7 @@ static void pointparam_knot_clicked_handler(SPKnot */*knot*/, guint /*state*/, P
* \param p In desktop coordinates.
* This function does not write to XML, but tries to write directly to the PointParam to quickly live update the effect
*/
-static void pointparam_knot_moved_handler(SPKnot */*knot*/, NR::Point const *p, guint /*state*/, PointParamKnotHolder *kh)
+static void pointparam_knot_moved_handler(SPKnot */*knot*/, Geom::Point const *p, guint /*state*/, PointParamKnotHolder *kh)
{
Geom::Matrix const i2d(sp_item_i2d_affine(kh->getItem()));
Geom::Point pos = (*p) * i2d.inverse();