Framed areas

Because a TArea is derived from MGraphic, it has a bundle that can specify a fill and a frame for the area. To determine whether points lie inside or outside of the area, the fill and frame must be taken into account. An area can be defined by three types of edges: a fill edge, a left frame edge, and a right frame edge as shown in Figure 75.

NOTE The terms left and right were chosen to distinguish the frame edge that is internal to the area from the frame edge that is external to the area.


The TCAGNode abstract base class shown in Figure 76 has three virtual transition functions, one for each type of edge. When an edge transition occurs, the TCAGUnary class calls the appropriate transition function.


However, the TCAGUnary class does not know whether the edge is a fill edge, or a left or right frame edge. This problem is solved during the construction of the CAG binary tree as follows:

  1. When an edge represents a fill edge, the edge's parent is a regular TCAGUnary node or one of its descendents. When a transition occurs, the edge calls its parent's Transition fill function and gets the desired results.
  2. When an edge represents a leftframe edge, its parent is a TCAGLeftFrameLink whose parent is a TCAGUnary node. The parent of TCAGLeftFrameLink is the "fill parent" or the node that would have been the edge's parent had the edge been a fill edge. When a transition occurs, the edge calls the fill transition function of its TCAGLeftFrameLink parent, which then calls the TransitionLeftFrame function of the fill parent. Conceptually, the edge is calling the TransitionLeftFrame function of its fill parent.
  3. When an edge represents a right frame edge, its parent is a TCAGRightFrameLink whose parent is a TCAGUnary node. The parent of TCAGRightFrameLink is the "fill parent" or the node that would have been the edge's parent had the edge been a fill edge. When a transition occurs, the edge calls the fill transition function of its TCAGRightFrameLink parent, which then calls the TransitionRightFrame function of its fill parent.
NOTE The frame transition functions of TCAGLeftFrameLink and TCAGRightFrameLink do nothing and should never be called.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker