ExtentVisibilitySupport provides visibility tests and computations on objects with 3D extents in model coordinates, and on objects with 2D extents in screen coordinates. The caller configures ExtentVisibilitySupport with an Iterable of {@link gov.nasa.worldwind.geom.Extent} instances and {@link gov.nasa.worldwindx.examples.util.ExtentVisibilitySupport.ScreenExtent}instances by invoking {@link #setExtents(Iterable)} and {@link #setScreenExtents(Iterable)}, respectively. These Iterables defines ExtentVisibilitySupport's scene elements. ExtentVisibilitySupport keeps a direct reference to these Iterables; it does not attempt to copy or modify them in any way. Any null elements in these Iterables are ignored. The static convenience method {@link #extentsFromExtentHolders(Iterable,gov.nasa.worldwind.globes.Globe,double)}makes it easy to for callers to convert an Iterable of Extents references to an Iterable of {@link gov.nasa.worldwind.geom.ExtentHolder} references.
The method {@link #areExtentsContained(gov.nasa.worldwind.View)} provides a mechanism for callers to test whether ornot the currently configured scene is entirely contained within a certain {@link gov.nasa.worldwind.View}. This method tests containment on both the model coordinate extents and screen coordinate extents.
The method {@link #computeViewLookAtContainingExtents(gov.nasa.worldwind.globes.Globe,double,gov.nasa.worldwind.View)} returns a viewing coordinate system which contains the currently configured scene, whilepreserving the current view's orientation to the globe (heading and pitch). This has the effect of computing the pan and zoom parameters necessary for a View to contain the current scene. Depending on the current scene, the computed view may represent a best-estimate, and not the final parameters necessary to contain the scene. If the scene contains model coordinate extents which depend on the view, or screen coordinate extents, the caller should invoke this method iteratively (after applying view changes from the previous call) until the returned view coordinate system converges on values which contain the scene.
@author dcollins
@version $Id: ExtentVisibilitySupport.java 1171 2013-02-11 21:45:02Z dcollins $
@see gov.nasa.worldwind.geom.Extent
@see gov.nasa.worldwind.geom.ExtentHolder
@see gov.nasa.worldwindx.examples.util.ExtentVisibilitySupport.ScreenExtent