| 194 | } |
| 195 | |
| 196 | void msComputeBounds(shapeObj *shape) |
| 197 | { |
| 198 | int i, j; |
| 199 | if(shape->numlines <= 0) return; |
| 200 | for(i=0;i<shape->numlines;i++) { |
| 201 | if(shape->line[i].numpoints > 0) { |
| 202 | shape->bounds.minx = shape->bounds.maxx = shape->line[i].point[0].x; |
| 203 | shape->bounds.miny = shape->bounds.maxy = shape->line[i].point[0].y; |
| 204 | break; |
| 205 | } |
| 206 | } |
| 207 | if(i == shape->numlines) |
| 208 | return; //no lines inside the shape contain any points |
| 209 | |
| 210 | for( i=0; i<shape->numlines; i++ ) { |
| 211 | for( j=0; j<shape->line[i].numpoints; j++ ) { |
| 212 | shape->bounds.minx = MS_MIN(shape->bounds.minx, shape->line[i].point[j].x); |
| 213 | shape->bounds.maxx = MS_MAX(shape->bounds.maxx, shape->line[i].point[j].x); |
| 214 | shape->bounds.miny = MS_MIN(shape->bounds.miny, shape->line[i].point[j].y); |
| 215 | shape->bounds.maxy = MS_MAX(shape->bounds.maxy, shape->line[i].point[j].y); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | /* checks to see if ring r is an outer ring of shape */ |
| 221 | int msIsOuterRing(shapeObj *shape, int r) |
no outgoing calls
no test coverage detected