public class BasicOrbitView extends BasicView implements OrbitView
Modifier and Type | Field and Description |
---|---|
protected Position |
center |
protected OrbitViewCollisionSupport |
collisionSupport |
protected boolean |
viewOutOfFocus |
protected double |
zoom |
COLLISION_NUM_ITERATIONS, COLLISION_THRESHOLD, dc, DEFAULT_DEPTH_RESOLUTION, detectCollisions, eyePosition, farClipDistance, fieldOfView, frustum, globe, hadCollisions, heading, horizonDistance, lastEyePoint, lastEyePosition, lastForwardVector, lastFrustumInModelCoords, lastUpVector, MINIMUM_FAR_DISTANCE, MINIMUM_NEAR_DISTANCE, modelview, modelviewInv, nearClipDistance, pitch, projection, roll, viewInputHandler, viewLimits, viewport, viewStateID
CENTER_STOPPED
VIEW_STOPPED
Constructor and Description |
---|
BasicOrbitView() |
Modifier and Type | Method and Description |
---|---|
void |
addCenterAnimator(Position begin,
Position end,
boolean smoothed) |
void |
addCenterAnimator(Position begin,
Position end,
long lengthMillis,
boolean smoothed) |
void |
addEyePositionAnimator(long timeToIterate,
Position beginPosition,
Position endPosition) |
void |
addFlyToZoomAnimator(Angle heading,
Angle pitch,
double zoomAmount) |
void |
addHeadingAnimator(Angle begin,
Angle end) |
void |
addHeadingPitchAnimator(Angle beginHeading,
Angle endHeading,
Angle beginPitch,
Angle endPitch) |
void |
addPanToAnimator(Position centerPos,
Angle heading,
Angle pitch,
double zoom) |
void |
addPanToAnimator(Position centerPos,
Angle heading,
Angle pitch,
double zoom,
boolean endCenterOnSurface) |
void |
addPanToAnimator(Position centerPos,
Angle heading,
Angle pitch,
double zoom,
long timeToMove,
boolean endCenterOnSurface) |
void |
addPanToAnimator(Position beginCenterPos,
Position endCenterPos,
Angle beginHeading,
Angle endHeading,
Angle beginPitch,
Angle endPitch,
double beginZoom,
double endZoom,
boolean endCenterOnSurface) |
void |
addPanToAnimator(Position beginCenterPos,
Position endCenterPos,
Angle beginHeading,
Angle endHeading,
Angle beginPitch,
Angle endPitch,
double beginZoom,
double endZoom,
long timeToMove,
boolean endCenterOnSurface) |
void |
addPitchAnimator(Angle begin,
Angle end) |
void |
addZoomAnimator(double zoomStart,
double zoomEnd) |
protected void |
afterDoApply() |
boolean |
canFocusOnTerrainCenter() |
boolean |
canFocusOnViewportCenter()
Determines if the BasicOrbitView can be focused on the viewport center
focusOnViewportCenter() . |
void |
computeAndSetViewCenter()
Computes and sets the center of rotation for heading and pitch changes.
|
void |
computeAndSetViewCenterIfNeeded()
Computes and sets the center of rotation for heading and pitch changes, if it is needed.
|
protected double |
computeFarDistance(Position eyePosition) |
protected double |
computeHorizonDistance(Position eyePosition) |
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) |
protected void |
flagHadCollisions() |
void |
focusOnTerrainCenter() |
void |
focusOnViewportCenter()
Sets the point of rotation for heading and pitch changes to the surface position at the viewport center.
|
Vec4 |
getCenterPoint()
Gets the center point of the view.
|
Position |
getCenterPosition()
Get the center position of the OrbitView.
|
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.
|
OrbitViewLimits |
getOrbitViewLimits()
Returns the
OrbitViewLimits that apply to this OrbitView . |
double |
getZoom()
Get the zoom value for the OrbitView.
|
protected void |
legacyRestoreState(RestorableSupport rs,
RestorableSupport.StateObject context)
Restores state values from previous versions of the BasicObitView state XML.
|
protected void |
loadConfigurationValues() |
static Position |
normalizedCenterPosition(Position unnormalizedPosition) |
static Angle |
normalizedHeading(Angle unnormalizedHeading) |
static Angle |
normalizedPitch(Angle unnormalizedPitch) |
protected void |
resolveCollisionsWithCenterPosition() |
protected void |
resolveCollisionsWithPitch() |
void |
setCenterPosition(Position center)
Sets the center position of the OrbitView.
|
void |
setEyePosition(Position eyePosition)
Sets the geographic position of the eye.
|
void |
setHeading(Angle heading)
Sets the heading of the view.
|
protected void |
setModelCoordinates(OrbitViewInputSupport.OrbitViewState modelCoords) |
void |
setOrbitViewLimits(OrbitViewLimits viewLimits)
Sets the
OrbitViewLimits that will apply to this OrbitView . |
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.
|
void |
setViewOutOfFocus(boolean b)
Alerts the BasicOrbitView that the view requires the point of rotation for heading and pitch changes to be
recalculated.
|
void |
setZoom(double zoom)
Set the zoom value for the OrbitVeiw.
|
void |
stopMovementOnCenter()
Stop any changes to the center position.
|
protected boolean |
validateModelCoordinates(OrbitViewInputSupport.OrbitViewState modelCoords) |
addAnimator, apply, computeEyePositionFromModelview, computeFarClipDistance, computeHorizonDistance, computeNearClipDistance, computeNearDistance, computePixelSizeAtDistance, computePositionFromScreenPoint, computeRayFromScreenPoint, getCurrentForwardVector, getDC, getEyePoint, getEyePosition, getFarClipDistance, getFieldOfView, getForwardVector, getFrustum, getFrustumInModelCoordinates, getGlobe, getHeading, getHorizonDistance, getModelviewMatrix, getNearClipDistance, getPitch, getProjectionMatrix, getRestorableState, getRoll, getUpVector, getViewInputHandler, getViewport, getViewPropertyLimits, getViewStateID, goTo, hadCollisions, isAnimating, isDetectCollisions, loadGLViewState, popReferenceCenter, project, project, pushReferenceCenter, restoreState, setDetectCollisions, setFarClipDistance, setFieldOfView, setGlobe, setNearClipDistance, setReferenceCenter, setRoll, setViewInputHandler, setViewState, stopAnimations, stopMovement, unProject, unProject, updateModelViewStateID
onMessage, propertyChange
addPropertyChangeListener, 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, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hadCollisions, isDetectCollisions, setDetectCollisions
addAnimator, apply, computePixelSizeAtDistance, computePositionFromScreenPoint, computeRayFromScreenPoint, getEyePoint, getEyePosition, getFarClipDistance, getFieldOfView, getForwardVector, getFrustum, getFrustumInModelCoordinates, getGlobe, getHeading, getHorizonDistance, getModelviewMatrix, getNearClipDistance, getPitch, getProjectionMatrix, getRoll, getUpVector, getViewInputHandler, getViewport, getViewPropertyLimits, getViewStateID, goTo, isAnimating, popReferenceCenter, project, pushReferenceCenter, setFieldOfView, setReferenceCenter, setRoll, stopAnimations, stopMovement, unProject
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
getRestorableState, restoreState
protected Position center
protected final OrbitViewCollisionSupport collisionSupport
protected boolean viewOutOfFocus
protected double zoom
public void addCenterAnimator(Position begin, Position end, long lengthMillis, boolean smoothed)
public void addEyePositionAnimator(long timeToIterate, Position beginPosition, Position endPosition)
public void addFlyToZoomAnimator(Angle heading, Angle pitch, double zoomAmount)
public void addHeadingPitchAnimator(Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch)
public void addPanToAnimator(Position centerPos, Angle heading, Angle pitch, double zoom)
public void addPanToAnimator(Position centerPos, Angle heading, Angle pitch, double zoom, boolean endCenterOnSurface)
public void addPanToAnimator(Position centerPos, Angle heading, Angle pitch, double zoom, long timeToMove, boolean endCenterOnSurface)
public void addPanToAnimator(Position beginCenterPos, Position endCenterPos, Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch, double beginZoom, double endZoom, boolean endCenterOnSurface)
public void addPanToAnimator(Position beginCenterPos, Position endCenterPos, Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch, double beginZoom, double endZoom, long timeToMove, boolean endCenterOnSurface)
public void addZoomAnimator(double zoomStart, double zoomEnd)
protected void afterDoApply()
public boolean canFocusOnTerrainCenter()
public boolean canFocusOnViewportCenter()
focusOnViewportCenter()
. Focusing
on the viewport center requires a non-null Globe
, a non-null DrawContext
, and the viewport center is on the terrain.canFocusOnViewportCenter
in interface OrbitView
public void computeAndSetViewCenter()
public void computeAndSetViewCenterIfNeeded()
protected double computeFarDistance(Position eyePosition)
computeFarDistance
in class BasicView
protected double computeHorizonDistance(Position eyePosition)
computeHorizonDistance
in class BasicView
public void copyViewState(View view)
View
View
.copyViewState
in interface View
copyViewState
in class BasicView
view
- The View
whose state is to be copied.protected void doApply(DrawContext dc)
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
doGetRestorableState
in class BasicView
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
doRestoreState
in class BasicView
protected void flagHadCollisions()
public void focusOnTerrainCenter()
public void focusOnViewportCenter()
focusOnViewportCenter
in interface OrbitView
public Vec4 getCenterPoint()
View
getCenterPoint
in interface View
getCenterPoint
in class BasicView
public Position getCenterPosition()
OrbitView
getCenterPosition
in interface OrbitView
getCenterPosition
in class BasicView
public Vec4 getCurrentEyePoint()
View
View.getEyePosition()
and
View.getEyePoint()
, getCurrentEyePoint will return the View's immediate position.getCurrentEyePoint
in interface View
getCurrentEyePoint
in class BasicView
public Position getCurrentEyePosition()
View
View.setEyePosition(gov.nasa.worldwind.geom.Position)
but is the eye position corresponding to this view's current parameters.getCurrentEyePosition
in interface View
getCurrentEyePosition
in class BasicView
public OrbitViewLimits getOrbitViewLimits()
OrbitViewLimits
that apply to this OrbitView
. Incoming parameters to the
methods setCenterPosition, setHeading, setPitch, or setZoom are be limited by the parameters defined in this
OrbitViewLimits
.getOrbitViewLimits
in interface OrbitView
OrbitViewLimits
that apply to this OrbitView
public double getZoom()
OrbitView
protected void legacyRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
doRestoreState(gov.nasa.worldwind.util.RestorableSupport,
gov.nasa.worldwind.util.RestorableSupport.StateObject)
.rs
- RestorableSupport object which contains the state value properties.context
- active context in the RestorableSupport to read state from.protected void loadConfigurationValues()
public static Position normalizedCenterPosition(Position unnormalizedPosition)
protected void resolveCollisionsWithCenterPosition()
protected void resolveCollisionsWithPitch()
public void setCenterPosition(Position center)
OrbitView
setCenterPosition
in interface OrbitView
public void setEyePosition(Position eyePosition)
View
setEyePosition
in interface View
setEyePosition
in class BasicView
eyePosition
- the eye position.public void setHeading(Angle heading)
View
setHeading
in interface View
setHeading
in class BasicView
heading
- The direction to aim the view in degreesprotected void setModelCoordinates(OrbitViewInputSupport.OrbitViewState modelCoords)
public void setOrbitViewLimits(OrbitViewLimits viewLimits)
OrbitViewLimits
that will apply to this OrbitView
. Incoming parameters to the
methods setCenterPosition, setHeading, setPitch, or setZoom will be limited by the parameters defined in
viewLimits
.setOrbitViewLimits
in interface OrbitView
viewLimits
- the OrbitViewLimits
that will apply to this OrbitView
.java.lang.IllegalArgumentException
- if viewLimits
is null.public void setOrientation(Position eyePosition, Position centerPosition)
View
eyePosition
, 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 View
setOrientation
in class BasicView
eyePosition
- Position of they eye.centerPosition
- Position of the screen center.public void setPitch(Angle pitch)
View
public void setViewOutOfFocus(boolean b)
b
- true if the point of rotation needs recalculation, false if it does not.public void setZoom(double zoom)
OrbitView
public void stopMovementOnCenter()
OrbitView
stopMovementOnCenter
in interface OrbitView
protected boolean validateModelCoordinates(OrbitViewInputSupport.OrbitViewState modelCoords)