Package gov.nasa.worldwind.view.orbit
Class OrbitViewInputHandler.CollisionAwarePitchAccessor
- java.lang.Object
-
- gov.nasa.worldwind.view.orbit.OrbitViewInputHandler.CollisionAwarePitchAccessor
-
- All Implemented Interfaces:
PropertyAccessor.AngleAccessor
- Enclosing class:
- OrbitViewInputHandler
protected static class OrbitViewInputHandler.CollisionAwarePitchAccessor extends java.lang.Object implements PropertyAccessor.AngleAccessor
CollisionAwarePitchAccessor implements anPropertyAccessor.AngleAccessor
interface onto the pitch property of anOrbitView
. In addition to accessing the pitch property, this implementation is aware of view-surface collisions caused by setting the pitch property. If a call tosetAngle(gov.nasa.worldwind.geom.Angle)
causes the view to collide with the surface, then the call returns false indicating to the caller that the set operation was not entirely successful.
-
-
Constructor Summary
Constructors Constructor Description CollisionAwarePitchAccessor(OrbitView orbitView)
Creates a new CollisionAwarePitchAccessor with the specified OrbitView, but otherwise does nothing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Angle
getAngle()
Returns the pitch property value from this accessor's view.boolean
setAngle(Angle value)
Sets the pitch property of this accessor's view to the specified value.
-
-
-
Field Detail
-
orbitView
protected OrbitView orbitView
-
-
Constructor Detail
-
CollisionAwarePitchAccessor
public CollisionAwarePitchAccessor(OrbitView orbitView)
Creates a new CollisionAwarePitchAccessor with the specified OrbitView, but otherwise does nothing.- Parameters:
orbitView
- the OrbitView who's pitch will be accessed.- Throws:
java.lang.IllegalArgumentException
- if the orbitView is null.
-
-
Method Detail
-
getAngle
public Angle getAngle()
Returns the pitch property value from this accessor's view.- Specified by:
getAngle
in interfacePropertyAccessor.AngleAccessor
- Returns:
- the pitch from this accessor's view.
-
setAngle
public boolean setAngle(Angle value)
Sets the pitch property of this accessor's view to the specified value. If the value is null, setting the view's pitch causes a surface collision, or setting the view's pitch causes an exception, this returns false. Otherwise this returns true.- Specified by:
setAngle
in interfacePropertyAccessor.AngleAccessor
- Parameters:
value
- the value to set as this view's pitch property.- Returns:
- true if the pitch property was successfully set, and false otherwise.
-
-