All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.gov.nasa.worldwind.geom.Extent Maven / Gradle / Ivy

Go to download

World Wind is a collection of components that interactively display 3D geographic information within Java applications or applets.

There is a newer version: 2.0.0-986
Show newest version
/*
 * Copyright (C) 2012 United States Government as represented by the Administrator of the
 * National Aeronautics and Space Administration.
 * All Rights Reserved.
 */
package gov.nasa.worldwind.geom;

import gov.nasa.worldwind.View;

/**
 * Represents a volume enclosing one or more objects or collections of points. Primarily used to test intersections with
 * other objects.
 *
 * @author Tom Gaskins
 * @version $Id: Extent.java 1171 2013-02-11 21:45:02Z dcollins $
 */
public interface Extent
{
    /**
     * Returns the extent's center point.
     *
     * @return the extent's center point.
     */
    Vec4 getCenter();

    /**
     * Returns the extent's diameter. The computation of the diameter depends on the implementing class. See the
     * documentation for the individual classes to determine how they compute a diameter.
     *
     * @return the extent's diameter.
     */
    double getDiameter();

    /**
     * Returns the extent's radius. The computation of the radius depends on the implementing class. See the
     * documentation for the individual classes to determine how they compute a radius.
     *
     * @return the extent's radius.
     */
    double getRadius();

    /**
     * Determines whether or not this Extent intersects frustum. Returns true if any part of
     * these two objects intersect, including the case where either object wholly contains the other, false otherwise.
     *
     * @param frustum the Frustum with which to test for intersection.
     *
     * @return true if there is an intersection, false otherwise.
     */
    boolean intersects(Frustum frustum);

    /**
     * Computes the intersections of this extent with line. The returned array may be either null or of
     * zero length if no intersections are discovered. It does not contain null elements. Tangential intersections are
     * marked as such. line is considered to have infinite length in both directions.
     *
     * @param line the Line with which to intersect this Extent.
     *
     * @return an array of intersections representing all the points where line enters or leave this
     *         Extent.
     */
    gov.nasa.worldwind.geom.Intersection[] intersect(gov.nasa.worldwind.geom.Line line);

    /**
     * Determines whether or not line intersects this Extent. This method may be faster than
     * checking the size of the array returned by intersect(Line). Implementing methods must ensure that
     * this method returns true if and only if intersect(Line) returns a non-null array containing at least
     * one element.
     *
     * @param line the Line with which to test for intersection.
     *
     * @return true if an intersection is found, false otherwise.
     */
    boolean intersects(gov.nasa.worldwind.geom.Line line);

    /**
     * Calculate whether or not this Extent is intersected by plane.
     *
     * @param plane the Plane with which to test for intersection.
     *
     * @return true if plane is found to intersect this Extent.
     */
    boolean intersects(gov.nasa.worldwind.geom.Plane plane);

    /**
     * Computes the effective radius of the extent relative to a specified plane.
     *
     * @param plane the plane.
     *
     * @return the effective radius, or 0 if the plane is null.
     */
    double getEffectiveRadius(Plane plane);

    /**
     * Computes the area in square pixels of this Extent after it is projected into the specified
     * view's viewport. The returned value is the screen area that this Extent covers in the
     * infinite plane defined by the view's viewport. This area is not limited to the size of the
     * view's viewport, and portions of this Extent are not clipped by the view's
     * frustum.
     * 

* This returns Double.POSITIVE_INFINITY if the view's eye point is inside this * Extent, or if any portion of this Extent is behind the eye point. In either case, this * Extent has no finite projection on the view. * * @param view the View for which to compute a projected screen area. * * @return the projected screen area of this Extent in square pixels, or * Double.POSITIVE_INFINITY if the view's eye point is inside this * Extent or part of this Extent is behind the view's eye point. * * @throws IllegalArgumentException if the view is null. */ double getProjectedArea(View view); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy