rectangl Specification Sheet


Portable Object Compiler (c) 1997 by David Stes. All Rights Reserved.

Rectangle

Inherits from:Object

Class Description

Rectangle instances are pairs of Point objects. It is largely ICpak101 compatible. For concepts such as left, top, bottom etc. it is assumed that the origin has smaller x and y coordinates than corner. Unlike ICpak101, this is not enforced, and negative values for height, width etc. are allowed.

Method Types

Creation

Interrogation

Comparing

Arithmetic

Printing

Methods



new

+ new

Returns a new rectangle with origin and corner at (0,0).



origin:corner:

- origin : p corner : q

Sets origin and corner to p and q.



origin:corner:

+ origin : p corner : q

Returns a new rectangle with origin and corner set to p and q.



free

- free

Frees the origin and corner of the Point too.



left

- (int) left



right

- (int) right



top

- (int) top



bottom

- (int) bottom



width

- (int) width



height

- (int) height



origin

- origin



corner

- corner



contains:

- (BOOL) contains : aPoint

Yes if inside, or on a border of, the rectangle.



hash

- (unsigned) hash



isEqual:

- (BOOL) isEqual : aRectangle

Returns YES if aRectangle is some kind of rectangle, and if corner and origin are equal.



moveBy:

- moveBy : aPoint



printToFile:

- printToFile :(FILE *) aFile