<< JunoImage.mesa>> << Last Hacked by: Jorge Stolfi June 13, 1984 9:00:35 am PDT>> << Procedures to manipulate and traverse the current Juno image. >> DIRECTORY JunoStorage USING [Point, Coords, Item, IntCoords], JunoOldSolver USING [Outcome]; JunoImage: DEFINITIONS = BEGIN OPEN Stor: JunoStorage, Solv: JunoOldSolver; << - - - - IMPORTED TYPES>> Point: TYPE = Stor.Point; Coords: TYPE = Stor.Coords; IntCoords: TYPE = Stor.IntCoords; Item: TYPE = Stor.Item; << - - - - THE CURRENT IMAGE>> << The current image consists of a list of points, and a list of constraints and a list of actions involving those points. >> PurgeImage: PROC; <> << - - - - IMAGE POINTS >> AddPoint: PROC [p: Point]; <> RemovePoint: PROC [p: Point]; <> <> SortPoints: PUBLIC PROC; <> <> << - - - - ITEMS (ACTIONS AND CONSTRAINTS)>> AddItem: PROC [item: Item]; <> << - - - - ELEMENT ENUMERATION >> EnumPoints: PROC [Proc: PointVisitProc]; <> <> PointVisitProc: TYPE = PROC [p: Point]; ReplacePoints: PROC [Proc: PointReplaceProc]; <> <> <> PointReplaceProc: TYPE = PROC [p: Point] RETURNS [new: Point]; EnumItems: PROC [Proc: ItemVisitProc]; <> <> ItemVisitProc: TYPE = PROC [item: Item]; EnumItemPoints: PROC [item: Item, Proc: PointVisitProc]; <> <> ReplaceItemPoints: PROC [item: Item, Proc: PointReplaceProc]; <> <> <> << - - - - POINT LOCATION >> FindPoint: PROC [coords: Coords, wound: BOOL _ FALSE] RETURNS [champ: Point]; <> <> << - - - - BALOON SELECTION >> BaloonSelect: PROC [start: IntCoords, NextPoint: NextPointProc]; <> <> NextPointProc: TYPE = PROC RETURNS [coords: IntCoords, lastPoint: BOOL]; AnyWoundPoints: PROC RETURNS [BOOL]; <> ItemIsWound: PROC [item: Item] RETURNS [wound: BOOL]; <> UnwindAllPoints: PROC; <> << - - - - OPERATIONS ON BALOON-SELECTED POINTS >> DeleteWoundItems: PROC; <> <> <> DuplicateWoundItems: PROC; <> <> <> << - - - - POINT IDENTIFICATION >> IdentifyPoints: PROC; <> << Also sets p.copy _ NIL for all points p in the image>> << - - - - CONSTRAINT SOLVING >> SolveImage: PROC [eps: REAL] RETURNS [outcome: Solv.Outcome]; << Solves the image constraints for all image points that have p.fixed=FALSE.>> << Reorders the points according to their new coordinates.>> << Does NOT refresh the image on the screen.>> END.