Supported Browsers Home   
DiffRegion Previous   
FreeRegion Next   
GA_regionFuncs Up   

DiffRegionRect

Compute the Boolean difference of a region and a rectangle.

Declaration

ibool NAPI GA_regionFuncs::DiffRegionRect(
    GA_region *r1,
    const GA_rect *r2)

Prototype In

snap/graphics.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

DiffRegion, UnionRegion, SectRegion

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