NASA World Wind

gov.nasa.worldwind.view.orbit
Class OrbitViewInputHandler.CollisionAwarePitchAccessor

java.lang.Object
  extended by gov.nasa.worldwind.view.orbit.OrbitViewInputHandler.CollisionAwarePitchAccessor
All Implemented Interfaces:
PropertyAccessor.AngleAccessor
Enclosing class:
OrbitViewInputHandler

protected static class OrbitViewInputHandler.CollisionAwarePitchAccessor
extends Object
implements PropertyAccessor.AngleAccessor

CollisionAwarePitchAccessor implements an PropertyAccessor.AngleAccessor interface onto the pitch property of an OrbitView. In addition to accessing the pitch property, this implementation is aware of view-surface collisions caused by setting the pitch property. If a call to setAngle(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.


Field Summary
protected  OrbitView orbitView
           
 
Constructor Summary
OrbitViewInputHandler.CollisionAwarePitchAccessor(OrbitView orbitView)
          Creates a new CollisionAwarePitchAccessor with the specified OrbitView, but otherwise does nothing.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orbitView

protected OrbitView orbitView
Constructor Detail

OrbitViewInputHandler.CollisionAwarePitchAccessor

public OrbitViewInputHandler.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:
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 interface PropertyAccessor.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 interface PropertyAccessor.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.

NASA World Wind