Skip to content

Commit

Permalink
Vlib: sync 64, 65
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/branches/develbranch_6@64880 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
metzm committed Mar 17, 2015
1 parent 9f7fdbb commit 5af214c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion lib/vector/Vlib/break_polygons.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ typedef struct
static int fpoint;

/* Function called from RTreeSearch for point found */
void srch(int id, int *arg)
int srch(int id, int *arg)
{
fpoint = id;

return 0;
}

/*!
Expand Down
26 changes: 13 additions & 13 deletions lib/vector/Vlib/build_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ int Vect_attach_isles(struct Map_info *Map, BOUND_BOX * box)

for (i = 0; i < List->n_values; i++) {
isle = List->value[i];
if (plus->Isle[isle]->area > 0) {
dig_area_del_isle(plus, plus->Isle[isle]->area, isle);
plus->Isle[isle]->area = 0;
}
Vect_attach_isle(Map, isle);
}
return 0;
Expand Down Expand Up @@ -364,10 +368,6 @@ int Vect_attach_centroids(struct Map_info *Map, BOUND_BOX * box)
* to check if original area exist, unregister centroid from previous area.
* To simplify code, this is implemented so that centroid is always firs unregistered
* and if new area is found, it is registered again.
*
* This problem can be avoided altogether if properly attached centroids
* are skipped
* MM 2009
*/

Vect_select_lines_by_box(Map, box, GV_CENTROID, List);
Expand All @@ -378,15 +378,14 @@ int Vect_attach_centroids(struct Map_info *Map, BOUND_BOX * box)
centr = List->value[i];
Line = plus->Line[centr];

/* only attach unregistered and duplicate centroids because
* 1) all properly attached centroids are properly attached, really! Don't touch.
* 2) Vect_find_area() below does not always return the correct area
* 3) it's faster
*/
if (Line->left > 0)
continue;

/* Unregister centroid */
orig_area = Line->left;
if (orig_area > 0) {
if (plus->Area[orig_area] != NULL) {
plus->Area[orig_area]->centroid = 0;
}
}
Line->left = 0;

sel_area = Vect_find_area(Map, Line->E, Line->N);
G_debug(3, " centroid %d is in area %d", centr, sel_area);
Expand All @@ -410,6 +409,8 @@ int Vect_attach_centroids(struct Map_info *Map, BOUND_BOX * box)
dig_line_add_updated(plus, centr);
}
}
else if (orig_area != 0 && plus->do_uplist)
dig_line_add_updated(plus, centr);
}

return 0;
Expand Down Expand Up @@ -510,7 +511,6 @@ int Vect_build_nat(struct Map_info *Map, int build)

/* register lines, create nodes */
Vect_rewind(Map);

G_message(_("Registering primitives..."));
i = 1;
npoints = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/vector/Vlib/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ int Vect_get_proj(struct Map_info *Map)
\param Map vector map
\return poiter to projection name
\return pointer to projection name
*/

const char *Vect_get_proj_name(struct Map_info *Map)
Expand Down
2 changes: 1 addition & 1 deletion lib/vector/Vlib/poly.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ static int segments_x_ray(double X, double Y, struct line_pnts *Points)
x_inter = dig_x_intersect(x1, x2, y1, y2, Y);
G_debug(3, "x_inter = %f", x_inter);
if (x_inter == X)
return 1;
return -1; /* point on segment, do not assume inside/outside */
else if (x_inter > X)
n_intersects++;

Expand Down

0 comments on commit 5af214c

Please sign in to comment.