DIRECTORY GGBasicTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, Imager, ImagerTransformation, Rope, Rosary; GGScene: CEDAR DEFINITIONS = BEGIN BoundBox: TYPE = GGModelTypes.BoundBox; Slice: TYPE = GGModelTypes.Slice; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; Joint: TYPE = GGModelTypes.Joint; Outline: TYPE = GGModelTypes.Outline; Point: TYPE = GGBasicTypes.Point; Scene: TYPE = GGModelTypes.Scene; Sequence: TYPE = GGModelTypes.Sequence; Traj: TYPE = GGModelTypes.Traj; TrajEnd: TYPE = GGModelTypes.TrajEnd; -- {lo, hi} Segment: TYPE = GGSegmentTypes.Segment; Vector: TYPE = GGBasicTypes.Vector; EntityGenerator: TYPE = GGModelTypes.EntityGenerator; OutlineGenerator: TYPE = GGModelTypes.OutlineGenerator; TrajGenerator: TYPE = GGModelTypes.TrajGenerator; SliceGenerator: TYPE = GGModelTypes.SliceGenerator; BoundBoxGenerator: TYPE = GGModelTypes.BoundBoxGenerator; GGData: TYPE = GGInterfaceTypes.GGData; CreateScene: PROC [] RETURNS [scene: Scene]; MergeScenes: PROC [back: Scene, front: Scene] RETURNS [combined: Scene]; PushScene: PROC [scene: Scene]; EmptySceneStack: PROC [scene: Scene] RETURNS [BOOL]; PopScene: PROC [scene: Scene]; AddOutline: PROC [scene: Scene, outline: Outline, priority: INT _ -1]; DeleteOutline: PROC [scene: Scene, outline: Outline]; AddSlice: PROC [scene: Scene, slice: Slice, priority: INT _ -1]; AddSlices: PROC [scene: Scene, slice: LIST OF Slice, priority: INT _ -1]; DeleteSlice: PROC [scene: Scene, slice: Slice]; SlicePriority: PROC [scene: Scene, slice: Slice] RETURNS [priority: INT]; DeleteSequence: PROC [seq: Sequence, scene: Scene] RETURNS [oldOutline: Outline, newOutlines: LIST OF Outline]; UpOne: PROC [scene: Scene, slice: Slice]; DownOne: PROC [scene: Scene, slice: Slice]; IsTopLevel: PROC [slice: Slice] RETURNS [BOOL]; TopLevelEntitiesInScene: PROC [scene: Scene] RETURNS [sliceGen: SliceGenerator]; TopLevelSlicesInScene: PROC [scene: Scene] RETURNS [sliceGen: SliceGenerator]; SlicesInScene: PROC [scene: Scene] RETURNS [sliceGen: SliceGenerator]; NextSlice: PROC [g: SliceGenerator] RETURNS [next: Slice]; TrajsInScene: PROC [scene: Scene] RETURNS [trajGen: TrajGenerator]; NextTraj: PROC [g: TrajGenerator] RETURNS [next: Traj]; OutlinesInScene: PROC [scene: Scene] RETURNS [outlineGen: OutlineGenerator]; NextOutline: PROC [g: OutlineGenerator] RETURNS [next: Outline]; BoundBoxesInScene: PROC [scene: Scene] RETURNS [bBoxGen: BoundBoxGenerator]; TightBoxesInScene: PROC [scene: Scene] RETURNS [bBoxGen: BoundBoxGenerator]; NextBox: PROC [g: BoundBoxGenerator] RETURNS [next: BoundBox]; BoundBoxOfScene: PROC [scene: Scene] RETURNS [bBox: BoundBox]; TightBoxOfScene: PROC [scene: Scene] RETURNS [bBox: BoundBox]; NearestSegmentInScene: PROC [scene: Scene, worldPt: Point, ggData: GGData] RETURNS [traj: Traj, segNum: NAT, isSlice: BOOL]; NearestTrajectoryInScene: PROC [scene: Scene, worldPt: Point, ggData: GGData] RETURNS [traj: Traj]; DeleteAllSelected: PROC [scene: Scene] RETURNS [bBox: BoundBox]; SaveSelections: PROC [scene: Scene]; RestoreSelections: PROC [scene: Scene]; GetSelections: PROC [scene: Scene, selectClass: GGSegmentTypes.SelectionClass] RETURNS [selected: LIST OF SliceDescriptor]; END. ¬GGScene.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited by Bier on April 6, 1987 10:24:53 pm PDT Contents: The procedural interface to the Gargoyle object modeler. Stone, August 5, 1985 1:01:40 pm PDT Pier, May 12, 1987 6:49:21 pm PDT Creating Scenes Makes a copy of the current scene list, and pushes it on a stack. For use in Undelete. Lets scene be the most recently pushed scene, that has not yet been popped. Modifying Scenes Add the given outline to the scene with the given priority (the higher the priority number, the closer the outline is to the front of the scene). If priority is -1, the outline will be the front-most entity. If the priority given is too high, we proceed as if priority = -1. Deletes the whole outline from the scene. Add the given slice to the scene with the given priority (the higher the priority number, the closer the outline is to the front of the scene). If priority is -1, the slice will be the front-most entity. If the priority given is too high, we proceed as if priority = -1. Adds the entities, assumed to be in back to front order, to the scene. IF priority = -1, they become the frontmost entities. Otherwise, the specified priority becomes the priority of the first entity in the list, if possible. If the priority given is too high, we proceed as if priority = -1. AddEntity: PROC [scene: Scene, entity: REF ANY, priority: INT _ -1]; Adds the entity to the scene. If priority = 0, it becomes the rearmost entity. IF priority = -1, it becomes the frontmost entity. If the priority given is too high, we proceed as if priority = -1. DeleteEntity: PROC [scene: Scene, entity: REF ANY]; Removes the named entity from the scene. If the entity is not on the list, no action is taken. Deletes some parts of an outline from the scene. The result can be multiple outlines if the original outline is broken up into pieces. The effect is as follows: Takes the trajectory of which seq is a part. What is the role of this trajectory? If role = hole, then create a new outline (and new trajectories), identical to seq.traj.outline, but without the hole. Make separate outlines corresponding to those parts of the hole which were not deleted. The old outline (and all of its parts) is now obsolete. If role = fence, then create new outlines and new trajectories for all of the parts of seq.traj.outline which remain. The old outline (and all of its parts) is now obsolete. If role = open, then create new outlines and new trajectories for all of the parts of seq.traj which remain. The old outline is obsolete. Moves the named entity one step closer to the front in the priority order. Moves the named entity one step closer to the back in the priority order. Browsing the Scene Hierarchy -- Generators TopLevelEntitiesInScene: PROC [scene: Scene] RETURNS [entityGenerator: EntityGenerator]; NextEntity: PROC [g: EntityGenerator] RETURNS [next: REF ANY]; EntityCount: PROC [g: EntityGenerator] RETURNS [count: NAT]; Returns the number of entities left in the generator. Generates all of the trajectories in the scene, wherever they occur. Bounding Boxes The bounding boxes of the top level entities, allowing for control points and stroke widths. The bounding boxes of the top level entities, NOT allowing for control points and stroke widths. The bounding box of the entire scene, allowing for control points and stroke widths. The bounding box of the entire scene, NOT allowing for control points and stroke widths. Hit Testing -- Outline-Specific routines. These should go away when Outlines become Slices. Searches all of the outlines and slices in the scene. Finds the closest segment. If this segment is part of a slice, isSlice = TRUE and other data is invalid. Otherwise, isSlice = FALSE, and traj, segNum describes the nearest segment. Searches all of the outlines and slices in the scene. Finds the closest. If this object is a slice, traj = NIL. Otherwise, it is the nearest trajectory. Selections ÊÓ˜code™ Kšœ Ïmœ1™š¡ œžœžœ žœ™š¡œžœžœ˜>K™T—š¡œžœžœ˜>K™X—K˜™\K˜—š Ðbnœžœ0žœžœ žœ˜|Kšœí™íK˜—š¡œžœ0žœ˜cKšœœ™œ—K™K™ K™Kš¡œžœžœ˜@Kš¡œžœ˜$Kš¡œžœ˜'Kš ¡ œžœ<žœ žœžœ˜{K˜Kšžœ˜K™—…— „!