当前位置: 首页>>代码示例>>Java>>正文


Java View.setEyePosition方法代码示例

本文整理汇总了Java中gov.nasa.worldwind.View.setEyePosition方法的典型用法代码示例。如果您正苦于以下问题:Java View.setEyePosition方法的具体用法?Java View.setEyePosition怎么用?Java View.setEyePosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nasa.worldwind.View的用法示例。


在下文中一共展示了View.setEyePosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: gotoProduct

import gov.nasa.worldwind.View; //导入方法依赖的package包/类
private void gotoProduct(final Product product) {
    if (product == null) return;

    final View theView = getWwd().getView();
    final Position origPos = theView.getEyePosition();
    final GeoCoding geoCoding = product.getSceneGeoCoding();
    if (geoCoding != null && origPos != null) {
        final GeoPos centre = product.getSceneGeoCoding().getGeoPos(new PixelPos(product.getSceneRasterWidth() / 2,
                                                                            product.getSceneRasterHeight() / 2), null);
        centre.normalize();
        theView.setEyePosition(Position.fromDegrees(centre.getLat(), centre.getLon(), origPos.getElevation()));
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:14,代码来源:WWBaseToolView.java

示例2: goTo

import gov.nasa.worldwind.View; //导入方法依赖的package包/类
/**
 * Move to a given location.
 * 
 * @param lon
 *            the longitude.
 * @param lat
 *            the latitude.
 * @param elev
 *            the eye elevation.
 * @param azimuth
 *            if supplied, the map is rotated to follow that angle.
 * @param animate
 *            if <code>true</code>, it animates to the position.
 */
public synchronized Position goTo( Double lon, Double lat, Double elev, Double azimuth, boolean animate ) {
    View view = getWwd().getView();
    view.stopAnimations();
    view.stopMovement();

    Position eyePosition;
    if (lon == null || lat == null) {
        Position currentEyePosition = wwd.getView().getCurrentEyePosition();
        if (currentEyePosition != null) {
            lat = currentEyePosition.latitude.degrees;
            lon = currentEyePosition.longitude.degrees;
        } else {
            return null;
        }
    }

    if (elev == null) {
        // use the current
        elev = wwd.getView().getCurrentEyePosition().getAltitude();
    }
    if (Double.isNaN(elev)) {
        if (!Double.isNaN(lastElevation)) {
            elev = lastElevation;
        } else {
            elev = NwwUtilities.DEFAULT_ELEV;
        }
    }
    eyePosition = NwwUtilities.toPosition(lat, lon, elev);
    if (animate) {
        view.goTo(eyePosition, elev);
    } else {
        view.setEyePosition(eyePosition);
    }
    if (azimuth != null) {
        Angle heading = Angle.fromDegrees(azimuth);
        view.setHeading(heading);
    }
    lastElevation = elev;
    return eyePosition;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:55,代码来源:NwwPanel.java


注:本文中的gov.nasa.worldwind.View.setEyePosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。