DIRECTORY GGInterface, GGInterfaceTypes, GGModelTypes, GGObjects, GGOutline, GGSelect, Rope; GGInterfaceImpl: CEDAR PROGRAM IMPORTS GGObjects, GGOutline, GGSelect EXPORTS GGInterface = BEGIN Outline: TYPE = GGModelTypes.Outline; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; 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]; GGObjects.DeleteOutline[scene, outline]; }; FetchTraj: PROC [outline: Outline, index: NAT] RETURNS [traj: Traj] = { trajGen: TrajGenerator _ GGOutline.TrajsInOutline[outline]; FOR t: Traj _ GGObjects.NextTraj[trajGen], GGObjects.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] _ GGObjects.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 _ GGObjects.NextTraj[trajGen], GGObjects.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]; GGObjects.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 GGObjects, 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™