Package gov.nasa.worldwind.view
Class BasicViewPropertyLimits
- java.lang.Object
-
- gov.nasa.worldwind.view.BasicViewPropertyLimits
-
- All Implemented Interfaces:
ViewPropertyLimits
- Direct Known Subclasses:
BasicOrbitViewLimits
,FlyViewLimits
public class BasicViewPropertyLimits extends java.lang.Object implements ViewPropertyLimits
BasicViewPropertyLimits provides an implementation of ViewPropertyLimits.
-
-
Field Summary
Fields Modifier and Type Field Description protected Sector
eyeLocationLimits
protected double
maxEyeElevation
protected Angle
maxHeading
protected Angle
maxPitch
protected Angle
maxRoll
protected double
minEyeElevation
protected Angle
minHeading
protected Angle
minPitch
protected Angle
minRoll
-
Constructor Summary
Constructors Constructor Description BasicViewPropertyLimits()
Creates a new BasicViewPropertyLimits with default limits.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getEyeElevationLimits()
Returns the minimum and maximum values for a view's eye elevation.Sector
getEyeLocationLimits()
Returns the Sector which limits a view's eye latitude and longitude.Angle[]
getHeadingLimits()
Returns the minimum and maximum angles for a view's heading property.Angle[]
getPitchLimits()
Returns the minimum and maximum angles for a view's pitch property.void
getRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
Angle[]
getRollLimits()
Returns the minimum and maximum angles for a view's roll property.protected boolean
is2DGlobe(Globe globe)
protected boolean
isNonContinous2DGlobe(Globe globe)
Position
limitEyePosition(View view, Position position)
Returns a position clamped to the eye location limits and the eye elevation limits specified by this limit object.Angle
limitHeading(View view, Angle angle)
Returns an angle clamped to the heading limits specified by this limit object.Angle
limitPitch(View view, Angle angle)
Returns an angle clamped to the pitch limits specified by this limit object.Angle
limitRoll(View view, Angle angle)
Returns an angle clamped to the roll limits specified by this limit object.void
reset()
Resets all property limits to their default values.void
restoreState(RestorableSupport rs, RestorableSupport.StateObject context)
void
setEyeElevationLimits(double minValue, double maxValue)
Sets the minimum and maximum values for a view's eye elevation.void
setEyeLocationLimits(Sector sector)
Sets the Sector which will limit a view's eye latitude and longitude.void
setHeadingLimits(Angle minAngle, Angle maxAngle)
Sets the minimum and maximum angles which will limit a view's heading property.void
setPitchLimits(Angle minAngle, Angle maxAngle)
Sets the minimum and maximum angles which will limit a view's pitch property.void
setRollLimits(Angle minAngle, Angle maxAngle)
Sets the minimum and maximum angles which will limit a view's roll property.
-
-
-
Field Detail
-
eyeLocationLimits
protected Sector eyeLocationLimits
-
minHeading
protected Angle minHeading
-
maxHeading
protected Angle maxHeading
-
minPitch
protected Angle minPitch
-
maxPitch
protected Angle maxPitch
-
minRoll
protected Angle minRoll
-
maxRoll
protected Angle maxRoll
-
minEyeElevation
protected double minEyeElevation
-
maxEyeElevation
protected double maxEyeElevation
-
-
Method Detail
-
getEyeLocationLimits
public Sector getEyeLocationLimits()
Returns the Sector which limits a view's eye latitude and longitude.- Specified by:
getEyeLocationLimits
in interfaceViewPropertyLimits
- Returns:
- Sector which limits the eye latitude and longitude.
-
setEyeLocationLimits
public void setEyeLocationLimits(Sector sector)
Sets the Sector which will limit a view's eye latitude and longitude.- Specified by:
setEyeLocationLimits
in interfaceViewPropertyLimits
- Parameters:
sector
- Sector which will limit the eye latitude and longitude.
-
getEyeElevationLimits
public double[] getEyeElevationLimits()
Returns the minimum and maximum values for a view's eye elevation.- Specified by:
getEyeElevationLimits
in interfaceViewPropertyLimits
- Returns:
- Minimum and maximum allowable values for the elevation.
-
setEyeElevationLimits
public void setEyeElevationLimits(double minValue, double maxValue)
Sets the minimum and maximum values for a view's eye elevation.- Specified by:
setEyeElevationLimits
in interfaceViewPropertyLimits
- Parameters:
minValue
- the minimum elevation.maxValue
- the maximum elevation.
-
getHeadingLimits
public Angle[] getHeadingLimits()
Returns the minimum and maximum angles for a view's heading property.- Specified by:
getHeadingLimits
in interfaceViewPropertyLimits
- Returns:
- Minimum and maximum allowable angles for heading.
-
setHeadingLimits
public void setHeadingLimits(Angle minAngle, Angle maxAngle)
Sets the minimum and maximum angles which will limit a view's heading property.- Specified by:
setHeadingLimits
in interfaceViewPropertyLimits
- Parameters:
minAngle
- the minimum allowable angle for heading.maxAngle
- the maximum allowable angle for heading.
-
getPitchLimits
public Angle[] getPitchLimits()
Returns the minimum and maximum angles for a view's pitch property.- Specified by:
getPitchLimits
in interfaceViewPropertyLimits
- Returns:
- Minimum and maximum allowable angles for pitch.
-
setPitchLimits
public void setPitchLimits(Angle minAngle, Angle maxAngle)
Sets the minimum and maximum angles which will limit a view's pitch property.- Specified by:
setPitchLimits
in interfaceViewPropertyLimits
- Parameters:
minAngle
- the minimum allowable angle for pitch.maxAngle
- the maximum allowable angle for pitch.
-
getRollLimits
public Angle[] getRollLimits()
Returns the minimum and maximum angles for a view's roll property.- Specified by:
getRollLimits
in interfaceViewPropertyLimits
- Returns:
- Minimum and maximum allowable angles for roll.
-
setRollLimits
public void setRollLimits(Angle minAngle, Angle maxAngle)
Sets the minimum and maximum angles which will limit a view's roll property.- Specified by:
setRollLimits
in interfaceViewPropertyLimits
- Parameters:
minAngle
- the minimum allowable angle for roll.maxAngle
- the maximum allowable angle for roll.
-
reset
public void reset()
Resets all property limits to their default values.- Specified by:
reset
in interfaceViewPropertyLimits
-
limitEyePosition
public Position limitEyePosition(View view, Position position)
Returns a position clamped to the eye location limits and the eye elevation limits specified by this limit object. This method does not modify the specified view's properties, but may use the view as a context for determining how to apply the limits.- Specified by:
limitEyePosition
in interfaceViewPropertyLimits
- Parameters:
view
- the view associated with the center position and the property limits.position
- position to clamp to the allowed range.- Returns:
- The clamped position.
-
limitHeading
public Angle limitHeading(View view, Angle angle)
Returns an angle clamped to the heading limits specified by this limit object. This method does not modify the specified view's properties, but may use the view as a context for determining how to apply the limits.- Specified by:
limitHeading
in interfaceViewPropertyLimits
- Parameters:
view
- the view associated with the heading angle and the property limits.angle
- angle to clamp to the allowed range.- Returns:
- The clamped angle.
-
limitPitch
public Angle limitPitch(View view, Angle angle)
Returns an angle clamped to the pitch limits specified by this limit object. This method does not modify the specified view's properties, but may use the view as a context for determining how to apply the limits.- Specified by:
limitPitch
in interfaceViewPropertyLimits
- Parameters:
view
- the view associated with the pitch angle and the property limits.angle
- angle to clamp to the allowed range.- Returns:
- The clamped angle.
-
limitRoll
public Angle limitRoll(View view, Angle angle)
Returns an angle clamped to the roll limits specified by this limit object. This method does not modify the specified view's properties, but may use the view as a context for determining how to apply the limits.- Specified by:
limitRoll
in interfaceViewPropertyLimits
- Parameters:
view
- the view associated with the roll angle and the property limits.angle
- angle to clamp to the allowed range.- Returns:
- The clamped angle.
-
is2DGlobe
protected boolean is2DGlobe(Globe globe)
-
isNonContinous2DGlobe
protected boolean isNonContinous2DGlobe(Globe globe)
-
getRestorableState
public void getRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
- Specified by:
getRestorableState
in interfaceViewPropertyLimits
-
restoreState
public void restoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Specified by:
restoreState
in interfaceViewPropertyLimits
-
-