GGAlign.mesa
Contents: Allows the client to build a set of trigger objects (joints, segments, and control points) which can be sent through a gravity filter to create a set alignment objects.
Pier, November 10, 1987 11:56:55 pm PST
Bier, May 28, 1990 6:13:48 pm PDT
Eisenman, September 28, 1987 6:32:41 pm PDT
DIRECTORY
GGBasicTypes, GGCoreTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, GGState, Imager;
GGAlign: CEDAR DEFINITIONS = BEGIN
AlignBag: TYPE = GGInterfaceTypes.AlignBag;
Caret: TYPE = GGInterfaceTypes.Caret;
FeatureData: TYPE = GGInterfaceTypes.FeatureData;
Filters: TYPE = GGInterfaceTypes.Filters;
GGData: TYPE = GGInterfaceTypes.GGData;
Line: TYPE = GGCoreTypes.Line;
Point: TYPE = GGBasicTypes.Point;
Scene: TYPE = GGModelTypes.Scene;
SelectionClass: TYPE = GGSegmentTypes.SelectionClass;
Sequence: TYPE = GGModelTypes.Sequence;
Slice: TYPE = GGModelTypes.Slice;
SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor;
SliceParts: TYPE = GGModelTypes.SliceParts;
Traj: TYPE = GGModelTypes.Traj;
TrajEnd: TYPE = GGModelTypes.TrajEnd;
TriggerBag: TYPE = REF TriggerBagObj;
TriggerBagObj: TYPE = GGInterfaceTypes.TriggerBagObj;
Vector: TYPE = GGBasicTypes.Vector;
FilterSliceProc: TYPE = PROC [sliceD: SliceDescriptor, scene: Scene, editConstraints: GGModelTypes.EditConstraints, bezierDrag: GGInterfaceTypes.BezierDragRecord] RETURNS [stationary: SliceDescriptor, someRemoved: BOOLFALSE];
sliceD describes those parts of sliceD.slice that are in the trigger bag (because they are hot). A FilterSliceProc will figure out which parts of this slice are moving and subtract them from sliceD. If this changes sliceD, someRemoved will be TRUE.
[Artwork node; type 'ArtworkInterpress on' to command tool]
TriggerBag
emptyTriggerBag: TriggerBag;
Use this as an (immutable) empty TriggerBag.
CreateTriggerBag: PROC [] RETURNS [triggerBag: TriggerBag];
Allocates a new empty TriggerBag.
FlushTriggerBag: PROC [triggerBag: TriggerBag];
Takes an old TriggerBag and makes it empty.
EmptyTriggerBag: PROC [triggerBag: TriggerBag] RETURNS [BOOL];
CopyTriggerBag: PROC [to, from: TriggerBag];
FeatureWalkProc: TYPE = PROC [feature: FeatureData] RETURNS [done: BOOLFALSE];
WalkSliceTriggers: PROC [triggerBag: TriggerBag, walkProc: FeatureWalkProc];
FeatureFromSlice: PROC [slice: Slice, parts: SliceParts ← NIL] RETURNS [feature: FeatureData];
FeatureFromAnchor: PROC [anchor: Caret] RETURNS [feature: FeatureData];
FillStaticTriggerBag: PROC [anchor: Caret, scene: Scene, heuristics: BOOL, triggerBag: TriggerBag];
FillDynamicTriggerBag: PROC [anchor: Caret, scene: Scene, heuristics: BOOL, triggerBag: TriggerBag, editConstraints: GGModelTypes.EditConstraints, bezierDrag: GGInterfaceTypes.BezierDragRecord];
Allocates a copy of triggerBag. The copy shares featureDatas with the original but has freshly allocated LIST structures.
SceneBag
FillStaticSceneBag: PROC [scene: Scene, sceneBag: TriggerBag];
FillDynamicSceneBag: PROC [scene: Scene, sceneBag: TriggerBag, editConstraints: GGModelTypes.EditConstraints, bezierDrag: GGInterfaceTypes.BezierDragRecord];
AlignBag
emptyAlignBag: AlignBag; -- an (immutable) empty object bag.
CreateAlignBag: PROC [] RETURNS [alignBag: AlignBag];
FlushAlignBag: PROC [alignBag: AlignBag];
EmptyAlignBag: PROC [alignBag: AlignBag] RETURNS [BOOL];
JointAddSlopeLine: PROC [degrees: REAL, point: Point, alignBag: AlignBag] RETURNS [feature: FeatureData];
Add a line making an angle "degrees" with horizontal, passing through point.
WalkSlopeLines: PROC [alignBag: AlignBag, walkProc: FeatureWalkProc];
Adds the new feature to alignBag and returns it for the caller's inspection.
JointAddCircle: PROC [radius: REAL, point: Point, alignBag: AlignBag] RETURNS [feature: FeatureData];
Adds the new feature to alignBag and returns it for the caller's inspection.
SegmentAddTwoAngleLines: PROC [degrees: REAL, segNum: NAT, lo, hi: Point, alignBag: AlignBag] RETURNS [line1, line2: FeatureData];
Adds the new feature to alignBag and returns it for the caller's inspection.
SegmentAddDistanceLines: PROC [distance: REAL, segNum: NAT, lo, hi: Point, alignBag: AlignBag] RETURNS [line1, line2: FeatureData];
Adds the new feature to alignBag and returns it for the caller's inspection.
FillStaticAlignBag: PROC [triggerBag: TriggerBag, sceneBag: TriggerBag, ggData: GGData, hideAlignments: BOOL, alignBag: AlignBag];
FillDynamicAlignBag: PROC [triggerBag: TriggerBag, sceneBag: TriggerBag, ggData: GGData, hideAlignments: BOOL, action: ATOM, alignBag: AlignBag];
Filling all of the Bags at Once
SetStaticBags: PROC [ggData: GGData];
SetStaticTriggerAndAlignBags: PROC [ggData: GGData];
Like SetStaticBags, but leave the scene bag alone.
SetDynamicBags: PROC [ggData: GGData, action: ATOM];
StaticToDynamicBags: PROC [ggData: GGData, saveForeground: BOOLTRUE];
repaintForeground is TRUE if the current foreground bitmap must be changed for dynamic use. augmentForeground is TRUE if this change is strictly a matter of adding more lines.
DynamicToStaticBags: PROC [ggData: GGData, restoreForeground: BOOLTRUE];
UpdateBagsForAdd: PROC [oldAncestor: Slice, newAncestorD: SliceDescriptor, trajEnd:
TrajEnd, ggData: GGData] RETURNS [repaintForeground: BOOL];
UpdateBagsForNewSlices: PROC [newSlices: LIST OF Slice, ggData: GGData];
UpdateBagsForDelete: PROC [oldAncestor: Slice, ggData: GGData] RETURNS [repaintForeground: BOOL];
The Filter Routines shown in the figure as boxes and ovals
FilterLists: TYPE = REF FilterListsObj;
FilterListsObj: TYPE = GGState.FilterListsObj;
BuiltInFilters: PROC [triggerBag: TriggerBag, ggData: GGData, hideAlignments: BOOL, alignBag: AlignBag];
Incremental Addition versions of the Filter Routines shown in the figure as boxes and ovals.
CreateAnchorTrigger: PUBLIC PROC [anchor: Caret, triggerBag: TriggerBag] RETURNS [feature: FeatureData];
Just like AddAnchorTrigger except it returns the feature in addition to adding it to the triggerBag.
AddSliceFeature: PROC [sliceD: SliceDescriptor, triggerBag: TriggerBag] RETURNS [newFeature: FeatureData];
Add slice to triggerBag and return the new feature which represents slice.
RemoveMovingSlice: PROC [sliceD: SliceDescriptor, scene: Scene, editConstraints: GGModelTypes.EditConstraints, bezierDrag: GGInterfaceTypes.BezierDragRecord] RETURNS [stationary: SliceDescriptor, someRemoved: BOOLFALSE];
Returns those part of slice that are in sliceD but are not moving. someRemoved is TRUE if stationary is a subset of sliceD.
IncrementalNewTrigger: PROC [trigger: FeatureData, filterLists: FilterLists, hideAlignments: BOOL, alignBag: AlignBag] RETURNS [alignObjects: LIST OF FeatureData];
FilterType: TYPE = {slope, radius, angle, distance};
IncrementalNewFilter: PROC [value: REAL, filterType: FilterType, triggerBag: TriggerBag, hideAlignments: BOOL, alignBag: AlignBag] RETURNS [alignObjects: LIST OF FeatureData];
IncrementalFilterSlice: PROC [sliceD: SliceDescriptor, filterLists: FilterLists, hideAlignments: BOOL, alignBag: AlignBag] RETURNS [alignObjects: LIST OF FeatureData];
Incremental Deletion versions of the Filter Routines shown in the figure as boxes and ovals.
RemoveAnchorTrigger: PUBLIC PROC [triggerBag: TriggerBag];
RemoveEntireHotSlice: PROC [slice: Slice, triggerBag: TriggerBag] RETURNS [oldSliceD: SliceDescriptor];
RemoveHotSlice: PROC [sliceD: SliceDescriptor, triggerBag: TriggerBag];
RemoveMentionSlice: PROC [slice: Slice, alignBag: AlignBag];
Removes all alignment objects that were triggered (only) by this slice. Removes mention of this slice from those alignment objects that are trigger by other triggers as well.
Drawing Alignment Objects
CreateLineTable: PROC [ggData: GGData]; -- called by GGWindow.CreateWindow
FlushLineTable: PROC [ggData: GGData]; -- called by GGRefreshImpl
HasVisibleObjects: PROC [alignBag: AlignBag] RETURNS [BOOL];
DrawFeatureList: PROC [dc: Imager.Context, alignObjects: LIST OF FeatureData, ggData: GGData];
DrawAlignBagRegardless: PROC [dc: Imager.Context, alignBag: AlignBag, ggData: GGData];
Draws all objects in the object bag regardless of how they have been marked.
MakeFiltersGarbage: PROC [filters: Filters];
Ruthlessly destroy the various filter bags so the Cedar gargbage collector can sweep up.
Wizards only.
END.