Draw2d.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, February 25, 1986 7:31:58 pm PST
DIRECTORY Imager, IO, Rope, Vector2;
Draw2d:
CEDAR
DEFINITIONS
~ BEGIN
VEC: TYPE ~ Vector2.VEC;
MarkType: TYPE ~ {cross, x, asterisk, dot, none};
DrawType: TYPE ~ {solid, dash, dot};
InitFont:
PROC [context: Imager.Context];
Set the font for subsequent calls to Label.
Label:
PROC [context: Imager.Context, p:
VEC, rope: Rope.
ROPE];
Combines Imager.SetXY and Imager.ShowRope.
DoWithBuffer:
PROC [context: Imager.Context, action:
PROC, w, h:
INTEGER];
Combine SetFont and ImagerOps.DoWithBuffer.
DoNoBuffer:
PROC [context: Imager.Context, action:
PROC, w, h:
INTEGER];
Combine SetFont and ImagerOps.DoSaveClipRectangleI.
ShowList:
PUBLIC
PROC [list:
LIST
OF Vector2.
VEC, context: Imager.Context];
Draw a list of 2D points.
ClearContext:
PROC [context: Imager.Context, x, y, w, h:
INTEGER];
Clears a context to white.
Mark:
PROC [context: Imager.Context, p:
VEC, type: MarkType ← cross];
Draw a mark at p.
Draw:
PROC [context: Imager.Context, p0, p1:
VEC, type: DrawType ← solid];
Draw between p0 and p1.
Solid:
PROC [context: Imager.Context, p0, p1: Vector2.
VEC];
Draw a solid line between p0 and p1, using Bresenham algorithm.
Dot:
PROC [context: Imager.Context, p0, p1: Vector2.
VEC];
Draw a dotted line between p0 and p1, much faster than Dash or Imager.MaskVector.
Dash:
PROC [context: Imager.Context, p0, p1: Vector2.
VEC];
Draw a dashed line between p0 and p1.
Arrow:
PROC [context: Imager.Context, head, tail: Vector2.
VEC];
Draw an arrow from tail to head, with arrowhead at head. If vary, the arrowhead size varies
Square:
PROC [context: Imager.Context, x, y, size:
REAL];
Draw a solid square at [x, y]..
Debug:
PROC [s:
IO.
STREAM];
Set a global stream for debugging.
END.