MCPcopy Create free account
hub / github.com/MapServer/MapServer / treeSplitBounds

Function treeSplitBounds

maptree.c:265–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265static 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
297static int treeNodeAddShapeId( treeNodeObj *node, int id, rectObj rect, int maxdepth)
298{

Callers 1

treeNodeAddShapeIdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected