DABasics.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Created by Bertrand Serlet, May 14, 1987 11:34:08 pm PDT
Bertrand Serlet, May 15, 1987 5:36:44 pm PDT
Regroups type definitions for geometric data types.
DIRECTORY D2Basic, D2Orient;
DABasics: CEDAR DEFINITIONS ~ BEGIN
Types
Number: TYPE = D2Basic.Number;
Position: TYPE = D2Basic.Vector;
Rect: TYPE = D2Basic.Rect;
Orientation: TYPE = D2Orient.Orientation;
Transformation: TYPE = D2Orient.Transformation;
SideOrNone: TYPE = {bottom, top, left, right, none};
Side: TYPE = SideOrNone[bottom .. right];
Sides: TYPE = PACKED ARRAY Side OF BOOL ← noSide;
noSide: Sides = ALL [FALSE];
LRSide: TYPE = SideOrNone[left .. right];
TBSide: TYPE = SideOrNone[bottom .. top];
Direction: TYPE = {horizontal, vertical};
Operations
OtherSide: PROC [side: Side] RETURNS [Side] =
INLINE {RETURN [SELECT side FROM bottom => top, top => bottom, left => right, right => left, ENDCASE => ERROR]};
OtherDirection: PROC [direction: Direction] RETURNS [Direction] =
INLINE {RETURN [SELECT direction FROM horizontal => vertical, vertical => horizontal, ENDCASE => ERROR]};
END.