[GRASS-SVN] r33245 - in grass-addons/vector: v.buffer2 v.parallel2

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 4 08:29:43 EDT 2008


Author: rmatev
Date: 2008-09-04 08:29:43 -0400 (Thu, 04 Sep 2008)
New Revision: 33245

Modified:
   grass-addons/vector/v.buffer2/dgraph.c
   grass-addons/vector/v.buffer2/e_intersect.c
   grass-addons/vector/v.buffer2/vlib_buffer.c
   grass-addons/vector/v.parallel2/dgraph.c
   grass-addons/vector/v.parallel2/e_intersect.c
   grass-addons/vector/v.parallel2/vlib_buffer.c
Log:
Changed debug levels

Modified: grass-addons/vector/v.buffer2/dgraph.c
===================================================================
--- grass-addons/vector/v.buffer2/dgraph.c	2008-09-04 10:29:48 UTC (rev 33244)
+++ grass-addons/vector/v.buffer2/dgraph.c	2008-09-04 12:29:43 UTC (rev 33245)
@@ -187,7 +187,7 @@
     struct seg_intersection_list *il;
     struct intersection_point **sorted;
     
-    G_debug(4, "find_all_intersections()");
+    G_debug(3, "find_all_intersections()");
     
     np = Points->n_points;
     x = Points->x;
@@ -196,12 +196,12 @@
     si = create_si_struct(np-1);
     
     looped = ((x[0] == x[np-1]) && (y[0] == y[np-1]));
-    G_debug(4, "    looped=%d", looped);
+    G_debug(3, "    looped=%d", looped);
     
-    G_debug(4, "    finding intersections...");
+    G_debug(3, "    finding intersections...");
     for (i = 0; i < np-1; i++) {
         for (j = i+1; j < np-1; j++) {
-            G_debug(3, "        checking %d-%d %d-%d", i, i+1, j, j+1);
+            G_debug(4, "        checking %d-%d %d-%d", i, i+1, j, j+1);
             /*res = segment_intersection_2d_e(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1, &y1, &x2, &y2);*/
             res = segment_intersection_2d(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1, &y1, &x2, &y2);
 /*            res2 = segment_intersection_2d_e(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1_, &y1_, &x2_, &y2_);
@@ -210,7 +210,7 @@
                 segment_intersection_2d_test(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1, &y1, &x2, &y2);
             }
 */            
-            G_debug(3, "        intersection type = %d", res);
+            G_debug(4, "        intersection type = %d", res);
             if (res == 1) {
                 add_ipoint(Points, i, j, x1, y1, si);
             } else if ((res >= 2) && (res <= 5)) {
@@ -224,9 +224,9 @@
         add_ipoint(Points, 0, -1, Points->x[0], Points->y[0], si);
         add_ipoint(Points, np-2, -1, Points->x[np-1], Points->y[np-1], si);
     }
-    G_debug(4, "    finding intersections...done");
+    G_debug(3, "    finding intersections...done");
     
-    G_debug(4, "    postprocessing...");
+    G_debug(3, "    postprocessing...");
     if (si->ipallocated > si->ipcount) {
         si->ipallocated = si->ipcount;
         si->ip = G_realloc(si->ip, (si->ipcount)*sizeof(struct intersection_point));
@@ -273,7 +273,7 @@
     }
     si->group_count = group;
     
-    G_debug(4, "    postprocessing...done");
+    G_debug(3, "    postprocessing...done");
     
     /* output contents of si */
     for (i = 0; i < si->ilcount; i++) {
@@ -387,7 +387,7 @@
     struct pg_edge *edge;
     int i, j, t, v;
 
-    G_debug(4, "pg_create()");
+    G_debug(3, "pg_create()");
     
     si = find_all_intersections(Points);
     pg = pg_create_struct(si->group_count, 2*(si->ipcount));

Modified: grass-addons/vector/v.buffer2/e_intersect.c
===================================================================
--- grass-addons/vector/v.buffer2/e_intersect.c	2008-09-04 10:29:48 UTC (rev 33244)
+++ grass-addons/vector/v.buffer2/e_intersect.c	2008-09-04 12:29:43 UTC (rev 33245)
@@ -556,6 +556,7 @@
 int segment_intersection_2d(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2,
     double *x1, double *y1, double *x2, double *y2)
 {
+    const DLEVEL = 4;
     double t;
     double max_ax, min_ax, max_ay, min_ay;
     double max_bx, min_bx, max_by, min_by;
@@ -564,7 +565,7 @@
     double d, da, db;
     
     /* TODO: Works for points ? */
-    G_debug(3, "segment_intersection_2d()"); 
+    G_debug(DLEVEL, "segment_intersection_2d()"); 
     G_debug(4, "    ax1  = %.18f, ay1  = %.18f", ax1, ay1);
     G_debug(4, "    ax2  = %.18f, ay2  = %.18f", ax2, ay2);
     G_debug(4, "    bx1  = %.18f, by1  = %.18f", bx1, by1);
@@ -577,35 +578,35 @@
     
     /* Check for identical segments */
     if ((f11 && f22) || (f12 && f21)) {
-        G_debug (3, "    identical segments" );
+        G_debug(DLEVEL, "    identical segments" );
         *x1 = ax1; *y1 = ay1;
         *x2 = ax2; *y2 = ay2;
         return 5;
     }
     /* Check for identical endpoints */
     if (f11 || f12) {
-        G_debug (3, "    connected by endpoints" );
+        G_debug(DLEVEL, "    connected by endpoints" );
         *x1 = ax1; *y1 = ay1;
         return 1;
     }
     if (f21 || f22) {
-        G_debug (3, "    connected by endpoints" );
+        G_debug (DLEVEL, "    connected by endpoints" );
         *x1 = ax2; *y1 = ay2;
         return 1;
     }
 
     if ((fmax(ax1, ax2) < fmin(bx1, bx2)) || (fmax(bx1, bx2) < fmin(ax1, ax2))) {
-        G_debug(3, "    no intersection (disjoint bounding boxes)");
+        G_debug(DLEVEL, "    no intersection (disjoint bounding boxes)");
         return 0;
     }
     if ((fmax(ay1, ay2) < fmin(by1, by2)) || (fmax(by1, by2) < fmin(ay1, ay2))) {
-        G_debug(3, "    no intersection (disjoint bounding boxes)");
+        G_debug(DLEVEL, "    no intersection (disjoint bounding boxes)");
         return 0;
     }
         
     d  = D;
     if (d != 0) {
-        G_debug(3, "    general position");
+        G_debug(DLEVEL, "    general position");
 
         da = DA;
         
@@ -619,36 +620,36 @@
         
         if (d > 0) {
             if ((da < 0) || (da > d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             db = DB;
             if ((db < 0) || (db > d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }
         else { /* if d < 0 */
             if ((da > 0) || (da < d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             db = DB;
             if ((db > 0) || (db < d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }
 
-        /*G_debug(3, "        ra=%.17g rb=%.17g", mpf_get_d(dda)/mpf_get_d(dd), mpf_get_d(ddb)/mpf_get_d(dd));*/
-        /*G_debug(3, "        sgn_d=%d sgn_da=%d sgn_db=%d cmp(dda,dd)=%d cmp(ddb,dd)=%d", sgn_d, sgn_da, sgn_db, mpf_cmp(dda, dd), mpf_cmp(ddb, dd));*/
+        /*G_debug(DLEVEL, "        ra=%.17g rb=%.17g", mpf_get_d(dda)/mpf_get_d(dd), mpf_get_d(ddb)/mpf_get_d(dd));*/
+        /*G_debug(DLEVEL, "        sgn_d=%d sgn_da=%d sgn_db=%d cmp(dda,dd)=%d cmp(ddb,dd)=%d", sgn_d, sgn_da, sgn_db, mpf_cmp(dda, dd), mpf_cmp(ddb, dd));*/
     
         *x1 = ax1 + (ax2 - ax1)*da/d;
         *y1 = ay1 + (ay2 - ay1)*da/d;
         
-        G_debug(3, "        intersection %.16g, %.16g", *x1, *y1);
+        G_debug(DLEVEL, "        intersection %.16g, %.16g", *x1, *y1);
         return 1;
     }
     
@@ -657,7 +658,7 @@
     db = DB;
     if ((da != 0) || (db != 0)) {
         /* segments are parallel */
-        G_debug(3, "    parallel segments");
+        G_debug(DLEVEL, "    parallel segments");
         return 0;
     }
     
@@ -686,19 +687,19 @@
         SWAP(bx2, by2);
     }
     
-    G_debug(3, "    collinear segments");
+    G_debug(DLEVEL, "    collinear segments");
 
     if ((bx2 < ax1) || (bx1 > ax2)) {
-        G_debug(3, "        no intersection");
+        G_debug(DLEVEL, "        no intersection");
         return 0;
     }
 
     /* there is overlap or connected end points */
-    G_debug(3, "        overlap");
+    G_debug(DLEVEL, "        overlap");
     
     /* a contains b */
     if ((ax1 < bx1) && (ax2 > bx2)) {
-        G_debug(3, "            a contains b");
+        G_debug(DLEVEL, "            a contains b");
         if (!vertical) {
             *x1 = bx1; *y1 = by1;
             *x2 = bx2; *y2 = by2;
@@ -712,7 +713,7 @@
     
     /* b contains a */
     if ((ax1 > bx1) && (ax2 < bx2)) {
-        G_debug(3, "            b contains a");
+        G_debug(DLEVEL, "            b contains a");
         if (!vertical) {
             *x1 = bx1; *y1 = by1;
             *x2 = bx2; *y2 = by2;
@@ -725,7 +726,7 @@
     }   
     
     /* general overlap, 2 intersection points */
-    G_debug(3, "        partial overlap");
+    G_debug(DLEVEL, "        partial overlap");
     if ((bx1 > ax1) && (bx1 < ax2)) { /* b1 is in a */
         if (!vertical) {
             *x1 = bx1; *y1 = by1;
@@ -868,23 +869,23 @@
         
         if (sgn_d > 0) {
             if ((sgn_da < 0) || (mpf_cmp(dda, dd) > 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             if ((sgn_db < 0) || (mpf_cmp(ddb, dd) > 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }
         else { /* if sgn_d < 0 */
             if ((sgn_da > 0) || (mpf_cmp(dda, dd) < 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             if ((sgn_db > 0) || (mpf_cmp(ddb, dd) < 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }

Modified: grass-addons/vector/v.buffer2/vlib_buffer.c
===================================================================
--- grass-addons/vector/v.buffer2/vlib_buffer.c	2008-09-04 10:29:48 UTC (rev 33244)
+++ grass-addons/vector/v.buffer2/vlib_buffer.c	2008-09-04 12:29:43 UTC (rev 33245)
@@ -160,7 +160,7 @@
     double cosa, sina, r;
     int inner_corner, turns360;
     
-    G_debug(4, "parallel_line()");
+    G_debug(3, "parallel_line()");
     
     if (looped && 0) {
         /* start point != end point */
@@ -312,8 +312,7 @@
     double angle0, angle1;
     int inner_corner, turns360;
     
-    G_debug(3, "convolution_line()");
-    G_debug(3, "    side = %d", side);
+    G_debug(3, "convolution_line() side = %d", side);
 
     np = Points->n_points;
     x = Points->x;
@@ -463,7 +462,7 @@
     double opt_angle, tangle;
     int opt_j, opt_side, opt_flag;
     
-    G_debug(4, "extract_contour(): v1=%d, v2=%d, side=%d, stop_at_line_end=%d", first->v1, first->v2, side, stop_at_line_end);
+    G_debug(3, "extract_contour(): v1=%d, v2=%d, side=%d, stop_at_line_end=%d", first->v1, first->v2, side, stop_at_line_end);
 
     Vect_reset_line(nPoints);
     
@@ -582,7 +581,7 @@
     struct pg_edge *edge;
     double min_x, min_angle, ta;
 
-    G_debug(4, "extract_outer_contour()");
+    G_debug(3, "extract_outer_contour()");
 
     if (side != 0) {
         G_fatal_error("    side != 0 feature not implemented");
@@ -626,7 +625,7 @@
     int i, w;
     struct pg_edge *edge;
     
-    G_debug(4, "extract_inner_contour()");
+    G_debug(3, "extract_inner_contour()");
 
     for (i = 0; i < pg->ecount; i++) {
         edge = &(pg->e[i]);
@@ -663,6 +662,8 @@
     double vx, vy, wx, wy, mx, my, nx, ny;
     double len, tx, ty, d, da2;
     
+    G_debug(3, "point_in_buf()");
+    
     dalpha *= PI/180; /* convert dalpha from degrees to radians */
     
     np = Points->n_points;
@@ -775,7 +776,7 @@
     int allocated = 0;
     double px, py;
     
-    G_debug(4, "buffer_lines()");
+    G_debug(3, "buffer_lines()");
     
     auto_side = (side == 0);
     
@@ -868,7 +869,7 @@
     int more = 8;
     int isles_allocated = 0;
     
-    G_debug(4, "Vect_line_buffer()");
+    G_debug(2, "Vect_line_buffer()");
     
     /* initializations */
     tPoints = Vect_new_line_struct();
@@ -906,7 +907,7 @@
     int isles_allocated = 0;
     double max = fmax(da, db);
     
-    G_debug(4, "Vect_area_buffer()");
+    G_debug(2, "Vect_area_buffer()");
     
     /* initializations */
     tPoints = Vect_new_line_struct();
@@ -960,6 +961,8 @@
     double angular_tol, angular_step, phi1;
     int j, nsegments;
     
+    G_debug(2, "Vect_point_buffer()");
+    
     *oPoints = Vect_new_line_struct();
     
     dalpha *= PI/180; /* convert dalpha from degrees to radians */
@@ -983,6 +986,8 @@
     
     /* close the output line */
     Vect_append_point(*oPoints, (*oPoints)->x[0], (*oPoints)->y[0], (*oPoints)->z[0]);    
+    
+    return;
 }
 
 
@@ -998,7 +1003,7 @@
 */
 void Vect_line_parallel2(struct line_pnts *InPoints, double da, double db, double dalpha, int side, int round, double tol, struct line_pnts *OutPoints )
 {
-    G_debug(4, "Vect_line_parallel(): npoints = %d, da = %f, db = %f, dalpha = %f, side = %d, round_corners = %d, tol = %f",
+    G_debug(2, "Vect_line_parallel(): npoints = %d, da = %f, db = %f, dalpha = %f, side = %d, round_corners = %d, tol = %f",
             InPoints->n_points, da, db, dalpha, side, round, tol);
 
     parallel_line(InPoints, da, db, dalpha, side, round, 1, NON_LOOPED_LINE, tol, OutPoints);

Modified: grass-addons/vector/v.parallel2/dgraph.c
===================================================================
--- grass-addons/vector/v.parallel2/dgraph.c	2008-09-04 10:29:48 UTC (rev 33244)
+++ grass-addons/vector/v.parallel2/dgraph.c	2008-09-04 12:29:43 UTC (rev 33245)
@@ -187,7 +187,7 @@
     struct seg_intersection_list *il;
     struct intersection_point **sorted;
     
-    G_debug(4, "find_all_intersections()");
+    G_debug(3, "find_all_intersections()");
     
     np = Points->n_points;
     x = Points->x;
@@ -196,12 +196,12 @@
     si = create_si_struct(np-1);
     
     looped = ((x[0] == x[np-1]) && (y[0] == y[np-1]));
-    G_debug(4, "    looped=%d", looped);
+    G_debug(3, "    looped=%d", looped);
     
-    G_debug(4, "    finding intersections...");
+    G_debug(3, "    finding intersections...");
     for (i = 0; i < np-1; i++) {
         for (j = i+1; j < np-1; j++) {
-            G_debug(3, "        checking %d-%d %d-%d", i, i+1, j, j+1);
+            G_debug(4, "        checking %d-%d %d-%d", i, i+1, j, j+1);
             /*res = segment_intersection_2d_e(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1, &y1, &x2, &y2);*/
             res = segment_intersection_2d(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1, &y1, &x2, &y2);
 /*            res2 = segment_intersection_2d_e(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1_, &y1_, &x2_, &y2_);
@@ -210,7 +210,7 @@
                 segment_intersection_2d_test(x[i], y[i], x[i+1], y[i+1], x[j], y[j], x[j+1], y[j+1], &x1, &y1, &x2, &y2);
             }
 */            
-            G_debug(3, "        intersection type = %d", res);
+            G_debug(4, "        intersection type = %d", res);
             if (res == 1) {
                 add_ipoint(Points, i, j, x1, y1, si);
             } else if ((res >= 2) && (res <= 5)) {
@@ -224,9 +224,9 @@
         add_ipoint(Points, 0, -1, Points->x[0], Points->y[0], si);
         add_ipoint(Points, np-2, -1, Points->x[np-1], Points->y[np-1], si);
     }
-    G_debug(4, "    finding intersections...done");
+    G_debug(3, "    finding intersections...done");
     
-    G_debug(4, "    postprocessing...");
+    G_debug(3, "    postprocessing...");
     if (si->ipallocated > si->ipcount) {
         si->ipallocated = si->ipcount;
         si->ip = G_realloc(si->ip, (si->ipcount)*sizeof(struct intersection_point));
@@ -273,7 +273,7 @@
     }
     si->group_count = group;
     
-    G_debug(4, "    postprocessing...done");
+    G_debug(3, "    postprocessing...done");
     
     /* output contents of si */
     for (i = 0; i < si->ilcount; i++) {
@@ -387,7 +387,7 @@
     struct pg_edge *edge;
     int i, j, t, v;
 
-    G_debug(4, "pg_create()");
+    G_debug(3, "pg_create()");
     
     si = find_all_intersections(Points);
     pg = pg_create_struct(si->group_count, 2*(si->ipcount));

Modified: grass-addons/vector/v.parallel2/e_intersect.c
===================================================================
--- grass-addons/vector/v.parallel2/e_intersect.c	2008-09-04 10:29:48 UTC (rev 33244)
+++ grass-addons/vector/v.parallel2/e_intersect.c	2008-09-04 12:29:43 UTC (rev 33245)
@@ -556,6 +556,7 @@
 int segment_intersection_2d(double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2,
     double *x1, double *y1, double *x2, double *y2)
 {
+    const DLEVEL = 4;
     double t;
     double max_ax, min_ax, max_ay, min_ay;
     double max_bx, min_bx, max_by, min_by;
@@ -564,7 +565,7 @@
     double d, da, db;
     
     /* TODO: Works for points ? */
-    G_debug(3, "segment_intersection_2d()"); 
+    G_debug(DLEVEL, "segment_intersection_2d()"); 
     G_debug(4, "    ax1  = %.18f, ay1  = %.18f", ax1, ay1);
     G_debug(4, "    ax2  = %.18f, ay2  = %.18f", ax2, ay2);
     G_debug(4, "    bx1  = %.18f, by1  = %.18f", bx1, by1);
@@ -577,35 +578,35 @@
     
     /* Check for identical segments */
     if ((f11 && f22) || (f12 && f21)) {
-        G_debug (3, "    identical segments" );
+        G_debug(DLEVEL, "    identical segments" );
         *x1 = ax1; *y1 = ay1;
         *x2 = ax2; *y2 = ay2;
         return 5;
     }
     /* Check for identical endpoints */
     if (f11 || f12) {
-        G_debug (3, "    connected by endpoints" );
+        G_debug(DLEVEL, "    connected by endpoints" );
         *x1 = ax1; *y1 = ay1;
         return 1;
     }
     if (f21 || f22) {
-        G_debug (3, "    connected by endpoints" );
+        G_debug (DLEVEL, "    connected by endpoints" );
         *x1 = ax2; *y1 = ay2;
         return 1;
     }
 
     if ((fmax(ax1, ax2) < fmin(bx1, bx2)) || (fmax(bx1, bx2) < fmin(ax1, ax2))) {
-        G_debug(3, "    no intersection (disjoint bounding boxes)");
+        G_debug(DLEVEL, "    no intersection (disjoint bounding boxes)");
         return 0;
     }
     if ((fmax(ay1, ay2) < fmin(by1, by2)) || (fmax(by1, by2) < fmin(ay1, ay2))) {
-        G_debug(3, "    no intersection (disjoint bounding boxes)");
+        G_debug(DLEVEL, "    no intersection (disjoint bounding boxes)");
         return 0;
     }
         
     d  = D;
     if (d != 0) {
-        G_debug(3, "    general position");
+        G_debug(DLEVEL, "    general position");
 
         da = DA;
         
@@ -619,36 +620,36 @@
         
         if (d > 0) {
             if ((da < 0) || (da > d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             db = DB;
             if ((db < 0) || (db > d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }
         else { /* if d < 0 */
             if ((da > 0) || (da < d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             db = DB;
             if ((db > 0) || (db < d)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }
 
-        /*G_debug(3, "        ra=%.17g rb=%.17g", mpf_get_d(dda)/mpf_get_d(dd), mpf_get_d(ddb)/mpf_get_d(dd));*/
-        /*G_debug(3, "        sgn_d=%d sgn_da=%d sgn_db=%d cmp(dda,dd)=%d cmp(ddb,dd)=%d", sgn_d, sgn_da, sgn_db, mpf_cmp(dda, dd), mpf_cmp(ddb, dd));*/
+        /*G_debug(DLEVEL, "        ra=%.17g rb=%.17g", mpf_get_d(dda)/mpf_get_d(dd), mpf_get_d(ddb)/mpf_get_d(dd));*/
+        /*G_debug(DLEVEL, "        sgn_d=%d sgn_da=%d sgn_db=%d cmp(dda,dd)=%d cmp(ddb,dd)=%d", sgn_d, sgn_da, sgn_db, mpf_cmp(dda, dd), mpf_cmp(ddb, dd));*/
     
         *x1 = ax1 + (ax2 - ax1)*da/d;
         *y1 = ay1 + (ay2 - ay1)*da/d;
         
-        G_debug(3, "        intersection %.16g, %.16g", *x1, *y1);
+        G_debug(DLEVEL, "        intersection %.16g, %.16g", *x1, *y1);
         return 1;
     }
     
@@ -657,7 +658,7 @@
     db = DB;
     if ((da != 0) || (db != 0)) {
         /* segments are parallel */
-        G_debug(3, "    parallel segments");
+        G_debug(DLEVEL, "    parallel segments");
         return 0;
     }
     
@@ -686,19 +687,19 @@
         SWAP(bx2, by2);
     }
     
-    G_debug(3, "    collinear segments");
+    G_debug(DLEVEL, "    collinear segments");
 
     if ((bx2 < ax1) || (bx1 > ax2)) {
-        G_debug(3, "        no intersection");
+        G_debug(DLEVEL, "        no intersection");
         return 0;
     }
 
     /* there is overlap or connected end points */
-    G_debug(3, "        overlap");
+    G_debug(DLEVEL, "        overlap");
     
     /* a contains b */
     if ((ax1 < bx1) && (ax2 > bx2)) {
-        G_debug(3, "            a contains b");
+        G_debug(DLEVEL, "            a contains b");
         if (!vertical) {
             *x1 = bx1; *y1 = by1;
             *x2 = bx2; *y2 = by2;
@@ -712,7 +713,7 @@
     
     /* b contains a */
     if ((ax1 > bx1) && (ax2 < bx2)) {
-        G_debug(3, "            b contains a");
+        G_debug(DLEVEL, "            b contains a");
         if (!vertical) {
             *x1 = bx1; *y1 = by1;
             *x2 = bx2; *y2 = by2;
@@ -725,7 +726,7 @@
     }   
     
     /* general overlap, 2 intersection points */
-    G_debug(3, "        partial overlap");
+    G_debug(DLEVEL, "        partial overlap");
     if ((bx1 > ax1) && (bx1 < ax2)) { /* b1 is in a */
         if (!vertical) {
             *x1 = bx1; *y1 = by1;
@@ -868,23 +869,23 @@
         
         if (sgn_d > 0) {
             if ((sgn_da < 0) || (mpf_cmp(dda, dd) > 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             if ((sgn_db < 0) || (mpf_cmp(ddb, dd) > 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }
         else { /* if sgn_d < 0 */
             if ((sgn_da > 0) || (mpf_cmp(dda, dd) < 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
             
             if ((sgn_db > 0) || (mpf_cmp(ddb, dd) < 0)) {
-                G_debug(3, "        no intersection");
+                G_debug(DLEVEL, "        no intersection");
                 return 0;
             }
         }

Modified: grass-addons/vector/v.parallel2/vlib_buffer.c
===================================================================
--- grass-addons/vector/v.parallel2/vlib_buffer.c	2008-09-04 10:29:48 UTC (rev 33244)
+++ grass-addons/vector/v.parallel2/vlib_buffer.c	2008-09-04 12:29:43 UTC (rev 33245)
@@ -160,7 +160,7 @@
     double cosa, sina, r;
     int inner_corner, turns360;
     
-    G_debug(4, "parallel_line()");
+    G_debug(3, "parallel_line()");
     
     if (looped && 0) {
         /* start point != end point */
@@ -312,8 +312,7 @@
     double angle0, angle1;
     int inner_corner, turns360;
     
-    G_debug(3, "convolution_line()");
-    G_debug(3, "    side = %d", side);
+    G_debug(3, "convolution_line() side = %d", side);
 
     np = Points->n_points;
     x = Points->x;
@@ -463,7 +462,7 @@
     double opt_angle, tangle;
     int opt_j, opt_side, opt_flag;
     
-    G_debug(4, "extract_contour(): v1=%d, v2=%d, side=%d, stop_at_line_end=%d", first->v1, first->v2, side, stop_at_line_end);
+    G_debug(3, "extract_contour(): v1=%d, v2=%d, side=%d, stop_at_line_end=%d", first->v1, first->v2, side, stop_at_line_end);
 
     Vect_reset_line(nPoints);
     
@@ -582,7 +581,7 @@
     struct pg_edge *edge;
     double min_x, min_angle, ta;
 
-    G_debug(4, "extract_outer_contour()");
+    G_debug(3, "extract_outer_contour()");
 
     if (side != 0) {
         G_fatal_error("    side != 0 feature not implemented");
@@ -626,7 +625,7 @@
     int i, w;
     struct pg_edge *edge;
     
-    G_debug(4, "extract_inner_contour()");
+    G_debug(3, "extract_inner_contour()");
 
     for (i = 0; i < pg->ecount; i++) {
         edge = &(pg->e[i]);
@@ -663,6 +662,8 @@
     double vx, vy, wx, wy, mx, my, nx, ny;
     double len, tx, ty, d, da2;
     
+    G_debug(3, "point_in_buf()");
+    
     dalpha *= PI/180; /* convert dalpha from degrees to radians */
     
     np = Points->n_points;
@@ -775,7 +776,7 @@
     int allocated = 0;
     double px, py;
     
-    G_debug(4, "buffer_lines()");
+    G_debug(3, "buffer_lines()");
     
     auto_side = (side == 0);
     
@@ -868,7 +869,7 @@
     int more = 8;
     int isles_allocated = 0;
     
-    G_debug(4, "Vect_line_buffer()");
+    G_debug(2, "Vect_line_buffer()");
     
     /* initializations */
     tPoints = Vect_new_line_struct();
@@ -906,7 +907,7 @@
     int isles_allocated = 0;
     double max = fmax(da, db);
     
-    G_debug(4, "Vect_area_buffer()");
+    G_debug(2, "Vect_area_buffer()");
     
     /* initializations */
     tPoints = Vect_new_line_struct();
@@ -960,6 +961,8 @@
     double angular_tol, angular_step, phi1;
     int j, nsegments;
     
+    G_debug(2, "Vect_point_buffer()");
+    
     *oPoints = Vect_new_line_struct();
     
     dalpha *= PI/180; /* convert dalpha from degrees to radians */
@@ -983,6 +986,8 @@
     
     /* close the output line */
     Vect_append_point(*oPoints, (*oPoints)->x[0], (*oPoints)->y[0], (*oPoints)->z[0]);    
+    
+    return;
 }
 
 
@@ -998,7 +1003,7 @@
 */
 void Vect_line_parallel2(struct line_pnts *InPoints, double da, double db, double dalpha, int side, int round, double tol, struct line_pnts *OutPoints )
 {
-    G_debug(4, "Vect_line_parallel(): npoints = %d, da = %f, db = %f, dalpha = %f, side = %d, round_corners = %d, tol = %f",
+    G_debug(2, "Vect_line_parallel(): npoints = %d, da = %f, db = %f, dalpha = %f, side = %d, round_corners = %d, tol = %f",
             InPoints->n_points, da, db, dalpha, side, round, tol);
 
     parallel_line(InPoints, da, db, dalpha, side, round, 1, NON_LOOPED_LINE, tol, OutPoints);



More information about the grass-commit mailing list