| 263 | } |
| 264 | |
| 265 | static void treeSplitBounds( rectObj *in, rectObj *out1, rectObj *out2) |
| 266 | { |
| 267 | double range; |
| 268 | |
| 269 | /* -------------------------------------------------------------------- */ |
| 270 | /* The output bounds will be very similar to the input bounds, */ |
| 271 | /* so just copy over to start. */ |
| 272 | /* -------------------------------------------------------------------- */ |
| 273 | memcpy(out1, in, sizeof(rectObj)); |
| 274 | memcpy(out2, in, sizeof(rectObj)); |
| 275 | |
| 276 | /* -------------------------------------------------------------------- */ |
| 277 | /* Split in X direction. */ |
| 278 | /* -------------------------------------------------------------------- */ |
| 279 | if((in->maxx - in->minx) > (in->maxy - in->miny)) { |
| 280 | range = in->maxx - in->minx; |
| 281 | |
| 282 | out1->maxx = in->minx + range * SPLITRATIO; |
| 283 | out2->minx = in->maxx - range * SPLITRATIO; |
| 284 | } |
| 285 | |
| 286 | /* -------------------------------------------------------------------- */ |
| 287 | /* Otherwise split in Y direction. */ |
| 288 | /* -------------------------------------------------------------------- */ |
| 289 | else { |
| 290 | range = in->maxy - in->miny; |
| 291 | |
| 292 | out1->maxy = in->miny + range * SPLITRATIO; |
| 293 | out2->miny = in->maxy - range * SPLITRATIO; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | static int treeNodeAddShapeId( treeNodeObj *node, int id, rectObj rect, int maxdepth) |
| 298 | { |
no outgoing calls
no test coverage detected