GGConventions.tioga Author: Eric Bier on January 5, 1986 4:17:06 pm PST Last edited by Bier on January 30, 1986 5:23:20 pm PST This is a centralized place to put lore about Gargoyle. In particular, the history behind certain data structures, the invariants maintained by certain modules, and a list of kludges known to be in force. This is also a good place to keep lists -- e.g. the list of all procedures which have to be rewritten if data structure X changes. Conventions The Scene: Our First Opaque Type Scenes are an opaque type, visible inside GGSceneImpl and defined in GGSceneType.mesa. This guarantees that only GGSceneImpl touches the entity list. Hence, we can change this data structure as we please to make commands like AddOutline run fast. The Caret: Chairs and Attractors The original idea between chairs and attractors was to build up a data structure of what was touching what. The caret would act as a kind of soldering iron. When a dragging operation completed, the object that moved with the caret (the chair) and the object that the caret snapped to (the attractor) would be listed as touching. This use has been abandoned. We didn't find enough use for the touching data structure to warrant the effort needed to maintain it. Unfortunately, chairs and attractors have been used for other purposes so we can't just get rid of them. Here are their uses: Chair Heuristics: During add, the chair trajectory was automatically hot. The chair should no longer be used for this. The new joint is simply selected and the same heuristics are used as for drag. Close: The Close command closes the chair trajectory. Now that Add works by selecting a joint, Close could just work on the selected trajectories. GGEventImplA.DescribeCaretObject describes the chair. It can be removed when chairs are no more. Adding: The caret to be extended is the trajectory that has the caret sitting on its end. I don't know of a good way to get rid of this use of the chair. When writing a routine that may modify a trajectory that the caret is sitting on, it is safest to put GGCaret.SitOn[caret, nothing] in that routine. GGEventImplB.DeleteCaretSegment is used to abort Add, and to "BackSpace" over segments. These uses cannot be removed until Add works differently. Conclusion: Chairs should be used for adding segment to trajectories, only. I know of no reason that the caret should sit on a slice. Attractor GGEventImplC.AddControlPoint. The trajectory that most recently attracted the caret gets a new control point added to it. This is ambiguous because of the difficulty of getting the caret to snap to just what you want it to. GGEventImplC.AddJoint. The trajectory that most recently attracted the caret gets a new joint added to it. This is ambiguous because of the difficulty of getting the caret to snap to just what you want it to. Conclusion: Attractors aren't being used for much either. We may do well to try to phase them out so we don't have to maintain them everywhere. Color Setting the color. Color is part of the Imager state. If it changes unexpectedly, an incorrect picture can result. In Gargoyle, the color is never changed by a call to a GGShapes procedure. It is changed by GGRefresh.DrawOutline and GGRefresh.DrawTraj. Callers of GGShapes procedures (e.g. GGGravityImpl.DrawObjectBagRegardless must set the color before calling these procedures. Names <> Slices <