Code

NR::LInfty => Geom::
authorjohanengelen <johanengelen@users.sourceforge.net>
Fri, 5 Dec 2008 19:57:37 +0000 (19:57 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Fri, 5 Dec 2008 19:57:37 +0000 (19:57 +0000)
src/draw-anchor.cpp
src/libnr/in-svg-plane.h
src/livarot/PathConversion.cpp
src/livarot/PathCutting.cpp
src/livarot/PathOutline.cpp
src/livarot/PathSimplify.cpp
src/livarot/PathStroke.cpp
src/pen-context.cpp
src/pencil-context.cpp

index f4abd596e4f30c45e8654c3923133d4efaeaf057..c6590ac44d422272d99c82a8bbd5bbb0561dcd9f 100644 (file)
@@ -82,7 +82,7 @@ sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, gboolean activate)
 {
     SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(anchor->dc);
 
-    if ( activate && ( NR::LInfty( w - dt->d2w(anchor->dp) ) <= A_SNAP ) ) {
+    if ( activate && ( Geom::LInfty( w - dt->d2w(anchor->dp) ) <= A_SNAP ) ) {
         if (!anchor->active) {
             sp_canvas_item_set((GtkObject *) anchor->ctrl, "filled", TRUE, NULL);
             anchor->active = TRUE;
index 901fc748fbac77f8e7774ef2b72ce3029b3c525e..d184f45be700351ce00a532253f1ab65dd463767 100644 (file)
@@ -15,7 +15,7 @@
 inline bool
 in_svg_plane(NR::Point const p)
 {
-    return NR::LInfty(p) < 1e18;
+    return Geom::LInfty(p) < 1e18;
 }
 
 
index a7f5a8fd18dc387ce897bf97ce25ee714f56d5ca..4ae4afe8610a29ae82bd04c31127a6fefb308a1c 100644 (file)
@@ -906,7 +906,7 @@ void Path::ConvertEvenLines(double treshhold)
                 break;
             }
         }
-        if ( NR::LInfty(curX - nextX) > 0.00001 ) {
+        if ( Geom::LInfty(curX - nextX) > 0.00001 ) {
             curX = nextX;
         }
     }
@@ -1604,7 +1604,7 @@ void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool
 
                     } else {
 
-                        if ( NR::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
+                        if ( Geom::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
                             lEdge = dest->AddEdge(first + curP, first + pathEnd);
                             if ( lEdge >= 0 ) {
                                 dest->ebData[lEdge].pathID = pathID;
@@ -1618,7 +1618,7 @@ void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool
                                 }
                             }
                             pathEnd = curP;
-                            if ( NR::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
+                            if ( Geom::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
                                 closed = true;
                             } else {
                                 closed = false;
@@ -1676,10 +1676,10 @@ void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool
                         closed = false;
                         lEdge = -1;
                     } else {
-                        if ( NR::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
+                        if ( Geom::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
                             lEdge = dest->AddEdge(first+curP, first+pathEnd);
                             pathEnd = curP;
-                            if ( NR::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
+                            if ( Geom::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
                                 closed = true;
                             } else {
                                 closed = false;
@@ -1739,7 +1739,7 @@ void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool
                         closed = false;
                         lEdge = -1;
                     } else {
-                        if ( NR::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
+                        if ( Geom::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
                             lEdge = dest->AddEdge(first + pathEnd, first + curP);
                             dest->ebData[lEdge].pathID = pathID;
                             dest->ebData[lEdge].pieceID = pts[sbp].piece;
@@ -1751,7 +1751,7 @@ void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool
                                 dest->ebData[lEdge].tEn = pts[sbp].t;
                             }
                             pathEnd = curP;
-                            if ( NR::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
+                            if ( Geom::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
                                 closed = true;
                             } else {
                                 closed = false;
@@ -1808,10 +1808,10 @@ void Path::Fill(Shape* dest, int pathID, bool justAdd, bool closeIfNeeded, bool
                         closed = false;
                         lEdge = -1;
                     } else {
-                        if ( NR::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
+                        if ( Geom::LInfty(pts[sbp].p - pts[prp].p) >= 0.00001 ) {
                             lEdge = dest->AddEdge(first+pathEnd, first+curP);
                             pathEnd = curP;
-                            if ( NR::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
+                            if ( Geom::LInfty(pts[sbp].p - pts[lm].p) < 0.00001 ) {
                                 closed = true;
                             } else {
                                 closed = false;
index 0a367a1fed832d0837577935892dd86d443730ce..025cf00a78a52fa03f6fa25a642054260c16faf3 100644 (file)
@@ -1413,7 +1413,7 @@ void        Path::ConvertPositionsToMoveTo(int nbPos,cut_position* poss)
         } else {
         }
       }
-      if ( NR::LInfty(endP-np) < 0.00001 ) {
+      if ( Geom::LInfty(endP-np) < 0.00001 ) {
         doesClose=true;
       }
       if ( ( doesClose || hasClose ) && hasForced >= 0 ) {
index 7ac9a7e7b2ec76aa0932df7d3249a9f43dcbbf57..67b5370f24df57f2a851c455c39c590fa048cb8f 100644 (file)
@@ -386,7 +386,7 @@ void Path::SubContractOutline(int off, int num_pd,
                        if (doFirst) {
                        } else {
                                if (closeIfNeeded) {
-                                       if ( NR::LInfty (curX- firstP) < 0.0001 ) {
+                                       if ( Geom::LInfty (curX- firstP) < 0.0001 ) {
                                                OutlineJoin (dest, firstP, curT, firstT, width, join,
                                                                         miter);
                                                dest->Close ();
@@ -427,7 +427,7 @@ void Path::SubContractOutline(int off, int num_pd,
                {
                        if (doFirst == false)
                        {
-                               if (NR::LInfty (curX - firstP) < 0.0001)
+                               if (Geom::LInfty (curX - firstP) < 0.0001)
                                {
                                        OutlineJoin (dest, firstP, curT, firstT, width, join,
                                                                 miter);
@@ -828,7 +828,7 @@ Path::IsNulCurve (std::vector<PathDescr*> const &cmd, int curD, NR::Point const
     case descr_lineto:
     {
                PathDescrLineTo *nData = dynamic_cast<PathDescrLineTo*>(cmd[curD]);
-               if (NR::LInfty(nData->p - curX) < 0.00001) {
+               if (Geom::LInfty(nData->p - curX) < 0.00001) {
                        return true;
                }
                return false;
@@ -839,9 +839,9 @@ Path::IsNulCurve (std::vector<PathDescr*> const &cmd, int curD, NR::Point const
                NR::Point A = nData->start + nData->end + 2*(curX - nData->p);
                NR::Point B = 3*(nData->p - curX) - 2*nData->start - nData->end;
                NR::Point C = nData->start;
-               if (NR::LInfty(A) < 0.0001
-                       && NR::LInfty(B) < 0.0001
-                       && NR::LInfty (C) < 0.0001) {
+               if (Geom::LInfty(A) < 0.0001
+                       && Geom::LInfty(B) < 0.0001
+                       && Geom::LInfty (C) < 0.0001) {
                        return true;
                }
                return false;
@@ -849,7 +849,7 @@ Path::IsNulCurve (std::vector<PathDescr*> const &cmd, int curD, NR::Point const
     case descr_arcto:
     {
                PathDescrArcTo* nData = dynamic_cast<PathDescrArcTo*>(cmd[curD]);
-               if ( NR::LInfty(nData->p - curX) < 0.00001) {
+               if ( Geom::LInfty(nData->p - curX) < 0.00001) {
                        if ((nData->large == false)
                                || (fabs (nData->rx) < 0.00001
                                        || fabs (nData->ry) < 0.00001)) {
@@ -863,26 +863,26 @@ Path::IsNulCurve (std::vector<PathDescr*> const &cmd, int curD, NR::Point const
                PathDescrBezierTo* nBData = dynamic_cast<PathDescrBezierTo*>(cmd[curD]);
                if (nBData->nb <= 0)
                {
-                       if (NR::LInfty(nBData->p - curX) < 0.00001) {
+                       if (Geom::LInfty(nBData->p - curX) < 0.00001) {
                                return true;
                        }
                        return false;
                }
                else if (nBData->nb == 1)
                {
-                       if (NR::LInfty(nBData->p - curX) < 0.00001) {
+                       if (Geom::LInfty(nBData->p - curX) < 0.00001) {
                                int ip = curD + 1;
                                PathDescrIntermBezierTo* nData = dynamic_cast<PathDescrIntermBezierTo*>(cmd[ip]);
-                               if (NR::LInfty(nData->p - curX) < 0.00001) {
+                               if (Geom::LInfty(nData->p - curX) < 0.00001) {
                                        return true;
                                }
                        }
                        return false;
-               } else if (NR::LInfty(nBData->p - curX) < 0.00001) {
+               } else if (Geom::LInfty(nBData->p - curX) < 0.00001) {
                        for (int i = 1; i <= nBData->nb; i++) {
                                int ip = curD + i;
                                PathDescrIntermBezierTo* nData = dynamic_cast<PathDescrIntermBezierTo*>(cmd[ip]);
-                               if (NR::LInfty(nData->p - curX) > 0.00001) {
+                               if (Geom::LInfty(nData->p - curX) > 0.00001) {
                                        return false;
                                }
                        }
index f3e5445976c805f0c41e59caa63d222d9116672e..5d6d918c7bc2c970f7dcdcf0ed0ebd6a79849f1e 100644 (file)
@@ -223,7 +223,7 @@ void Path::DoSimplify(int off, int N, double treshhold)
         curP = lastP;
     }
   
-    if (NR::LInfty(endToPt - moveToPt) < 0.00001) {
+    if (Geom::LInfty(endToPt - moveToPt) < 0.00001) {
         Close();
     }
   
index e9f2ae6776f31c0a7989e0dac3b9f13f0adb449e..cbd7bed5a26c3ea076077fc281e5b46b853c67e9 100644 (file)
@@ -65,7 +65,7 @@ void Path::Stroke(Shape *dest, bool doClose, double width, JoinType join,
         if ( lastP > lastM+1 ) {
             NR::Point sbStart = pts[lastM].p;
             NR::Point sbEnd = pts[lastP - 1].p;
-            if ( NR::LInfty(sbEnd-sbStart) < 0.00001 ) {       // why close lines that shouldn't be closed?
+            if ( Geom::LInfty(sbEnd-sbStart) < 0.00001 ) {       // why close lines that shouldn't be closed?
                 // ah I see, because close is defined here for
                 // a whole path and should be defined per subpath.
                 // debut==fin => ferme (on devrait garder un element pour les close(), mais tant pis)
index 4f4d287ad1581796077f2565a34af73498b3aea2..46268954a39b44fce3f13b34ba6a85aff803ac8e 100644 (file)
@@ -602,7 +602,7 @@ pen_handle_motion_notify(SPPenContext *const pc, GdkEventMotion const &mevent)
     if (pen_within_tolerance) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         gint const tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
-        if ( NR::LInfty( event_w - pen_drag_origin_w ) < tolerance ) {
+        if ( Geom::LInfty( event_w - pen_drag_origin_w ) < tolerance ) {
             return FALSE;   // Do not drag if we're within tolerance from origin.
         }
     }
index 69d9a5e234475d3cb2cac3fff5341f85c6bc779e..88fa3a2d477f50e100717e0d5c8bd0f37e53feee 100644 (file)
@@ -318,7 +318,7 @@ pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mev
     if (pencil_within_tolerance) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         gint const tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
-        if ( NR::LInfty( Geom::Point(mevent.x,mevent.y) - pencil_drag_origin_w ) < tolerance ) {
+        if ( Geom::LInfty( Geom::Point(mevent.x,mevent.y) - pencil_drag_origin_w ) < tolerance ) {
             return FALSE;   // Do not drag if we're within tolerance from origin.
         }
     }