public class BasicView extends WWObjectImpl implements View
View implementations can be derived. Currently BasicFlyView and BasicOrbitView are both
 derived from BasicView BasicView models the view in terms of a geographic position, and a pitch,
 heading, and roll. It provides a mapping from that geocentric view model to a 3D graphics modelview matrix. BasicView
 also manages the projection matrix via a Frustum.
 
 The view model is based on| Modifier and Type | Field and Description | 
|---|---|
| protected static int | COLLISION_NUM_ITERATIONS | 
| protected static double | COLLISION_THRESHOLD | 
| protected DrawContext | dc | 
| protected static double | DEFAULT_DEPTH_RESOLUTIONThe views's default worst-case depth resolution, in meters. | 
| protected boolean | detectCollisions | 
| protected Position | eyePosition | 
| protected double | farClipDistance | 
| protected Angle | fieldOfViewThe field of view in degrees. | 
| protected Frustum | frustum | 
| protected Globe | globe | 
| protected boolean | hadCollisions | 
| protected Angle | heading | 
| protected double | horizonDistance | 
| protected Vec4 | lastEyePoint | 
| protected Position | lastEyePosition | 
| protected Vec4 | lastForwardVector | 
| protected Frustum | lastFrustumInModelCoords | 
| protected Vec4 | lastUpVector | 
| protected static double | MINIMUM_FAR_DISTANCE | 
| protected static double | MINIMUM_NEAR_DISTANCE | 
| protected Matrix | modelview | 
| protected Matrix | modelviewInv | 
| protected double | nearClipDistance | 
| protected Angle | pitch | 
| protected Matrix | projection | 
| protected Angle | roll | 
| protected ViewInputHandler | viewInputHandler | 
| protected ViewPropertyLimits | viewLimits | 
| protected Rectangle | viewport | 
| protected long | viewStateIDIdentifier for the modelview matrix state. | 
VIEW_STOPPED| Constructor and Description | 
|---|
| BasicView()Construct a BasicView | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addAnimator(Animator animator)Add an animator to the this View. | 
| void | apply(DrawContext dc)Calculates and applies this  View'sinternal state to the graphics context in the specifieddc. | 
| protected Position | computeEyePositionFromModelview() | 
| protected double | computeFarClipDistance() | 
| protected double | computeFarDistance(Position eyePosition) | 
| protected double | computeHorizonDistance() | 
| protected double | computeHorizonDistance(Position eyePosition) | 
| protected double | computeNearClipDistance() | 
| protected double | computeNearDistance(Position eyePosition) | 
| double | computePixelSizeAtDistance(double distance)Computes the dimension (in meters) that a screen pixel would cover at a given distance from the eye point (also
 in meters). | 
| Position | computePositionFromScreenPoint(double x,
                              double y)Computes the intersection of a line originating from the eye point and passing through (x, y) with the
  Globe. | 
| Line | computeRayFromScreenPoint(double x,
                         double y)Computes a line, in model coordinates, originating from the eye point, and passing through the point contained by
 (x, y) on the  View'sprojection plane (or after projection into model space). | 
| void | copyViewState(View view)Copy the state of the given  View. | 
| protected void | doApply(DrawContext dc) | 
| protected void | doGetRestorableState(RestorableSupport rs,
                    RestorableSupport.StateObject context) | 
| protected void | doRestoreState(RestorableSupport rs,
              RestorableSupport.StateObject context) | 
| Vec4 | getCenterPoint()Gets the center point of the view. | 
| Position | getCenterPosition() | 
| Vec4 | getCurrentEyePoint()Returns the most up-to-date location of the eye in cartesian coordinates. | 
| Position | getCurrentEyePosition()Returns the current geographic coordinates of this view's eye position, as determined from this view's current
 parameters. | 
| Vec4 | getCurrentForwardVector()Returns the most up-to-date forward vector. | 
| DrawContext | getDC() | 
| Vec4 | getEyePoint()Returns the location of the eye in cartesian coordinates. | 
| Position | getEyePosition()Returns the current geographic coordinates of this view's eye position, as computed for the most recent model
 traversal. | 
| double | getFarClipDistance()Returns the far clipping plane distance, in eye coordinates. | 
| Angle | getFieldOfView()Returns the horizontal field-of-view angle (the angle of visibility), or null if the implementation does not
 support a field-of-view. | 
| Vec4 | getForwardVector()Returns the forward axis in cartesian coordinates. | 
| Frustum | getFrustum()Returns the viewing  Frustumin eye coordinates. | 
| Frustum | getFrustumInModelCoordinates()Returns the viewing  Frustumin model coordinates. | 
| Globe | getGlobe()Gets the globe associated with this view. | 
| Angle | getHeading()Returns the view's current heading. | 
| double | getHorizonDistance()Returns the horizon distance for this view's most recently used eye position. | 
| Matrix | getModelviewMatrix()Returns the modelview matrix. | 
| double | getNearClipDistance()Returns the near clipping plane distance, in eye coordinates. | 
| Angle | getPitch()Returns the view's current pitch. | 
| Matrix | getProjectionMatrix()Gets the projection matrix. | 
| String | getRestorableState()Returns an XML document string describing the object's state. | 
| Angle | getRoll()Returns this View's current roll. | 
| Vec4 | getUpVector()Returns the up axis in cartesian coordinates. | 
| ViewInputHandler | getViewInputHandler()Gets the  ViewInputHandlerbeing used to map input events toViewcontrols. | 
| Rectangle | getViewport()Returns the bounds (x, y, width, height) of the viewport. | 
| ViewPropertyLimits | getViewPropertyLimits()Get the  ViewPropertyLimitsfor this view. | 
| long | getViewStateID()Get an identifier for the current state of the modelview matrix. | 
| void | goTo(Position position,
    double distance)Animate to the specified position. | 
| boolean | hadCollisions() | 
| boolean | isAnimating()Determine if there are any animations active in the  View. | 
| boolean | isDetectCollisions() | 
| static void | loadGLViewState(DrawContext dc,
               Matrix modelview,
               Matrix projection)Sets the the opengl modelview and projection matrices to the given matrices. | 
| void | popReferenceCenter(DrawContext dc)Removes the model-view matrix on top of the matrix stack, and restores the original matrix. | 
| Vec4 | project(Vec4 modelPoint)Maps a  Pointin model (cartesian) coordinates to aPointin screen coordinates. | 
| Vec4 | project(Vec4 point,
       Matrix modelview,
       Matrix projection,
       Rectangle viewport)Transforms the specified object coordinates into window coordinates using the given modelview and projection
 matrices, and viewport. | 
| Matrix | pushReferenceCenter(DrawContext dc,
                   Vec4 referenceCenter)Defines and applies a new model-view matrix in which the world origin is located at  referenceCenter. | 
| void | restoreState(String stateInXml)Restores the object's state to what is described in the specified XML document string. | 
| void | setDetectCollisions(boolean detectCollisions) | 
| void | setEyePosition(Position eyePosition)Sets the geographic position of the eye. | 
| protected void | setFarClipDistance(double clipDistance) | 
| void | setFieldOfView(Angle fieldOfView)Sets the horizontal field-of-view angle (the angle of visibility) to the specified  fieldOfView. | 
| void | setGlobe(Globe globe)Set the globe associated with this view. | 
| void | setHeading(Angle heading)Sets the heading of the view. | 
| protected void | setNearClipDistance(double clipDistance) | 
| void | setOrientation(Position eyePosition,
              Position centerPosition)Sets the location of the eye, and the center of the screen in geographic coordinates. | 
| void | setPitch(Angle pitch)Sets the pitch of the view. | 
| Matrix | setReferenceCenter(DrawContext dc,
                  Vec4 referenceCenter)Sets the reference center matrix without pushing the stack. | 
| void | setRoll(Angle roll)Set the roll of the view. | 
| void | setViewInputHandler(ViewInputHandler viewInputHandler) | 
| protected void | setViewState(ViewUtil.ViewState modelCoords) | 
| void | stopAnimations()Stops any animations that are active in this  View | 
| void | stopMovement()Stops any movement associated with this  View. | 
| Vec4 | unProject(Vec4 windowPoint)Maps a  Pointin screen coordinates to aPointin model coordinates. | 
| Vec4 | unProject(Vec4 windowPoint,
         Matrix modelview,
         Matrix projection,
         Rectangle viewport)Maps the given window coordinates into model coordinates using the given matrices and viewport. | 
| protected void | updateModelViewStateID()Update the modelview state identifier. | 
onMessage, propertyChangeaddPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuespropertyChangeonMessageprotected static final int COLLISION_NUM_ITERATIONS
protected static final double COLLISION_THRESHOLD
protected DrawContext dc
protected static final double DEFAULT_DEPTH_RESOLUTION
gov.nasa.worldwind.avkey.DepthResolution property. The default if not specified in the
 configuration is 3.0 meters.protected boolean detectCollisions
protected Position eyePosition
protected double farClipDistance
protected Angle fieldOfView
protected Frustum frustum
protected Globe globe
protected boolean hadCollisions
protected Angle heading
protected double horizonDistance
protected Vec4 lastEyePoint
protected Position lastEyePosition
protected Vec4 lastForwardVector
protected Frustum lastFrustumInModelCoords
protected Vec4 lastUpVector
protected static final double MINIMUM_FAR_DISTANCE
protected static final double MINIMUM_NEAR_DISTANCE
protected Matrix modelview
protected Matrix modelviewInv
protected double nearClipDistance
protected Angle pitch
protected Matrix projection
protected Angle roll
protected ViewInputHandler viewInputHandler
protected ViewPropertyLimits viewLimits
protected Rectangle viewport
protected long viewStateID
public void addAnimator(Animator animator)
addAnimator in interface Viewanimator - the Animator to be addedpublic void apply(DrawContext dc)
ViewView's internal state to the graphics context in the specified
 dc. All subsequently rendered objects use this new state. Upon return, the OpenGL graphics context
 reflects the values of this view, as do any computed values of the view, such as the modelview matrix, projection
 matrix and viewing frustum.protected Position computeEyePositionFromModelview()
protected double computeFarClipDistance()
protected double computeFarDistance(Position eyePosition)
protected double computeHorizonDistance()
protected double computeHorizonDistance(Position eyePosition)
protected double computeNearClipDistance()
protected double computeNearDistance(Position eyePosition)
public double computePixelSizeAtDistance(double distance)
ViewcomputePixelSizeAtDistance in interface Viewdistance - the distance in meters from the eye point. This value must be positive but is otherwise
                 unbounded.public Position computePositionFromScreenPoint(double x, double y)
ViewGlobe. Only the ellipsoid itself is considered; terrain elevations are not incorporated.computePositionFromScreenPoint in interface Viewx - the horizontal coordinate originating from the left side of View's projection plane.y - the vertical coordinate originating from the top of View's projection plane.public Line computeRayFromScreenPoint(double x, double y)
ViewView's projection plane (or after projection into model space).computeRayFromScreenPoint in interface Viewx - the horizontal coordinate originating from the left side of View's projection plane.y - the vertical coordinate originating from the top of View's projection plane.View's eye point and passing through (x, y) transformed into model
         space.public void copyViewState(View view)
ViewView.copyViewState in interface Viewview - The View whose state is to be copied.protected void doApply(DrawContext dc)
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
public Vec4 getCenterPoint()
ViewgetCenterPoint in interface Viewpublic Position getCenterPosition()
public Vec4 getCurrentEyePoint()
ViewView.getEyePosition() and
 View.getEyePoint(), getCurrentEyePoint will return the View's immediate position.getCurrentEyePoint in interface Viewpublic Position getCurrentEyePosition()
ViewView.setEyePosition(gov.nasa.worldwind.geom.Position)
 but is the eye position corresponding to this view's current parameters.getCurrentEyePosition in interface Viewpublic Vec4 getCurrentForwardVector()
getForwardVector(), this method will return the
 View's immediate forward vector.public DrawContext getDC()
public Vec4 getEyePoint()
Viewapply.getEyePoint in interface Viewpublic Position getEyePosition()
ViewView.setEyePosition(gov.nasa.worldwind.geom.Position)
 but is the eye position corresponding to this view's most recently applied state.getEyePosition in interface Viewpublic double getFarClipDistance()
ViewView interface
 are not required to have a method for setting the near and far distance. Applications that need to control the
 near and far clipping distances can derive from BasicOrbitView or BasicFlyViewgetFarClipDistance in interface Viewpublic Angle getFieldOfView()
ViewgetFieldOfView in interface Viewpublic Vec4 getForwardVector()
Viewapply.getForwardVector in interface Viewpublic Frustum getFrustum()
ViewFrustum in eye coordinates. The Frustum is the portion of viewable
 space defined by three sets of parallel 'clipping' planes. This value is computed in the most recent call to
 apply.getFrustum in interface Viewpublic Frustum getFrustumInModelCoordinates()
ViewFrustum in model coordinates. Model coordinate frustums are useful for
 performing visibility tests against world geometry. This frustum has the same shape as the frustum returned in
 getFrustum, but it has been transformed into model space. This value is computed in the most recent
 call to apply.getFrustumInModelCoordinates in interface Viewpublic Globe getGlobe()
ViewView.apply(). View.getGlobe() returns null if called before the first invocation of
 View.apply().public Angle getHeading()
ViewgetHeading in interface Viewpublic double getHorizonDistance()
ViewgetHorizonDistance in interface Viewpublic Matrix getModelviewMatrix()
Viewapply.getModelviewMatrix in interface Viewpublic double getNearClipDistance()
ViewView interface
 are not required to have a method for setting the near and far distance. Applications that need to control the
 near and far clipping distances can derive from BasicOrbitView or BasicFlyViewgetNearClipDistance in interface Viewpublic Angle getPitch()
Viewpublic Matrix getProjectionMatrix()
ViewView. The method
 View.getFrustum() returns the geometry corresponding to this matrix. This value is computed in the most recent
 call to apply.getProjectionMatrix in interface Viewpublic String getRestorableState()
RestorablerestoreState and passing the XML document.getRestorableState in interface Restorablepublic Angle getRoll()
Viewpublic Vec4 getUpVector()
Viewapply.getUpVector in interface Viewpublic ViewInputHandler getViewInputHandler()
ViewViewInputHandler being used to map input events to View controls.getViewInputHandler in interface ViewViewInputHandler being used to map input events to View controls.public Rectangle getViewport()
Viewapply.getViewport in interface Viewpublic ViewPropertyLimits getViewPropertyLimits()
ViewViewPropertyLimits for this view.getViewPropertyLimits in interface ViewViewPropertyLimits for this view.public long getViewStateID()
getViewStateID in interface Viewpublic void goTo(Position position, double distance)
ViewView to look at
 the given position from the given elevation.public boolean hadCollisions()
public boolean isAnimating()
ViewView.isAnimating in interface Viewpublic boolean isDetectCollisions()
public static void loadGLViewState(DrawContext dc, Matrix modelview, Matrix projection)
dc - the drawing contextmodelview - the modelview matrixprojection - the projection matrixpublic void popReferenceCenter(DrawContext dc)
popReferenceCenter in interface Viewdc - the current World Wind drawing context on which the original matrix will be restored.IllegalArgumentException - if dc is null, or if the Globe or GL
                                  instances in dc are null.public Vec4 project(Vec4 modelPoint)
ViewPoint in model (cartesian) coordinates to a Point in screen coordinates. The
 returned x and y are relative to the lower left hand screen corner, while z is the screen depth-coordinate. If
 the model point cannot be successfully mapped, this will return null.public Vec4 project(Vec4 point, Matrix modelview, Matrix projection, Rectangle viewport)
point - The object coordinate to transformmodelview - The modelview matrixprojection - The projection matrixviewport - The viewportpublic Matrix pushReferenceCenter(DrawContext dc, Vec4 referenceCenter)
ViewreferenceCenter.
 Geometry rendered after a call to pushReferenceCenter should be transformed with respect to
 referenceCenter, rather than the canonical origin (0, 0, 0). Calls to
 pushReferenceCenter must be followed by popReferenceCenter after rendering is complete. Note that calls to View.getModelviewMatrix() will not return
 reference-center model-view matrix, but the original matrix.pushReferenceCenter in interface Viewdc - the current World Wind drawing context on which new model-view state will be applied.referenceCenter - the location to become the new world origin.referenceCenter, or null if this method failed.public void restoreState(String stateInXml)
RestorablerestoreState in interface RestorablestateInXml - an XML document string describing an object's state.public void setDetectCollisions(boolean detectCollisions)
public void setEyePosition(Position eyePosition)
ViewsetEyePosition in interface VieweyePosition - the eye position.protected void setFarClipDistance(double clipDistance)
public void setFieldOfView(Angle fieldOfView)
ViewfieldOfView. This
 may be ignored if the implementation that do not support a field-of-view.setFieldOfView in interface ViewfieldOfView - the horizontal field-of-view angle.public void setGlobe(Globe globe)
globe - New globe.public void setHeading(Angle heading)
ViewsetHeading in interface Viewheading - The direction to aim the view in degreesprotected void setNearClipDistance(double clipDistance)
public void setOrientation(Position eyePosition, Position centerPosition)
VieweyePosition, and the center of the screen is the specified centerPosition.
 Specifically, implementations must determine what the up direction will be given these parameters, and apply
 these parameters in a meaningful way.setOrientation in interface VieweyePosition - Position of they eye.centerPosition - Position of the screen center.public void setPitch(Angle pitch)
Viewpublic Matrix setReferenceCenter(DrawContext dc, Vec4 referenceCenter)
ViewsetReferenceCenter in interface Viewdc - the drawing context.referenceCenter - the new reference centerreferenceCenter, or null if this method failed.View.pushReferenceCenter(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.geom.Vec4)public void setRoll(Angle roll)
Viewpublic void setViewInputHandler(ViewInputHandler viewInputHandler)
protected void setViewState(ViewUtil.ViewState modelCoords)
public void stopAnimations()
ViewViewstopAnimations in interface Viewpublic void stopMovement()
ViewView.stopMovement in interface Viewpublic Vec4 unProject(Vec4 windowPoint)
ViewPoint in screen coordinates to a Point in model coordinates. The input x and y
 are  relative to the lower left hand screen corner, while z is the screen depth-coordinate.  If the screen point
 cannot be successfully mapped, this will return null.public Vec4 unProject(Vec4 windowPoint, Matrix modelview, Matrix projection, Rectangle viewport)
windowPoint - the window pointmodelview - the modelview matrixprojection - the projection matrixviewport - the window viewportprotected void updateModelViewStateID()