2.5 General Geometric Objects in CLIM

The functions for creating and dealing with rectangles are the following:

- Summary:
- The protocol class that corresponds to a mathematical rectangle, that is, a rectangular polygons whose sides are parallel to the coordinate axes. This is a subclass of
**polygon**. If you want to create a new class that behaves like a rectangle, it should be a subclass of**rectangle**. Subclasses of**rectangle**must obey the rectangle protocol.

- Arguments:
*object*

- Summary:
- Returns
**t**if*object*is a rectangle; otherwise, it returns**nil**.

- Summary:
- An instantiable class that implements an axis-aligned rectangle. This is a subclass of
**rectangle**. This is the class that**make-rectangle**and**make-rectangle***instantiate. Members of this class are immutable.

- Arguments:
*point1 point2*

- Arguments:
*x1 y1 x2 y2*

- Summary:
- Returns an object of class
**standard-rectangle**whose edges are parallel to the coordinate axes. One corner is at the point*point1*(or the position (*x1*,*y1*)) and the opposite corner is at the point*point2*(or the position (*x2*,*y2*)). There are no ordering constraints among*point1*and*point2*(or*x1*and*x2*, and*y1*and*y2*). - This function captures its mutable inputs; the consequences of modifying those objects are unspecified.

**rectangle-edges* ** [Generic Function]

- Arguments:
*rectangle*

- Summary:
- Returns the coordinates of the minimum
*x*and*y*and maximum*x*and*y*of the rectangle*rectangle*as four values,*min-x*,*min-y*,*max-x*, and*max-y*.

- Arguments:
*rectangle*

- Arguments:
*rectangle*

- Summary:
- Returns the min point and max point of the rectangle
*rectangle*, respectively. The position of a rectangle is specified by its min point.

**rectangle-min-x ** [Generic Function]

- Arguments:
*rectangle*

- Arguments:
*rectangle*

- Arguments:
*rectangle*

- Arguments:
*rectangle*

- Summary:
- Returns (respectively) the minimum
*x*and*y*coordinate and maximum*x*and*y*coordinate of the rectangle*rectangle*.

**rectangle-width ** [Generic Function]

- Arguments:
*rectangle*

- Arguments:
*rectangle*

- Arguments:
*rectangle*

- Summary:
**rectangle-width**returns the width of the rectangle*rectangle*, which is the difference between its maximum and minimum*x*values.**rectangle-height**returns the height, which is the difference between its maximum and minimum*y*values.**rectangle-size**returns two values, the width and the height.

CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker