MGL_diffRegionRect

Compute the Boolean difference of a region and a rectangle.

Declaration

ibool MGLAPI MGL_diffRegionRect(
    region_t *r1,
    const rect_t *r2)

Prototype In

mgraph.h

Parameters

r1

Region from which r2 is subtracted, which also becomes the result region.

r2

Rectangle to be subtracted from r1

 

Return Value

True if the difference is valid, false if an empty region was created.

Description

Computes the Boolean difference of a region and a simple rectangle by subtracting the area covered by rectangle r2 from region r1, computing the resulting region in r1, which may result in an empty region. If you need to retain the value of r1, you need to first copy r1 to a temporary region.

This routine will produce a simple region with only a single bounding rectangle if the original region was also a simple rectangle and the resulting region is also a single rectangle, which makes it more efficient if the region to be subtracted is a rectangle.

See Also

MGL_diffRegion, MGL_unionRegion, MGL_sectRegion

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com