本文整理汇总了Java中gov.nasa.worldwind.geom.Angle.fromDegrees方法的典型用法代码示例。如果您正苦于以下问题:Java Angle.fromDegrees方法的具体用法?Java Angle.fromDegrees怎么用?Java Angle.fromDegrees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.geom.Angle
的用法示例。
在下文中一共展示了Angle.fromDegrees方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doZoom
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
public void doZoom(Point2D p, double factor) {
LatLon dest = new LatLon(Angle.fromDegrees(p.getY()), Angle.fromDegrees(p.getX()));
double wwzoom = 2785 * Math.pow(factor, -.8311) * 10000;
final OrbitView view = (OrbitView) wwd.getView();
FlyToOrbitViewAnimator fto =
FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
view,
view.getCenterPosition(), new Position(dest, 0),
view.getHeading(), Angle.fromDegrees(0),
view.getPitch(), Angle.fromDegrees(0),
view.getZoom(), wwzoom,
5000, WorldWind.CONSTANT); //was true
view.addAnimator(fto);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
((MapApp)getApp()).getFrame().toFront();
view.firePropertyChange(AVKey.VIEW, null, view);
}
});
}
示例2: setFallbacks
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
protected static void setFallbacks(AVList params)
{
if (params.getValue(AVKey.LEVEL_ZERO_TILE_DELTA) == null)
{
Angle delta = Angle.fromDegrees(36);
params.setValue(AVKey.LEVEL_ZERO_TILE_DELTA, new LatLon(delta, delta));
}
if (params.getValue(AVKey.TILE_WIDTH) == null)
params.setValue(AVKey.TILE_WIDTH, 512);
if (params.getValue(AVKey.TILE_HEIGHT) == null)
params.setValue(AVKey.TILE_HEIGHT, 512);
if (params.getValue(AVKey.FORMAT_SUFFIX) == null)
params.setValue(AVKey.FORMAT_SUFFIX, ".dds");
if (params.getValue(AVKey.NUM_LEVELS) == null)
params.setValue(AVKey.NUM_LEVELS, 19); // approximately 0.1 meters per pixel
if (params.getValue(AVKey.NUM_EMPTY_LEVELS) == null)
params.setValue(AVKey.NUM_EMPTY_LEVELS, 0);
}
示例3: setAnnotationPosition
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
private void setAnnotationPosition( final TrackPointAnnotation sliderAnnotation,
final TourData tourData,
final int positionIndex) {
final double[] latitudeSerie = tourData.latitudeSerie;
final double[] longitudeSerie = tourData.longitudeSerie;
final double latitude = latitudeSerie[positionIndex];
final double longitude = longitudeSerie[positionIndex];
final float[] altitudeSerie = tourData.altitudeSerie;
final float trackAltitude = altitudeSerie == null ? 0 : altitudeSerie[positionIndex];
final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();
final LatLon latLon = new LatLon(//
Angle.fromDegrees(latitude),
Angle.fromDegrees(longitude));
sliderAnnotation.latLon = latLon;
sliderAnnotation.trackAltitude = trackAltitude;
sliderAnnotation.setAltitudeMode(config.altitudeMode);
}
示例4: getUTMPosition
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
private Position getUTMPosition(Element empEl)
{
CoordinateConversion converter = new CoordinateConversion();
String sector = getTextValue(empEl, SECTOR) + " ";
String digraph = getTextValue(empEl, DIGRAPH) + " ";
String easting = getTextValue(empEl, EASTING) + " ";
String northing = getTextValue(empEl, NORTHING);
String UTMCoord = sector + digraph + easting + northing;
System.out.println(UTMCoord);
double[] gpsCoords = converter.utm2LatLon(UTMCoord);
System.out.println(gpsCoords[0]);
System.out.println(gpsCoords[1]);
double lat = gpsCoords[0];
double lon = gpsCoords[1];
//Create a new Employee with the value read from the xml nodes
Position e = new Position(Angle.fromDegrees(lat), Angle.fromDegrees(lon), 0.0);
return e;
}
示例5: getGPSPosition
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
/**
* I take an employee element and read the values in, create
* an Employee object and return it
* @param empEl
* @return
*/
private Position getGPSPosition(Element empEl)
{
double Lat = Double.parseDouble(getTextValue(empEl,"Lat"));
double Lon = Double.parseDouble(getTextValue(empEl,"Lon"));
double Altitude = Double.parseDouble(getTextValue(empEl,"Altitude"));
String type = empEl.getAttribute("type");
System.out.println("The type is : " + type);
//Create a new Employee with the value read from the xml nodes
Position e = new Position(Angle.fromDegrees(Lat), Angle.fromDegrees(Lon), Altitude);
return e;
}
示例6: setDestLocationButtonActionPerformed
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
private void setDestLocationButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_setDestLocationButtonActionPerformed
{//GEN-HEADEREND:event_setDestLocationButtonActionPerformed
try
{
destLatLon = new LatLon(Angle.fromDegrees(Double.parseDouble(destLatTextField.getText())),Angle.fromDegrees(Double.parseDouble(destLonTextField.getText())) );
destinationMarker.setPosition( new Position(destLatLon.getLatitude(), destLatLon.getLongitude(), 0.0) );
useDestinationCheckBox.setSelected(true);
manageDestinationObjects();
//System.out.println("here" + destLatLon.toString());
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this, "Data Error: \n" + e.toString(), "Data Error",JOptionPane.ERROR_MESSAGE);
}
}
示例7: setDestinationButtonActionPerformed
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
private void setDestinationButtonActionPerformed(java.awt.event.ActionEvent evt)
{
//System.out.println(wwd.getCurrentPosition().latitude.toString());
Position position = (Position) waypoint_list.getSelectedValue();
System.out.println(position.toString());
destLatTextField.setText("" + position.latitude.degrees);
destLonTextField.setText("" + position.longitude.degrees);
destLatLon = new LatLon(Angle.fromDegrees(Double.parseDouble(destLatTextField.getText())),
Angle.fromDegrees(Double.parseDouble(destLonTextField.getText())) );
// destinationMarker.setPosition( new Position(position.getLatitude(), position.getLongitude(), 0.0) );
useDestinationCheckBox.setSelected(true);
manageDestinationObjects();
}
示例8: computePanAmount
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
protected Angle computePanAmount(Globe globe, OrbitView view, ScreenAnnotation control, double panStep)
{
// Compute last pick point distance relative to pan control center
double size = control.getAttributes().getSize().width * control.getAttributes().getScale();
Vec4 center = new Vec4(control.getScreenPoint().x, control.getScreenPoint().y + size / 2, 0);
double px = lastPickPoint.x - center.x;
double py = view.getViewport().getHeight() - lastPickPoint.y - center.y;
double pickDistance = Math.sqrt(px * px + py * py);
double pickDistanceFactor = Math.min(pickDistance / 10, 5);
// Compute globe angular distance depending on eye altitude
Position eyePos = view.getEyePosition();
double radius = globe.getRadiusAt(eyePos);
double minValue = 0.5 * (180.0 / (Math.PI * radius)); // Minimum change ~0.5 meters
double maxValue = 1.0; // Maximum change ~1 degree
// Compute an interpolated value between minValue and maxValue, using (eye altitude)/(globe radius) as
// the interpolant. Interpolation is performed on an exponential curve, to keep the value from
// increasing too quickly as eye altitude increases.
double a = eyePos.getElevation() / radius;
a = (a < 0 ? 0 : (a > 1 ? 1 : a));
double expBase = 2.0; // Exponential curve parameter.
double value = minValue + (maxValue - minValue) * ((Math.pow(expBase, a) - 1.0) / (expBase - 1.0));
return Angle.fromDegrees(value * pickDistanceFactor * panStep);
}
示例9: focusPoint
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
@Override
protected void focusPoint(final GeoPoint point, final boolean isRunning, final boolean animation) {
final long elevation = 5000 * 1000;
if (_controller == null || _controller.getWWd() == null) {
return;
}
// center the map on the given point
final LabeledPath label = point == null ? null : _pointToLabel.get(point);
if (label != null) {
highlightAnnotation(label, point);
final View view = _controller.getWWd().getView();
final OrbitViewInputHandler ovih = (OrbitViewInputHandler) view.getViewInputHandler();
if (animation && Env.INSTANCE.getAnimationSpeed() > 0) {
final Position pos = new Position(label.getLocations().iterator().next(), 10);
ovih.addPanToAnimator(pos, view.getHeading(), view.getPitch(), elevation, Env.INSTANCE.getAnimationSpeed(), true);
// if (_mode == Mode.TRACE_ROUTE && isRunning) {
// // if tracing, move at the speed of the timeout
// final Position pos = new Position(label.getLocations().iterator().next(), 10);
// ovih.addPanToAnimator(pos, view.getHeading(), view.getPitch(), elevation,
// Env.INSTANCE.getAnimationSpeed(), true);
// } else if (_mode == Mode.TRACE_ROUTE || !isRunning) {
// _controller.getWWd().getView()
// .goTo(new Position(label.getLocations().iterator().next(), 10), elevation);
// }
} else {
final Position p = new Position(Angle.fromDegrees(point.getLat()), Angle.fromDegrees(point.getLon()), 2000);
((OrbitView) view).setCenterPosition(p);
}
}
}
示例10: goTo
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
@Override
protected void goTo(MapPlace loc) {
if (!(loc instanceof WWMapPlace)) {
super.goTo(loc);
return;
}
WWMapPlace wloc = (WWMapPlace) loc;
final OrbitView view = (OrbitView) ((WWMap)map).wwd.getView();
((WWMap)map).wwd.getSceneController().setVerticalExaggeration(wloc.ve);
Position center = Position.fromDegrees(wloc.lat, wloc.lon, 0);
Angle heading = Angle.fromDegrees(wloc.heading);
Angle pitch = Angle.fromDegrees(wloc.pitch);
double zoom = wloc.zoom2;
FlyToOrbitViewAnimator fto =
FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(
view,
view.getCenterPosition(), center,
view.getHeading(), heading,
view.getPitch(), pitch,
view.getZoom(), zoom,
5000, WorldWind.CONSTANT); // was true
view.addAnimator(fto);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
((MapApp)map.getApp()).getFrame().toFront();
view.firePropertyChange(AVKey.VIEW, null, view);
}
});
}
示例11: BusyImage
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
public BusyImage(Object imageSource)
{
super(imageSource);
this.setUseMipmaps(false);
this.angle = Angle.ZERO;
this.increment = Angle.fromDegrees(300);
}
示例12: setAngle
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
public void setAngle(Angle angle)
{
if (angle == null)
{
String message = Logging.getMessage("nullValue.AngleIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
double a = angle.degrees % 360;
a = (a > 180) ? (a - 360) : (a < -180 ? 360 + a : a);
this.angle = Angle.fromDegrees(a);
}
示例13: adjustAngleIncrement
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
protected Angle adjustAngleIncrement(DrawContext dc, Angle unitsPerSecond)
{
long millis = dc.getFrameTimeStamp() - this.lastFrameTime;
double seconds = millis / 1000.0;
double degrees = seconds * unitsPerSecond.degrees;
return Angle.fromDegrees(degrees);
}
示例14: setLookAtLastLocation
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
protected void setLookAtLastLocation(){
Location lastLocation = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if(null!=lastLocation){
BasicView view = (BasicView) wwd.getView();
Globe globe = wwd.getModel().getGlobe();
Position pos = new Position(Angle.fromDegrees(lastLocation.getLatitude()),
Angle.fromDegrees(lastLocation.getLongitude()),
globe.getElevation(Angle.fromDegrees(lastLocation.getLatitude()),Angle.fromDegrees(lastLocation.getLongitude())));
view.setLookAtPosition(pos);
addMarker(pos);
view.setRange(Constants.LAST_LOCATION_VIEW_DISTANCE_KM);
}
}
示例15: computeLookPitch
import gov.nasa.worldwind.geom.Angle; //导入方法依赖的package包/类
protected Angle computeLookPitch(OrbitView view, ScreenAnnotation control, double pitchStep)
{
// Compute last pick point 'pitch' relative to look control center on y
double size = control.getAttributes().getSize().width * control.getAttributes().getScale();
Vec4 center = new Vec4(control.getScreenPoint().x, control.getScreenPoint().y + size / 2, 0);
double py = view.getViewport().getHeight() - lastPickPoint.y - center.y;
double pickDistanceFactor = Math.min(Math.abs(py) / 3000, 5) * Math.signum(py);
// New pitch
Angle pitch = view.getPitch().add(Angle.fromRadians(pitchStep * pickDistanceFactor));
pitch = pitch.degrees >= 0 ? (pitch.degrees <= 90 ? pitch : Angle.fromDegrees(90)) : Angle.ZERO;
return pitch;
}