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


Java Position.getElevation方法代码示例

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


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

示例1: computePanAmount

import gov.nasa.worldwind.geom.Position; //导入方法依赖的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);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:27,代码来源:ViewControlsSelectListener.java

示例2: moved

import gov.nasa.worldwind.geom.Position; //导入方法依赖的package包/类
public void moved(PositionEvent event) {
    //panelWindWorld.handleCursorPositionChange(event);
    Position newPos = event.getPosition();
    positionEvent = event;
    
    try{

        newPos.getLatitude().fromDegreesLatitude(4.6276);
        newPos.getLongitude().fromDegreesLongitude(-74.0921);
        latitudWorld = newPos.getLatitude().getDegrees();
        longitudWorld = newPos.getLongitude().getDegrees();
        elevacionWorld = newPos.getElevation();

        //String las = makeAngleDescription("Lat", newPos.getLatitude());

        labelLatitud.setText(" Latitud: " + (float)latitudWorld + " º");
        labelLongitud.setText("Longitud: " + (float)longitudWorld + " º");
        labelElevacion.setText("Elevacion: " + (float)elevacionWorld + " Metros");

    }catch(NullPointerException NPE){
    }
}
 
开发者ID:danielbejaranogonzalez,项目名称:Mobile-Network-LTE,代码行数:23,代码来源:PanelDiagramas.java

示例3: getAltitudeOffset

import gov.nasa.worldwind.geom.Position; //导入方法依赖的package包/类
/**
 * @param eyePosition
 * @return Returns altitude offset depending on the configuration settings.
 */
public static double getAltitudeOffset(final Position eyePosition) {

	if (eyePosition == null) {
		return 0;
	}

	final TourTrackConfig config = TourTrackConfigManager.getActiveConfig();

	final boolean isAbsoluteAltitudeMode = config.altitudeMode == WorldWind.ABSOLUTE;
	final boolean isAltitudeOffset = config.isAltitudeOffset;
	final boolean isOffsetModeAbsolute =
			config.altitudeOffsetMode == TourTrackConfigManager.ALTITUDE_OFFSET_MODE_ABSOLUTE;
	final boolean isOffsetModeRelative =
			config.altitudeOffsetMode == TourTrackConfigManager.ALTITUDE_OFFSET_MODE_RELATIVE;

	final int relativeOffset = config.altitudeOffsetDistanceRelative;

	double altitudeOffset = 0;

	if (isAbsoluteAltitudeMode && isAltitudeOffset) {

		if (isOffsetModeAbsolute) {

			altitudeOffset = config.altitudeOffsetDistanceAbsolute;

		} else if (isOffsetModeRelative && relativeOffset > 0) {

			final double eyeElevation = eyePosition.getElevation();

			altitudeOffset = eyeElevation / 100.0 * relativeOffset;
		}

		if (config.isAltitudeOffsetRandom) {

			// this needs to be implemented, is not yet done
		}
	}

	return altitudeOffset;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:45,代码来源:Map3View.java


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