Finding the bounds and hit detection

TGraphicGroup inherits the GetLooseFitBounds and GetGeometricBounds functions from MGraphic described in Chapter 3. When you call one of these functions on a group, the appropriate bounds are returned for the entire group.

If you want to find the bounds on a nested group or graphic within the group, you have to use an iterator to locate the graphic or nested group that has been selected. To do this, call the TGraphicGroup::CreateIterator function that returns a TGraphicIterator instance. TGraphicIterator is an abstract base class, and by default CreateIterator creates a shallow iterator that iterates one level of the group. See the heading "Hit testing a group" on page 201 for a simple example using TGraphicGroup::CreateIterator.


[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