DIRECTORY GGGravity, GGBasicTypes, GGModelTypes, GGInterfaceTypes; GGAlign: CEDAR DEFINITIONS = BEGIN Caret: TYPE = GGInterfaceTypes.Caret; FeatureData: TYPE = GGGravity.FeatureData; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; Line: TYPE = GGBasicTypes.Line; ObjectBag: TYPE = GGGravity.ObjectBag; Outline: TYPE = GGModelTypes.Outline; OutlineDescriptor: TYPE = GGModelTypes.OutlineDescriptor; Point: TYPE = GGBasicTypes.Point; Scene: TYPE = GGModelTypes.Scene; SelectionClass: TYPE = GGInterfaceTypes.SelectionClass; Sequence: TYPE = GGModelTypes.Sequence; Slice: TYPE = GGModelTypes.Slice; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; Traj: TYPE = GGModelTypes.Traj; TriggerBag: TYPE = REF TriggerBagObj; TriggerBagObj: TYPE = GGInterfaceTypes.TriggerBagObj; Vector: TYPE = GGBasicTypes.Vector; FilterOutlineProc: TYPE = PROC [outlineD: OutlineDescriptor]; FilterSliceProc: TYPE = PROC [sliceD: SliceDescriptor]; PointFilterProc: TYPE = GGGravity.PointFilterProc; SegmentFilterProc: TYPE = GGGravity.SegmentFilterProc; emptyTriggerBag: TriggerBag; CreateTriggerBag: PROC [] RETURNS [triggerBag: TriggerBag]; CreateOutlineTrigger: PUBLIC PROC [outlineD: OutlineDescriptor, triggerBag: TriggerBag] RETURNS [feature: FeatureData]; CreateSliceTrigger: PROC [sliceD: SliceDescriptor, triggerBag: TriggerBag] RETURNS [feature: FeatureData]; CreateAnchorTrigger: PUBLIC PROC [anchor: Caret, triggerBag: TriggerBag] RETURNS [feature: FeatureData]; DeleteAnchorTrigger: PUBLIC PROC [triggerBag: TriggerBag]; DeleteTriggers: PROC [seq: Sequence, triggerBag: TriggerBag]; AddTriggersFilter: PROC [triggerBag: TriggerBag, filterOutlineProc: FilterOutlineProc, filterSliceProc: FilterSliceProc, gargoyleData: GargoyleData]; DeleteTriggersFilter: PROC [triggerBag: TriggerBag, filterOutlineProc: FilterOutlineProc, filterSliceProc: FilterSliceProc]; CopyTriggerBag: PROC [triggerBag: TriggerBag] RETURNS [copy: TriggerBag]; BuiltInFilters: PROC [triggerBag: TriggerBag, objectBag: ObjectBag, gargoyleData: GargoyleData]; AddAllMidpoints: PROC [sceneTriggers: TriggerBag, objectBag: ObjectBag, gargoyleData: GargoyleData]; IncrementalFilters: PROC [trigger: FeatureData, objectBag: ObjectBag, gargoyleData: GargoyleData] RETURNS [alignObjects: LIST OF FeatureData]; SetBagsForAction: PROC [gargoyleData: GargoyleData, atom: ATOM]; UpdateBagsForAction: PROC [gargoyleData: GargoyleData, atom: ATOM] RETURNS [repaintNeeded: BOOL]; SetSceneBagForAction: PROC [gargoyleData: GargoyleData, atom: ATOM]; RemakeBagsAfterSceneChange: PROC [gargoyleData: GargoyleData]; RemakeObjectBag: PROC [gargoyleData: GargoyleData]; ReplaceObsoleteOutlineTrigger: PROC [gargoyleData: GargoyleData, oldOutline: Outline, newOutline: Outline]; END. €GGAlign.mesa Contents: Allows the client to build a set of trigger objects (joints, segments, and control points) which can be sent through a GGGravity filter to create a set alignment objects. Pier, July 24, 1986 3:28:19 pm PDT Bier, January 8, 1987 0:43:50 am PST Building a TriggerBag. Use this as an (immutable) empty TriggerBag. Add outlineD to triggerBag and return the new feature which represents outlineD. Add slice to triggerBag and return the new feature which represents slice. Add anchor to triggerBag and return the new feature which represents anchor. When this procedure is called, all sequences in the scene are passed to AddFilterProc to see if they should be added (in all or in part). filterProc should return those parts which should be added (it returns them by leaving their selected bits TRUE in the sequence which it is passed). AddTriggersFilter adds these parts to triggerBag. When this procedure is called, all sequences in triggerBag are passed to filterProc. filterProc should return those parts which should NOT be deleted (it returns them by leaving their selected bits TRUE in the sequence which it is passed), leaving the sequence unmodified, if all its parts should remain on the list. Using a TriggerBag to make an ObjectBag. All at once. Given a new trigger. Building Trigger Bags and Objects Bags at the Same Time From scratch, build up the current trigger bag, the scene trigger bag, and the current object bag, using the current filters. atom can be $CaretPos or $Drag. The choice of atom determines which additonal heuristics will be used to add triggers to the trigger bag, and which objects will be removed because they are considered "moving". If we are about to do an Add or Drag, then we expect that the triggerBag is OK except that the moving trajectory's sequences are obsolete, the moving segment must be removed, and heuristic objects must be added. The sceneBag is OK except that moving objects must be removed. The objectBag should then be regenerated from the new triggerBag. From scratch, build up the scene trigger. Leave the current trigger bag and current object bag alone. atom can be $CaretPos or $Drag. The choice of atom determines which objects will be removed because they are considered "moving". Some change in the scene has occurred. For instance, an object has been made hot or cold. A hot object has been deleted. A hot segment has changed its spline type. Remake the bags as appropriate. Use the current state of the bags to figure out which heuristics will be used to add triggers to the trigger bag. A new kind of alignment object has been selected or deselected. Different heuristics are now appropriate. Or perhaps the caller has added a new trigger manually. Make new object bags from the existing trigger bags. Used by GGMouseEventImplA.StartAdd to get the obsolete sequences out of the trigger bags before calling UpdateBagsForAction. Ê[˜Icode™ ™µK™"K™$—šÏk ˜ Kšœ ˜ Kšœ ˜ Kšœ ˜ Kšœ˜—K˜Kšœ œ œ˜Kš˜˜Kšœœ˜%Kšœ œ˜*Kšœœ!˜3Kšœœ˜Kšœ œ˜&Kšœ œ˜%Kšœœ"˜9Kšœœ˜!Kšœœ˜!Kšœœ#˜7Kšœ œ˜'Kšœœ˜!Kšœœ ˜5Kšœœ˜Kšœ œœ˜%Kšœœ"˜5Kšœœ˜#—K˜KšÏnœœœ˜=Kšžœœœ˜7Kšžœœ˜2Kšžœœ˜6K˜KšÏb™K™šœ˜Kšœ,™,—Kšžœœœ˜;K˜šžœœœ7œ˜wKšœP™P—šžœœ3œ˜jKšœJ™J—Kšžœœœ)œ˜hšžœœœ˜:KšœL™L—K˜Kšžœœ)˜=šžœœ~˜•KšœÒ™Ò—šžœœb˜|Kšœ½™½—Kšžœœœ˜IK˜K˜KšŸ(™(K™K™ K™KšžœœL˜`KšžœœO˜dK˜K™Kš žœœJœœœ˜ŽK˜KšŸ7™7K™šžœœ$œ˜@KšœÑ™Ñ—š žœœ$œœœ˜aK™ÖK™—šžœœ$œ˜DKšœê™êK™—šžœœ˜>Kšœº™ºK™—šžœœ˜3KšœÙ™Ù—KšžœœH˜kšœ|™|K˜—Kšœ˜—…— ¶‘