DIRECTORY GGBasicTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, Imager, ImagerTransformation, Rope, Rosary; GGObjects: CEDAR DEFINITIONS = BEGIN BoundBox: TYPE = GGModelTypes.BoundBox; Slice: TYPE = GGModelTypes.Slice; 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; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; fillColor: PUBLIC Imager.Color; 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]; DeleteOutline: PROC [scene: Scene, outline: Outline]; AddSlice: PROC [scene: Scene, slice: Slice, priority: INT]; AddEntities: PROC [scene: Scene, entities: LIST OF REF ANY]; AddEntity: PROC [scene: Scene, entity: REF ANY, priority: INT]; DeleteEntity: PROC [scene: Scene, entity: REF ANY]; DeleteSequence: PROC [seq: Sequence, scene: Scene] RETURNS [oldOutline: Outline, newOutlines: LIST OF Outline]; UpOne: PROC [scene: Scene, entity: REF ANY]; DownOne: PROC [scene: Scene, entity: REF ANY]; IsTopLevel: PROC [entity: REF ANY] RETURNS [BOOL]; TopLevelEntitiesInScene: PROC [scene: Scene] RETURNS [entityGenerator: EntityGenerator]; NextEntity: PROC [g: EntityGenerator] RETURNS [next: REF ANY]; EntityCount: PROC [g: EntityGenerator] RETURNS [count: NAT]; 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, gargoyleData: GargoyleData] RETURNS [traj: Traj, segNum: NAT, isSlice: BOOL]; NearestTrajectoryInScene: PROC [scene: Scene, worldPt: Point, gargoyleData: GargoyleData] RETURNS [traj: Traj]; SaveSelections: PROC [scene: Scene]; RestoreSelections: PROC [scene: Scene]; GetSelections: PROC [scene: Scene, selectClass: GGSegmentTypes.SelectionClass] RETURNS [selected: LIST OF REF ANY]; END. GGObjects.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited by Bier on December 28, 1986 4:05:19 pm PST Contents: The procedural interface to the Gargoyle object modeler. Stone, August 5, 1985 1:01:40 pm PDT Pier, December 11, 1986 3:44:33 pm PST 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. 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. Adds the entities, assumed to be in back to front order, to the scene. IF priority = -1, they become the frontmost entities. IF priority = 0, they become the rearmost. Adds the entity to the scene. If priority = 0, it becomes the rearmost entity. IF priority = -1, it becomes the frontmost entity. 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 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œžœ<žœžœ žœ˜ˆKšœí™íK˜—š¡œžœ<žœ˜oKšœœ™œ—K™K™ K™Kš¡œžœ˜$Kš¡œžœ˜'Kš¡ œžœ<žœ žœžœžœžœ˜sK˜Kšžœ˜K™—…— n5