Advanced topics

This section describes the classes for defining an interface for iterating through the geometries of a TGArea to determine whether a point lies within the area or outside the area.An algorithm is provided to iterate through the geometries so that an area can be filled, framed, and hit tested; very few programmers will need the information presented here.

Filling, framing, and hit testing work as described in Chapter 3 for all basic 2D graphics, including areas, without the need to write code for any of these operations. You need to write code to iterate through the TGArea geometries when you want to create your own filling, framing, or hit testing algorithms, or when you need to know which points of the geometries lie inside or outside of the area for some other purpose.

The information in TGArea is iterated for operations such as filling, framing, and hit testing because a device needs to know what portions of the geometries to draw, or whether a point in one of the geometries is also a point in the area. Figure 68 shows a TGArea that consists of a rectangle, ellipse, and a polygon. Although the complete data for all three geometries is known to TGArea, only the points that lie within the heavy outline are drawn. Any points that lie outside of the heavy outline are not drawn and would return False on a hit test.



[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