DIRECTORY GGInterface, GGInterfaceTypes, GGModelTypes, GGScene, GGOutline, GGSelect, Rope; GGInterfaceImpl: CEDAR PROGRAM IMPORTS GGScene, GGOutline, GGSelect EXPORTS GGInterface = BEGIN Outline: TYPE = GGModelTypes.Outline; GGData: TYPE = GGInterfaceTypes.GGData; Scene: TYPE = GGModelTypes.Scene; Sequence: TYPE = GGInterfaceTypes.Sequence; Traj: TYPE = GGModelTypes.Traj; TrajGenerator: TYPE = GGModelTypes.TrajGenerator; DeleteOutline: PUBLIC PROC [outline: Outline, scene: Scene] = { GGSelect.DeselectEntityAllClasses[outline, scene]; GGScene.DeleteOutline[scene, outline]; }; FetchTraj: PROC [outline: Outline, index: NAT] RETURNS [traj: Traj] = { trajGen: TrajGenerator _ GGOutline.TrajsInOutline[outline]; FOR t: Traj _ GGScene.NextTraj[trajGen], GGScene.NextTraj[trajGen] UNTIL t = NIL DO IF index = 0 THEN RETURN[t]; index _ index - 1; ENDLOOP; RETURN[NIL]; }; DeleteSequence: PUBLIC PROC [seq: Sequence, scene: Scene] RETURNS [oldOutline: Outline, newOutlines: LIST OF Outline] = { GGOutline.SaveSelectionsInOutline[seq.traj.parent, scene]; [oldOutline, newOutlines] _ GGScene.DeleteSequence[seq, scene]; GGSelect.DeselectEntityAllClasses[oldOutline, scene]; FOR list: LIST OF Outline _ newOutlines, list.rest UNTIL list = NIL DO GGOutline.RemakeSelectionsFromOutline[list.first, scene]; ENDLOOP; }; IndexOfTraj: PROC [traj: Traj, outline: Outline] RETURNS [index: NAT] = { trajGen: TrajGenerator; trajGen _ GGOutline.TrajsInOutline[outline]; index _ 0; FOR t: Traj _ GGScene.NextTraj[trajGen], GGScene.NextTraj[trajGen] UNTIL t = NIL DO IF t = traj THEN RETURN; index _ index + 1; ENDLOOP; SIGNAL Problem[msg: "trajectory not found"]; }; Problem: PUBLIC SIGNAL [msg: Rope.ROPE] = CODE; AddHole: PUBLIC PROC [outline: Outline, hole: Traj, scene: Scene] RETURNS [holier: Outline] = { holeOutline: Outline _ GGOutline.OutlineOfTraj[hole]; IF holeOutline = outline THEN ERROR; holier _ GGOutline.AddHole[outline, hole]; DeleteOutline[holeOutline, scene]; DeleteOutline[outline, scene]; GGScene.AddOutline[scene, holier, -1]; }; END. ΖGGInterfaceImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last edited by Bier on March 12, 1986 2:54:25 pm PST Contents: A veneer on top of GGScene, which keeps the interface level data structures consistent with changes to the modeled objects. Store all selection information about this outline in the outline itself. Perform the delete. Remove all references to the old outline. Restore references to the new outlines. ΚΉ˜J˜Icodešœ™Kšœ Οmœ1™