DIRECTORY ViewerClasses USING [Viewer, ViewerRec], Imager USING [Context]; SampledCurveEdit: CEDAR DEFINITIONS ~ BEGIN Viewer: TYPE ~ ViewerClasses.Viewer; PointKind: TYPE ~ {sample, knot, corner, open}; MarkedPoint: TYPE ~ RECORD [ x, y: REAL, isHeader: BOOLEAN _ FALSE, kind: PointKind ]; PointList: TYPE ~ LIST OF MarkedPoint; Trajectory: TYPE ~ PointList; Outline: TYPE ~ LIST OF Trajectory; PointModifier: TYPE = REF PointModifierRep; PointModifierRep: TYPE = RECORD [ pointModifyProc: PointModifyProc, data: REF ]; PointModifyProc: TYPE ~ PROC [self: PointModifier, pointList: PointList, count: INT] RETURNS [changed: BOOLEAN _ TRUE, newCount: INT _ -1]; RegisterPointModifer: PROC [atom: ATOM, pointModifier: PointModifier]; CopyTrajectory: PROC [trajectory: Trajectory] RETURNS [Trajectory]; MalformedTrajectory: ERROR; CopyOutline: PROC [outline: Outline] RETURNS [Outline]; GetOutline: PROC [viewer: Viewer] RETURNS [Outline]; ObtainOutline: PROC [viewer: Viewer] RETURNS [Outline]; SetOutline: PROC [viewer: Viewer, outline: Outline]; CreateViewer: PROC [info: ViewerClasses.ViewerRec] RETURNS [Viewer]; UserPaint: TYPE ~ REF UserPaintRec; UserPaintRec: TYPE = RECORD[ proc: PROC [context: Imager.Context, data: REF], data: REF ]; RegisterUserPaint: PROC [viewer: Viewer, userPaint: UserPaint]; NotifyUserPaint: PROC [viewer: Viewer, userPaint: UserPaint]; AddMenuItem: PROC [viewer: Viewer, atom: ATOM]; END. ΔSampledCurveEdit.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Michael Plass, January 8, 1986 2:51:47 pm PST Maureen Stone, September 25, 1987 4:14:53 pm PDT sample - the point is a sample along a smooth curve. knot - hint that this is a good place to decompose the curve into pieces. corner - hint to avoid smoothing this spot off. open - used in list headers for open trajectories. Every trajectory has a list head, marked by isHeader=TRUE. For an open trajectory, kind=open in the header, and the coordinates are ignored. For a closed trajectory, the coordinates are a copy of the coordinates in the last sample. No header on this list. The PointModifyProc may alter pointList.rest.first, pointList.rest.rest.first, etc. Note the list begins with the point before the first one to be modified. If newCount >= 0, the selection count is altered. The pointModifyProc will be called with the currently selected points when the viewer receives the specified atom as input from the menu or tip table. Repaints will be managed automatically. Returns a copy of the viewer's current outline. Returns the viewer's current outline, and sets it to NIL. Use this when you really don't want to copy, but need ownership of the outline. Sets the outline in the viewer; does NOT copy. The registered paint proc will be called when the viewer is refreshed. Queue a call back to userPaint. Adds a menu item to the viewer that sends an atom to the notify proc. ΚΓ˜™Icodešœ Οmœ1™