Page 31 Table of Contents Index Page 33
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 4. BOUNDING RECTANGLES

The representation of bounding rectangles in CLIM is chosen to be efficient. CLIM will probably
represent such rectangles by storing the coordinates of two opposing corners of the rectangle,
namely, the "min point" and the "max point". Because this representation is not sufficient
to represent the result of arbitrary transformations of arbitrary rectangles, CLIM is allowed
to return a polygon as the result of such a transformation. (The most general class of trans-
formations that is guaranteed to always turn a rectangle into another rectangle is the class of
transformations that satisfy rectilinear-transformation-p.)

=> make-bounding-rectangle x1 y1 x2 y2 [Function]
Returns an object of the class standard-bounding-rectangle with the edges specified by x1,
y1, x2, and y2, which must be real numbers.

x1, y1, x2, and y2 are "canonicalized" in the following way. The min point of the rectangle has
an x coordinate that is the smaller of x1 and x2 and a y coordinate that is the smaller of y1 and
y2. The max point of the rectangle has an x coordinate that is the larger of x1 and x2 and a y
coordinate that is the larger of y1 and y2. (Therefore, in a right-handed coordinate system the
canonicalized values of x1, y1, x2, and y2 correspond to the left, top, right, and bottom edges of
the rectangle, respectively.)

This function returns fresh objects that may be modified.

4.1.1 The Bounding Rectangle Protocol

The following generic function comprises the bounding rectangle protocol. All classes that par-
ticipate in this protocol (including all subclasses of region that are bounded regions) must
implement a method for bounding-rectangle*.

=> bounding-rectangle* region [Generic Function]
Returns the bounding rectangle of region as four real numbers specifying the x and y coordinates
of the min point and the x and y coordinates of the max point of the rectangle. The argument
region must be either a bounded region (such as a line or an ellipse) or some other object that
obeys the bounding rectangle protocol, such as a sheet or an output record.

The four returned values min-x, min-y, max-x, and max-y will satisfy the inequalities
 
	minx <= maxx
	miny <= maxy

=> bounding-rectangle region [Generic Function]
Returns the bounding rectangle of region as an object that is a subclass of rectangle (described
in Section 3.2.4). The argument region must be either a bounded region (such as a line or an
ellipse) or some other object that obeys the bounding rectangle protocol, such as a sheet or an
output record.


Page 31 Table of Contents Index Page 33
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