GGShapes.mesa
Author: Eric Bier on June 7, 1985 4:47:32 pm PDT
Contents: Predefined shapes for use in Gargoyle (e.g. squares for control points).
Bier, October 24, 1988 3:46:53 pm PDT
Pier, August 25, 1986 5:05:57 pm PDT
Eisenman, July 21, 1987 4:52:25 pm PDT
DIRECTORY
Draw2d, GGBasicTypes, GGCoreTypes, GGSegmentTypes, Imager, ImagerTransformation;
GGShapes: CEDAR DEFINITIONS = BEGIN
BoundBox: TYPE = GGCoreTypes.BoundBox;
Circle: TYPE = GGBasicTypes.Circle;
Line: TYPE = GGCoreTypes.Line;
Point: TYPE = GGBasicTypes.Point;
Vector: TYPE = GGBasicTypes.Vector;
SelectionClass: TYPE = GGSegmentTypes.SelectionClass;
General Purpose Drawing Routines
DrawRectangle: PROC [dc: Imager.Context, loX, loY, hiX, hiY: REAL, strokeWidth: REAL ← 1.0];
Draws the indicated rectangle (not filled).
DrawFilledRectangle: PROC [dc: Imager.Context, loX, loY, hiX, hiY: REAL];
Draws the indicated filled rectangle.
DrawBoundBox: PROC [dc: Imager.Context, bBox: BoundBox, strokeWidth: REAL ← 1.0];
Draws the indicated box (not filled). Equivalent to DrawRectangle[dc, bBox.loX, bBox.loY, bBox.hiX, bBox.hiY];
DrawSquare: PROC [dc: Imager.Context, center: Point, side: REAL, strokeWidth: REAL ← 1.0];
Draws a square of side side centered on center (not filled).
DrawFilledSquare: PROC [dc: Imager.Context, center: Point, side: REAL];
Draws a filled square of side side centered on center.
DrawFilledLoLeftSquare: PROC [dc: Imager.Context, loLeft: Point, side: REAL];
Draws a filled square of side side with lower left-hand corner on loLeft.
DrawPlus: PROC [dc: Imager.Context, center: Point];
Draws a side x side square centered on center.
DrawLine: PROC [dc: Imager.Context, line: Line, clippedBy: Imager.Rectangle, strokeWidth: REAL ← 1.0, zip: Draw2d.Zip ← NIL];
Draws a line all the way across the screen.
DrawLittleLine: PROC [dc: Imager.Context, line: Line, point: Point];
Draw a short line (1 inch) centered on point, parallel to line.
DrawCircle: PROC [dc: Imager.Context, circle: Circle];
DrawStarburst: PROC [dc: Imager.Context, point: Point, scale: REAL ← 1.0, zip: Draw2d.Zip ← NIL];
Draw a six pointed starburst (similar to an asterisk) centered on point.
Gargoyle-Specific Drawing Routines
DrawCaret: PROC [dc: Imager.Context, point: Point, normal: Vector, scale: REAL];
scale is the scaling component of the current Biscrollers transformation.
DrawAnchor: PROC [dc: Imager.Context, point: Point, normal: Vector, scale: REAL];
scale is the scaling component of the current Biscrollers transformation.
DrawSpot: PROC [dc: Imager.Context, point: Point];
Draws a one-pixel square with lower left corner at point.
DrawJoint: PROC [dc: Imager.Context, point: Point, scale: REAL];
scale is the scaling component of the current Biscrollers transformation.
DrawCP: PROC [dc: Imager.Context, point: Point, scale: REAL];
DrawSelectedJoint: PROC [dc: Imager.Context, point: Point, selectClass: SelectionClass, scale: REAL];
DrawQuickSelectedJoint: PROC [dc: Imager.Context, point: Point, selectClass: SelectionClass, scale: REAL];
DrawArrow: PROC [dc: Imager.Context, tip: Point, base: Point, strokeWidth: REAL];
ArrowSize: PROC [strokeWidth: REAL] RETURNS [height, halfWidth: REAL];
The arrowhead will fit in a box of size height by (halfWidth*2).
END.