summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1102ed1)
raw | patch | inline | side by side (parent: 1102ed1)
author | verbalshadow <verbalshadow@users.sourceforge.net> | |
Fri, 5 Dec 2008 22:40:41 +0000 (22:40 +0000) | ||
committer | verbalshadow <verbalshadow@users.sourceforge.net> | |
Fri, 5 Dec 2008 22:40:41 +0000 (22:40 +0000) |
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index f7935c7c33c9280230cbbec706f622317be60ea9..0cb9fc423e410469a33994f2364ba0d5a17391ec 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
void
KnotHolder::update_knots()
{
- NR::Matrix const i2d(sp_item_i2d_affine(item));
+ Geom::Matrix const i2d(sp_item_i2d_affine(item));
for(std::list<KnotHolderEntity *>::iterator i = entity.begin(); i != entity.end(); ++i) {
KnotHolderEntity *e = *i;
for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) {
KnotHolderEntity *e = *i;
if (e->knot == knot) {
- NR::Point const q = p * sp_item_i2d_affine(item).inverse();
+ Geom::Point const q = p * sp_item_i2d_affine(item).inverse();
e->knot_set(q, e->knot->drag_origin * sp_item_i2d_affine(item).inverse(), state);
break;
}
diff --git a/src/knotholder.h b/src/knotholder.h
index 25d6d46381f8d83490a5d389ca9c55c6afe540c4..310adab6192b15e87d1ee81fb08056c947333b53 100644 (file)
--- a/src/knotholder.h
+++ b/src/knotholder.h
/**
void knot_clicked_handler(SPKnot *knot, guint state, gpointer data);
-void knot_moved_handler(SPKnot *knot, NR::Point const *p, guint state, gpointer data);
+void knot_moved_handler(SPKnot *knot, Geom::Point const *p, guint state, gpointer data);
void knot_ungrabbed_handler(SPKnot *knot, unsigned int state, KnotHolder *kh);
**/
diff --git a/src/rect-context.cpp b/src/rect-context.cpp
index 93e7e8470905f4c7ace2660ad4577b3b01d60b14..5d2a353d924a5127ebf24e6638ebf38306eee89e 100644 (file)
--- a/src/rect-context.cpp
+++ b/src/rect-context.cpp
static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent *event);
static gint sp_rect_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event);
-static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state);
+static void sp_rect_drag(SPRectContext &rc, Geom::Point const pt, guint state);
static void sp_rect_finish(SPRectContext *rc);
static SPEventContextClass *parent_class;
@@ -285,12 +285,12 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
switch (event->type) {
case GDK_BUTTON_PRESS:
if (event->button.button == 1 && !event_context->space_panning) {
- NR::Point const button_w(event->button.x,
+ Geom::Point const button_w(event->button.x,
event->button.y);
// save drag origin
- event_context->xp = (gint) button_w[NR::X];
- event_context->yp = (gint) button_w[NR::Y];
+ event_context->xp = (gint) button_w[Geom::X];
+ event_context->yp = (gint) button_w[Geom::Y];
event_context->within_tolerance = true;
// remember clicked item, disregarding groups, honoring Alt
@@ -333,8 +333,8 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
// motion notify coordinates as given (no snapping back to origin)
event_context->within_tolerance = false;
- NR::Point const motion_w(event->motion.x, event->motion.y);
- NR::Point motion_dt(desktop->w2d(motion_w));
+ Geom::Point const motion_w(event->motion.x, event->motion.y);
+ Geom::Point motion_dt(desktop->w2d(motion_w));
sp_rect_drag(*rc, motion_dt, event->motion.state); // this will also handle the snapping
gobble_motion_events(GDK_BUTTON1_MASK);
@@ -460,7 +460,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
return ret;
}
-static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state)
+static void sp_rect_drag(SPRectContext &rc, Geom::Point const pt, guint state)
{
SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop;
diff --git a/src/rect-context.h b/src/rect-context.h
index ae2680f8f6fbceefdafb652356e8c77cb4a83c3d..0445338bf088b30c42d86ac7804632f7fc6dcb00 100644 (file)
--- a/src/rect-context.h
+++ b/src/rect-context.h
struct SPRectContext : public SPEventContext {
SPItem *item;
- NR::Point center;
+ Geom::Point center;
gdouble rx; /* roundness radius (x direction) */
gdouble ry; /* roundness radius (y direction) */
index fbc4a93ca5e554b39823f89dc7d86a58a2cde5b2..49d6fbcdbc67e8823b9cd996974555c165f34591 100644 (file)
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
}
void
-SPConnEndPair::getEndpoints(NR::Point endPts[]) const {
+SPConnEndPair::getEndpoints(Geom::Point endPts[]) const {
SPCurve *curve = _path->curve;
SPItem *h2attItem[2];
getAttachedItems(h2attItem);
endPts[h] = bbox->midpoint();
} else {
// FIXME
- endPts[h] = NR::Point(0, 0);
+ endPts[h] = Geom::Point(0, 0);
}
}
else
if (_connType != SP_CONNECTOR_NOAVOID) {
g_assert(_connRef != NULL);
if (!(_connRef->isInitialised())) {
- NR::Point endPt[2];
+ Geom::Point endPt[2];
getEndpoints(endPt);
- Avoid::Point src(endPt[0][NR::X], endPt[0][NR::Y]);
- Avoid::Point dst(endPt[1][NR::X], endPt[1][NR::Y]);
+ Avoid::Point src(endPt[0][Geom::X], endPt[0][Geom::Y]);
+ Avoid::Point dst(endPt[1][Geom::X], endPt[1][Geom::Y]);
_connRef->lateSetup(src, dst);
_connRef->setCallback(&emitPathInvalidationNotification, _path);
SPCurve *curve = _path->curve;
- NR::Point endPt[2];
+ Geom::Point endPt[2];
getEndpoints(endPt);
- Avoid::Point src(endPt[0][NR::X], endPt[0][NR::Y]);
- Avoid::Point dst(endPt[1][NR::X], endPt[1][NR::Y]);
+ Avoid::Point src(endPt[0][Geom::X], endPt[0][Geom::Y]);
+ Avoid::Point dst(endPt[1][Geom::X], endPt[1][Geom::Y]);
_connRef->updateEndPoint(Avoid::VertID::src, src);
_connRef->updateEndPoint(Avoid::VertID::tar, dst);
curve->moveto(endPt[0]);
for (int i = 1; i < route.pn; ++i) {
- NR::Point p(route.ps[i].x, route.ps[i].y);
+ Geom::Point p(route.ps[i].x, route.ps[i].y);
curve->lineto(p);
}
}
diff --git a/src/sp-conn-end-pair.h b/src/sp-conn-end-pair.h
index 3f130da32661058a37e0c22e9e20c2e93a2282bf..9b9e181db9b3dfc359bc6d0e81643945c1c059fc 100644 (file)
--- a/src/sp-conn-end-pair.h
+++ b/src/sp-conn-end-pair.h
void setAttr(unsigned const key, gchar const *const value);
void writeRepr(Inkscape::XML::Node *const repr) const;
void getAttachedItems(SPItem *[2]) const;
- void getEndpoints(NR::Point endPts[]) const;
+ void getEndpoints(Geom::Point endPts[]) const;
void reroutePath(void);
void makePathInvalid(void);
void update(void);
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index bee7e1b5d6279290b53cb60a58c5237a095a52aa..c7ed88513a4ae8e51e520e78a9a16358c05962d6 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -264,7 +264,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, I
SPGenericEllipse *ellipse = SP_GENERICELLIPSE(item);
sp_genericellipse_normalize(ellipse);
- NR::Matrix const i2d = sp_item_i2d_affine(item);
+ Geom::Matrix const i2d = sp_item_i2d_affine(item);
// figure out if we have a slice, whilst guarding against rounding errors
bool slice = false;
@@ -287,7 +287,7 @@ static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, I
double angle = 0;
for (angle = 0; angle < SP_2PI; angle += M_PI_2) {
if (angle >= ellipse->start && angle <= ellipse->end) {
- *p = NR::Point(cx + cos(angle)*rx, cy + sin(angle)*ry) * i2d;
+ *p = Geom::Point(cx + cos(angle)*rx, cy + sin(angle)*ry) * i2d;
}
}
@@ -295,15 +295,15 @@ static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, I
if (slice) {
// Add the centre, if we have a closed slice
if (ellipse->closed) {
- *p = NR::Point(cx, cy) * i2d;
+ *p = Geom::Point(cx, cy) * i2d;
}
// Add the start point, if it's not coincident with a quadrant point
if (fmod(ellipse->start, M_PI_2) != 0.0 ) {
- *p = NR::Point(cx + cos(ellipse->start)*rx, cy + sin(ellipse->start)*ry) * i2d;
+ *p = Geom::Point(cx + cos(ellipse->start)*rx, cy + sin(ellipse->start)*ry) * i2d;
}
// Add the end point, if it's not coincident with a quadrant point
if (fmod(ellipse->end, M_PI_2) != 0.0 ) {
- *p = NR::Point(cx + cos(ellipse->end)*rx, cy + sin(ellipse->end)*ry) * i2d;
+ *p = Geom::Point(cx + cos(ellipse->end)*rx, cy + sin(ellipse->end)*ry) * i2d;
}
}
}
Inkscape::SVG::PathString str;
- NR::Point p1 = sp_arc_get_xy(arc, ge->start);
- NR::Point p2 = sp_arc_get_xy(arc, ge->end);
+ Geom::Point p1 = sp_arc_get_xy(arc, ge->start);
+ Geom::Point p2 = sp_arc_get_xy(arc, ge->end);
double rx = ge->rx.computed;
double ry = ge->ry.computed;
double dt = fmod(ge->end - ge->start, SP_2PI);
if (fabs(dt) < 1e-6) {
- NR::Point ph = sp_arc_get_xy(arc, (ge->start + ge->end) / 2.0);
+ Geom::Point ph = sp_arc_get_xy(arc, (ge->start + ge->end) / 2.0);
str.arcTo(rx, ry, 0, true, true, ph)
.arcTo(rx, ry, 0, true, true, p2)
.closePath();
bool fs = (dt > 0);
str.arcTo(rx, ry, 0, fa, fs, p2);
if (ge->closed) {
- NR::Point center = NR::Point(ge->cx.computed, ge->cy.computed);
+ Geom::Point center = Geom::Point(ge->cx.computed, ge->cy.computed);
str.lineTo(center).closePath();
}
}
((SPObject *)arc)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
-NR::Point sp_arc_get_xy(SPArc *arc, gdouble arg)
+Geom::Point sp_arc_get_xy(SPArc *arc, gdouble arg)
{
SPGenericEllipse *ge = SP_GENERICELLIPSE(arc);
- return NR::Point(ge->rx.computed * cos(arg) + ge->cx.computed,
+ return Geom::Point(ge->rx.computed * cos(arg) + ge->cx.computed,
ge->ry.computed * sin(arg) + ge->cy.computed);
}
diff --git a/src/sp-ellipse.h b/src/sp-ellipse.h
index a1f79e6f5e652114f03b3c32ee117c7d5e388c7c..91354ab608e546db9f6b3560f633ee127f0a0d57 100644 (file)
--- a/src/sp-ellipse.h
+++ b/src/sp-ellipse.h
GType sp_arc_get_type (void);
void sp_arc_position_set (SPArc * arc, gdouble x, gdouble y, gdouble rx, gdouble ry);
-NR::Point sp_arc_get_xy (SPArc *ge, gdouble arg);
+Geom::Point sp_arc_get_xy (SPArc *ge, gdouble arg);
#endif