MCPcopy Index your code
hub / github.com/MapServer/MapServer / treeSplitBounds

Function treeSplitBounds

mapcluster.c:235–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235static void treeSplitBounds( rectObj *in, rectObj *out1, rectObj *out2)
236{
237 double range;
238
239 /* -------------------------------------------------------------------- */
240 /* The output bounds will be very similar to the input bounds, */
241 /* so just copy over to start. */
242 /* -------------------------------------------------------------------- */
243 memcpy(out1, in, sizeof(rectObj));
244 memcpy(out2, in, sizeof(rectObj));
245
246 /* -------------------------------------------------------------------- */
247 /* Split in X direction. */
248 /* -------------------------------------------------------------------- */
249 if((in->maxx - in->minx) > (in->maxy - in->miny))
250 {
251 range = in->maxx - in->minx;
252
253 out1->maxx = in->minx + range * SPLITRATIO;
254 out2->minx = in->maxx - range * SPLITRATIO;
255 }
256
257 /* -------------------------------------------------------------------- */
258 /* Otherwise split in Y direction. */
259 /* -------------------------------------------------------------------- */
260 else
261 {
262 range = in->maxy - in->miny;
263
264 out1->maxy = in->miny + range * SPLITRATIO;
265 out2->miny = in->maxy - range * SPLITRATIO;
266 }
267}
268
269/* alloc memory for a new tentative cluster */
270static clusterInfo *clusterInfoCreate(msClusterLayerInfo* layerinfo)

Callers 1

treeNodeAddShapeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected