Page 16 Table of Contents Index Page 18
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 3. REGIONS

of regions. Implementations may, but are not required to, take advantage of the commutativity
and associativity of union and intersection in order to "collapse" complicated region sets into
simpler ones.

Region sets that are composed entirely of axis-aligned rectangles must be canonicalized into
either a single rectangle or a union of rectangles. Furthermore, the rectangles in the union must
not overlap each other.

The following generic functions comprise the region composition protocol. All classes that are
subclasses of region must implement methods for these generic functions.

The methods for region-union, region-intersection, and region-difference will typically
specialize both the region1 and region2 arguments.

=> region-set-regions region &key normalize [Generic Function]
Returns a sequence of the regions in the region set region. region can be either a region set or
a "simple" region, in which case the result is simply a sequence of one element: region. This
function returns objects that reveal CLIM's internal state; do not modify those objects.

For the case of region sets that are unions of axis-aligned rectangles, the rectangles returned by
region-set-regions are guaranteed not to overlap.

If normalize is supplied, it must be either :x-banding or :y-banding. If it is :x-banding and
all the regions in region are axis-aligned rectangles, the result is normalized by merging adjacent
rectangles with banding done in the x direction. If it is :y-banding and all the regions in region
are rectangles, the result is normalized with banding done in the y direction. Normalizing a
region set that is not composed entirely of axis-aligned rectangles using x- or y-banding causes
CLIM to signal the region-set-not-rectangular error.

=> map-over-region-set-regions function region &key normalize [Generic Function]
Calls function on each region in the region set region. This is often more efficient than calling
region-set-regions. function is a function of one argument, a region; it has dynamic extent.
region can be either a region set or a "simple" region, in which case function is called once on
region itself. normalize is as for region-set-regions.

=> region-union region1 region2 [Generic Function]
Returns a region that contains all points that are in either of the regions region1 or region2
(possibly with some points removed in order to satisfy the dimensionality rule). The result of
region-union always has dimensionality that is the maximum dimensionality of region1 and
region2. For example, the union of a path and an area produces an area; the union of two paths
is a path.

region-union will return either a simple region or a member of the class standard-region-union.

This function is permitted to capture its mutable inputs; the consequences of modifying those
objects are unspecified.


Page 16 Table of Contents Index Page 18
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E