The New World Wind View/Animation Interface Architecture

This document describes what is required in order to move application code from the old View/StateIterator Architecture in World Wind, to the new View/Animator interface architecture in World Wind. The View and Animation system was rearchitected to provide a framework for supporting varying View/Navigation paradigms. Prior to this rearchitecture, OrbitView was the only view/navigation paradigm provided with World Wind. Now there is a fly view paradigm(gov.nasa.worldwind.view.firstperson.BasicFlyView), and the system has been architected to support derivations of existing views, and instances of completely new views.

The first section describes the change to the View interface. The second section is a list of old methods for creating view state iteratations, and the matching methods in the new View/Animator interface. The final section is a case study example from gov.nasa.worldwind.applications.sar.

Changes to the View interface

The View interface has changed to :



Old/New Method Mappings for View Animation

There is a new method in the View interface :

This method can be used without knowing the underlying View implementation if that application simply wants the view to be looking at a particular location.


From the FlyToOrbitViewStateIterator class:

FlyToOrbitViewStateIterator Method

Corresponding BasicOrbitView method

createPanToIterator(OrbitView orbitView, Globe globe,Position center,

Angle, heading, Angle pitch, double zoom)

addPanToAnimator(Position center,Angle heading,

Angle pitch, double zoom)

createPanToIterator(OrbitView orbitView, Globe globe, Position center,

Angle heading, Angle pitch, double zoom, boolean endCenterOnSurface)

addPanToAnimator(Position center, Angle heading, Angle pitch,

double zoom, boolean endCenterOnSurface)

createPanToIterator(Globe globe, Position beginCenter,

Position endCenter, Angle beginHeading, Angle endHeading,

Angle beginPitch, Angle endPitch, double beginZoom,

double endZoom)

addPanToAnimator(Position beginCenter, Position endCenter,

Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch,

double beginZoom, double endZoom)

CreatePanToIterator(Globe globe, Position beginCenter,

Position endCenter, Angle beginHeading, Angle endHeading,

Angle beginPitch, Angle endPitch, double beginZoom,

double endZoom, boolean endCenterOnSurface)

AddPanToAnimator(Position beginCenter, Position endCenter,

Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch,

double beginZoom, double endZoom, boolean endCenterOnSurface)


From the ScheduledViewStateIterator class:

ScheduledViewStateIterator Method

Corresponding BasicOrbitView method

createHeadingPitchIterator(OrbitView view,

Angle beginHeding, Angle endHeading, Angle beginPitch, Angle endPitch);

addHeadingPitchAnimator(Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch)

createHeadingIterator(OrbitView view, Angle beginHeding, Angle endHeading)

addHeadingAnimator(Angle beginHeading, Angle endHeading)

createHeadingIterator(OrbitView view, Angle beginHeding,

Angle endHeading)

addPitchAnimator(Angle beginPitch, Angle endPitch)


If your code uses an EyePositionIterator, you can simply replace its construction and application to the View, with the

BasicOrbitView method :

To stop and motion that is associated with animations in the View use:

To determine if a View is currently running any animations use:



An example of what is required of an application to adapt to the new View/Animator Interface architecture

This section shows how the Search and Rescue(SAR) application gov.nasa.worldwind.applications.sar was modified to use the new View/Animator interface architecture. In the SAR application, there are 3 uses of :

FlyToOrbitViewStateIterator.createPanToIterator

view.applyStateIterator

These are easily replaced with calls to :

OrbitViewInputHandler.addPanToAnimator


In the AnalysisPanel class there are 2 usages of:

FlyToOrbitViewStateIterator.createPanToIterator

view.applyStateIterator


In the TrackController class there is one usage of :

FlyToOrbitViewStateIterator.createPanToIterator

view.applyStateIterator