Next Prev Up Top Contents Index

2.5.4 Lines in CLIM

A line is a special case of a polyline having only one segment. The functions for making and dealing with lines are the following:

line [Protocol Class]	

Summary: The protocol class that corresponds to a mathematical line segment, that is, a polyline with only a single segment. This is a subclass of polyline . If you want to create a new class that behaves like a line, it should be a subclass of line . Subclasses of line must obey the line protocol.

linep [Function]	

Arguments: object

Summary: Returns t if object is a line; otherwise, it returns nil .

standard-line

Summary: An instantiable class that implements a line segment. This is a subclass of line . This is the class that make-line and make-line* instantiate. Members of this class are immutable.

make-line [Function]	

Arguments: start-point end-point

make-line* [Function]	

Arguments: start-x start-y end-x end-y

Summary: Returns an object of class standard-line that connects the two points start-point and end-point (or the positions ( start-x , start-y ) and ( end-x , end-y )).

These functions capture their mutable inputs; the consequences of modifying those objects are unspecified.

The following generic functions comprise the line Application Programmer Interface. Only line-start-point* and line-end-point* are in the line protocol; that is, all classes that are subclasses of line must implement methods for line-start-point* and line-end-point* , but need not implement methods for line-start-point and line-end-point .

line-start-point* [Generic Function]

Arguments: line

line-end-point* [Generic Function]

Arguments: line

Summary: Returns the starting or ending point, respectively, of the line line as two real numbers representing the coordinates of the point.

line-start-point [Generic Function]

Arguments: line

line-end-point [Generic Function]

Arguments: line

Summary: Returns the starting or ending point of the line line , respectively.

CLIM will supply default methods for line-start-point and line-end-point on the protocol class line that are implemented by calling line-start-point* and line-end-point* .


Common Lisp Interface Manager 2.0 User Guide - 14 Dec 2001

Next Prev Up Top Contents Index