Copyright (c) 2000 California Institute of Technology
All rights reserved. See the file COPYRIGHT for a full description.
$Id: Line.m3.html,v 1.3 2010-04-29 17:18:11 wagner Exp $
MODULE Line;
IMPORT Rect, Recte;
IMPORT Pointe;
IMPORT Fmt;
PROCEDURE GetBoundRect(l: T): Rect.T =
BEGIN
RETURN Recte.Inset(Recte.FromCorners(l.a, l.b), -l.s.thick);
(* if we knew how lines were drawn we could make this a little tighter *)
END GetBoundRect;
PROCEDURE Equal(a,b:T): BOOLEAN = BEGIN RETURN a=b; END Equal;
PROCEDURE Format(a: T): TEXT =
BEGIN
RETURN Pointe.Format(a.a) & Pointe.Format(a.b) &
":" & Fmt.Int(a.s.thick);
END Format;
BEGIN
END Line.