Worldwind public release 0.2.1
[worldwind-tracker.git] / gov / nasa / worldwind / geom / Extent.java
blob1eb8b5d7287b69a9741fbc2393f3de98f7a32245
1 /*
2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
5 All Rights Reserved.
6 */
7 package gov.nasa.worldwind.geom;
9 /**
10 * Represents an enclosing volume.
12 * @author Tom Gaskins
13 * @version $Id: Extent.java 1990 2007-06-09 23:19:06Z dcollins $
15 public interface Extent
17 Vec4 getCenter();
19 double getDiameter();
21 double getRadius();
23 /**
24 * Tests whether or not this <code>Extent</code> intersects <code>frustum</code>. Returns true if any part of these
25 * two objects intersect, including the case where either object wholly contains the other, false otherwise.
27 * @param frustum the <code>Frustum</code> with which to test for intersection
28 * @return true if there is an intersection, false otherwise
30 boolean intersects(Frustum frustum);
32 /**
33 * Obtain the intersections of this extent with <code>line</code>. The returned array may be either null or of zero
34 * length if no intersections are discovered. It does not contain null elements. Tangential intersections are marked
35 * as such. <code>line</code> is considered to have infinite length in both directions.
37 * @param line the <code>Line</code> with which to intersect this <code>Extent</code>
38 * @return an array of intersections representing all the points where <code>line</code> enters or leave this
39 * <code>Extent</code>
41 gov.nasa.worldwind.geom.Intersection[] intersect(gov.nasa.worldwind.geom.Line line);
43 /**
44 * Calculate whether or not <code>line</code> intersects this <code>Extent</code>. This method may be faster than
45 * checking the size of the arary returned by <code>intersect(Line)</code>. Implementing methods must ensure that
46 * this method returns true if and only if <code>intersect(Line)</code> returns a non-null array containing at least
47 * one element.
49 * @param line the <code>Line</code> with which to test for intersection
50 * @return true if an intersection is found, false otherwise
52 boolean intersects(gov.nasa.worldwind.geom.Line line);
54 /**
55 * Calculate whether or not this <code>Extent</code> is intersected by <code>plane</code>.
57 * @param plane the <code>Plane</code> with which to test for intersection
58 * @return true if <code>plane</code> is found to intersect this <code>Extent</code>
60 boolean intersects(gov.nasa.worldwind.geom.Plane plane);