}
//end Amadeus
OrbitView view = (OrbitView) this.wwd.getView();
view.stopAnimations();
view.stopMovement();
if (controlType.equals(AVKey.VIEW_PAN))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
// Go some distance in the control mouse direction
Angle heading = computePanHeading(views[i], control);
Angle distance = computePanAmount(this.wwd.getModel().getGlobe(), views[i], control, panStep);
LatLon newViewCenter = LatLon.greatCircleEndPosition(views[i].getCenterPosition(),
heading, distance);
// Turn around if passing by a pole - TODO: better handling of the pole crossing situation
if (this.isPathCrossingAPole(newViewCenter, views[i].getCenterPosition()))
views[i].setHeading(Angle.POS180.subtract(views[i].getHeading()));
// Set new center pos
views[i].setCenterPosition(new Position(newViewCenter, views[i].getCenterPosition().getElevation()));
}
//end Amadeus
resetOrbitView(view);
// Go some distance in the control mouse direction
Angle heading = computePanHeading(view, control);
Angle distance = computePanAmount(this.wwd.getModel().getGlobe(), view, control, panStep);
LatLon newViewCenter = LatLon.greatCircleEndPosition(view.getCenterPosition(),
heading, distance);
// Turn around if passing by a pole - TODO: better handling of the pole crossing situation
if (this.isPathCrossingAPole(newViewCenter, view.getCenterPosition()))
view.setHeading(Angle.POS180.subtract(view.getHeading()));
// Set new center pos
view.setCenterPosition(new Position(newViewCenter, view.getCenterPosition().getElevation()));
}
else if (controlType.equals(AVKey.VIEW_LOOK))
{
setupFirstPersonView(view);
Angle heading = computeLookHeading(view, control, headingStep);
Angle pitch = computeLookPitch(view, control, pitchStep);
// Check whether the view will still point at terrain
Vec4 surfacePoint = computeSurfacePoint(view, heading, pitch);
if (surfacePoint != null)
{
// Change view state
final Position eyePos = view.getEyePosition();// Save current eye position
view.setHeading(heading);
view.setPitch(pitch);
view.setZoom(0);
view.setCenterPosition(eyePos); // Set center at the eye position
}
}
else if (controlType.equals(AVKey.VIEW_ZOOM_IN))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
views[i].setZoom(computeNewZoom(views[i], -zoomStep));
}
//end Amadeus
resetOrbitView(view);
view.setZoom(computeNewZoom(view, -zoomStep));
}
else if (controlType.equals(AVKey.VIEW_ZOOM_OUT))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
views[i].setZoom(computeNewZoom(views[i], zoomStep));
}
//end Amadeus
resetOrbitView(view);
view.setZoom(computeNewZoom(view, zoomStep));
}
else if (controlType.equals(AVKey.VIEW_HEADING_LEFT))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
views[i].setHeading(views[i].getHeading().addDegrees(headingStep));
}
//end Amadeus
resetOrbitView(view);
view.setHeading(view.getHeading().addDegrees(headingStep));
}
else if (controlType.equals(AVKey.VIEW_HEADING_RIGHT))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
views[i].setHeading(views[i].getHeading().addDegrees(-headingStep));
}
//end Amadeus
resetOrbitView(view);
view.setHeading(view.getHeading().addDegrees(-headingStep));
}
else if (controlType.equals(AVKey.VIEW_PITCH_UP))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
if (view.getPitch().degrees >= pitchStep)
views[i].setPitch(views[i].getPitch().addDegrees(-pitchStep));
}
//end Amadeus
resetOrbitView(view);
if (view.getPitch().degrees >= pitchStep)
view.setPitch(view.getPitch().addDegrees(-pitchStep));
}
else if (controlType.equals(AVKey.VIEW_PITCH_DOWN))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
resetOrbitView(views[i]);
if (views[i].getPitch().degrees <= 90 - pitchStep)
views[i].setPitch(views[i].getPitch().addDegrees(pitchStep));
}
//end Amadeus
resetOrbitView(view);
if (view.getPitch().degrees <= 90 - pitchStep)
view.setPitch(view.getPitch().addDegrees(pitchStep));
}
else if (controlType.equals(AVKey.VIEW_FOV_NARROW))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
if (views[i].getFieldOfView().degrees / fovStep >= 4)
views[i].setFieldOfView(views[i].getFieldOfView().divide(fovStep));
}
//end Amadeus
if (view.getFieldOfView().degrees / fovStep >= 4)
view.setFieldOfView(view.getFieldOfView().divide(fovStep));
}
else if (controlType.equals(AVKey.VIEW_FOV_WIDE))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
if (views[i].getFieldOfView().degrees * fovStep < 120)
views[i].setFieldOfView(views[i].getFieldOfView().multiply(fovStep));
}
//end Amadeus
if (view.getFieldOfView().degrees * fovStep < 120)
view.setFieldOfView(view.getFieldOfView().multiply(fovStep));
}
else if (controlType.equals(AVKey.VERTICAL_EXAGGERATION_UP))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
SceneController sc = this.wwdSyncro.get(i).getSceneController();
sc.setVerticalExaggeration(sc.getVerticalExaggeration() + this.veStep);
}
//end Amadeus
SceneController sc = this.wwd.getSceneController();
sc.setVerticalExaggeration(sc.getVerticalExaggeration() + this.veStep);
}
else if (controlType.equals(AVKey.VERTICAL_EXAGGERATION_DOWN))
{
//beg added Amadeus for synchro
for (int i = 0; i < updatedSize; i++)
{
SceneController sc = this.wwdSyncro.get(i).getSceneController();
sc.setVerticalExaggeration(Math.max(1d, sc.getVerticalExaggeration() - this.veStep));
}
//end Amadeus
SceneController sc = this.wwd.getSceneController();
sc.setVerticalExaggeration(Math.max(1d, sc.getVerticalExaggeration() - this.veStep));
}
view.firePropertyChange(AVKey.VIEW, null, view);
}