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 SectoreyeLocationLimitsprotected doublemaxEyeElevationprotected AnglemaxHeadingprotected AnglemaxPitchprotected AnglemaxRollprotected doubleminEyeElevationprotected AngleminHeadingprotected AngleminPitchprotected AngleminRoll
-
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.SectorgetEyeLocationLimits()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.voidgetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)Angle[]getRollLimits()Returns the minimum and maximum angles for a view's roll property.protected booleanis2DGlobe(Globe globe)protected booleanisNonContinous2DGlobe(Globe globe)PositionlimitEyePosition(View view, Position position)Returns a position clamped to the eye location limits and the eye elevation limits specified by this limit object.AnglelimitHeading(View view, Angle angle)Returns an angle clamped to the heading limits specified by this limit object.AnglelimitPitch(View view, Angle angle)Returns an angle clamped to the pitch limits specified by this limit object.AnglelimitRoll(View view, Angle angle)Returns an angle clamped to the roll limits specified by this limit object.voidreset()Resets all property limits to their default values.voidrestoreState(RestorableSupport rs, RestorableSupport.StateObject context)voidsetEyeElevationLimits(double minValue, double maxValue)Sets the minimum and maximum values for a view's eye elevation.voidsetEyeLocationLimits(Sector sector)Sets the Sector which will limit a view's eye latitude and longitude.voidsetHeadingLimits(Angle minAngle, Angle maxAngle)Sets the minimum and maximum angles which will limit a view's heading property.voidsetPitchLimits(Angle minAngle, Angle maxAngle)Sets the minimum and maximum angles which will limit a view's pitch property.voidsetRollLimits(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:
getEyeLocationLimitsin 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:
setEyeLocationLimitsin 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:
getEyeElevationLimitsin 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:
setEyeElevationLimitsin 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:
getHeadingLimitsin 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:
setHeadingLimitsin 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:
getPitchLimitsin 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:
setPitchLimitsin 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:
getRollLimitsin 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:
setRollLimitsin 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:
resetin 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:
limitEyePositionin 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:
limitHeadingin 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:
limitPitchin 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:
limitRollin 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:
getRestorableStatein interfaceViewPropertyLimits
-
restoreState
public void restoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Specified by:
restoreStatein interfaceViewPropertyLimits
-
-