• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OrbitView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gov.nasa.worldwind.view.orbit.OrbitView的典型用法代码示例。如果您正苦于以下问题:Java OrbitView类的具体用法?Java OrbitView怎么用?Java OrbitView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OrbitView类属于gov.nasa.worldwind.view.orbit包,在下文中一共展示了OrbitView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: afterShow

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
/**
 * @see org.leo.traceroute.ui.AbstractRoutePanel#afterShow()
 */
@Override
public void afterShow(final Mode mode) {
	super.afterShow(mode);
	SwingUtilities.invokeLater(() -> {
		_container.invalidate();
		_container.revalidate();
		final GeoPoint localGeo = _services.getGeo().getLocalIpGeoLocation();
		final Position p = new Position(Angle.fromDegrees(localGeo.getLat()), Angle.fromDegrees(localGeo.getLon()), 2000);
		((OrbitView) _controller.getWWd().getView()).setCenterPosition(p);
		if (mode == Mode.TRACE_ROUTE) {
			_route.renotifyRoute();
		} else if (mode == Mode.SNIFFER) {
			_sniffer.renotifyPackets();
		} else {
			_whois.renotifyWhoIs();
		}
	});

}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:23,代码来源:WWJPanel.java


示例2: doZoom

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的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);
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:WWMap.java


示例3: createPlace

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
@Override
protected MapPlace createPlace(MapPlace root, String text, double x,
		double y, double zoom) {
	WorldWindowGLCanvas wwd = ((WWMap) map).wwd;
	OrbitView view = (OrbitView) wwd.getView();

	zoom = ((WWMap) map).getGMAZoom();
	Position pos = view.getCenterPosition();
	double pitch = view.getPitch().degrees;
	double heading = view.getHeading().degrees;
	double zoom2 = view.getZoom();
	double ve = wwd.getSceneController().getVerticalExaggeration();

	return new WWMapPlace( 
			root,
			text, 
			pos.getLongitude().degrees,
			pos.getLatitude().degrees,
			zoom,
			pitch,
			heading,
			zoom2,
			ve);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:25,代码来源:WWMapPlaces.java


示例4: moveToLocation

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
public static void moveToLocation(WorldWindow wwd, Sector sector, Double altitude)
{
    OrbitView view = (OrbitView) wwd.getView();

    Globe globe = wwd.getModel().getGlobe();

    if (altitude == null || altitude == 0)
    {
    	double t = sector.getDeltaLonRadians() > sector.getDeltaLonRadians()
    		? sector.getDeltaLonRadians() : sector.getDeltaLonRadians();
    	double w = 0.5 * t * 6378137.0;
    	altitude = w / wwd.getView().getFieldOfView().tanHalfAngle();
    }

    if (globe != null && view != null)
    {
        wwd.getView().goTo(new Position(sector.getCentroid(), 0), altitude);
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:20,代码来源:TellervoGazetteerPanel.java


示例5: computePanAmount

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的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


示例6: setupFirstPersonView

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
/**
 * Setup the view to a first person mode (zoom = 0)
 *
 * @param view the orbit view to set into a first person view.
 */
protected void setupFirstPersonView(OrbitView view)
{
    if (view.getZoom() == 0)  // already in first person mode
        return;

    Vec4 eyePoint = view.getEyePoint();
    // Center pos at eye pos
    Position centerPosition = wwd.getModel().getGlobe().computePositionFromPoint(eyePoint);
    // Compute pitch and heading relative to center position
    Vec4 normal = wwd.getModel().getGlobe().computeSurfaceNormalAtLocation(centerPosition.getLatitude(),
        centerPosition.getLongitude());
    Vec4 north = wwd.getModel().getGlobe().computeNorthPointingTangentAtLocation(centerPosition.getLatitude(),
        centerPosition.getLongitude());
    // Pitch
    view.setPitch(Angle.POS180.subtract(view.getForwardVector().angleBetween3(normal)));
    // Heading
    Vec4 perpendicular = view.getForwardVector().perpendicularTo3(normal);
    Angle heading = perpendicular.angleBetween3(north);
    double direction = Math.signum(-normal.cross3(north).dot3(perpendicular));
    view.setHeading(heading.multiply(direction));
    // Zoom
    view.setZoom(0);
    // Center pos
    view.setCenterPosition(centerPosition);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:31,代码来源:ViewControlsSelectListener.java


示例7: computeSurfacePoint

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
/**
 * Find out where on the terrain surface the eye would be looking at with the given heading and pitch angles.
 *
 * @param view    the orbit view
 * @param heading heading direction clockwise from north.
 * @param pitch   view pitch angle from the surface normal at the center point.
 *
 * @return the terrain surface point the view would be looking at in the viewport center.
 */
protected Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch)
{
    Globe globe = wwd.getModel().getGlobe();
    // Compute transform to be applied to north pointing Y so that it would point in the view direction
    // Move coordinate system to view center point
    Matrix transform = globe.computeSurfaceOrientationAtPosition(view.getCenterPosition());
    // Rotate so that the north pointing axes Y will point in the look at direction
    transform = transform.multiply(Matrix.fromRotationZ(heading.multiply(-1)));
    transform = transform.multiply(Matrix.fromRotationX(Angle.NEG90.add(pitch)));
    // Compute forward vector
    Vec4 forward = Vec4.UNIT_Y.transformBy4(transform);
    // Return intersection with terrain
    Intersection[] intersections = wwd.getSceneController().getTerrain().intersect(
        new Line(view.getEyePoint(), forward));
    return (intersections != null && intersections.length != 0) ? intersections[0].getIntersectionPoint() : null;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:26,代码来源:ViewControlsSelectListener.java


示例8: focusPoint

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的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);
		}
	}
}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:31,代码来源:WWJPanel.java


示例9: mouseClicked

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
@Override
	public void mouseClicked(MouseEvent evt) {
		if(evt.isControlDown())return;

		OrbitView view = (OrbitView) ww.getView();

		Position pos =
			view.computePositionFromScreenPoint(evt.getX(), evt.getY());

		if (pos == null) return;

		double x = pos.getLongitude().degrees;
		double y = pos.getLatitude().degrees;

		if (currentCruise != null && 
				currentCruise.getBounds().contains(x, y)) {
			// Do nothing
		} else {
			// Select Area
			int k = cruiseList.getSelectedIndex();
			k=k%cruises.length;
			int k0 = k;
			while(true)  {	
				if(cruises[k].getBounds().contains(x, y) ) {
					mouseE = true;
					cruiseList.setSelectedItem(cruises[k]);
					evt.consume();
//					setSelectedCruise(cruises[k]);
					return;
				}
				k = (k+1)%cruises.length;
				if(k==k0)
					break;
			} 
		}
	}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:37,代码来源:WWXMCS.java


示例10: computePitch

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
protected double computePitch(View view)
{
    if (view == null)
        return 0.0;

    if (!(view instanceof OrbitView))
        return 0.0;

    OrbitView orbitView = (OrbitView) view;
    return orbitView.getPitch().getDegrees();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:SunCompassLayer.java


示例11: computeHeading

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
private double computeHeading(View view)
{
	if (view == null)
		return 0.0;

	if (!(view instanceof OrbitView))
		return 0.0;

	OrbitView orbitView = (OrbitView) view;
	return orbitView.getHeading().getDegrees();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:DetailedIconRenderer.java


示例12: computePitch

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
private double computePitch(View view)
{
	if (view == null)
		return 0.0;

	if (!(view instanceof OrbitView))
		return 0.0;

	OrbitView orbitView = (OrbitView) view;
	return orbitView.getPitch().getDegrees();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:DetailedIconRenderer.java


示例13: goTo

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的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);
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:36,代码来源:WWMapPlaces.java


示例14: computeNewZoom

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
protected double computeNewZoom(OrbitView view, double amount)
{
    double coeff = 0.05;
    double change = coeff * amount;
    double logZoom = view.getZoom() != 0 ? Math.log(view.getZoom()) : 0;
    // Zoom changes are treated as logarithmic values. This accomplishes two things:
    // 1) Zooming is slow near the globe, and fast at great distances.
    // 2) Zooming in then immediately zooming out returns the viewer to the same zoom value.
    return Math.exp(logZoom + change);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:11,代码来源:ViewControlsSelectListener.java


示例15: computePanHeading

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
protected Angle computePanHeading(OrbitView view, ScreenAnnotation control)
{
    // Compute last pick point 'heading' 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;
    Angle heading = view.getHeading().add(Angle.fromRadians(Math.atan2(px, py)));
    heading = heading.degrees >= 0 ? heading : heading.addDegrees(360);
    return heading;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:12,代码来源:ViewControlsSelectListener.java


示例16: computeLookHeading

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
protected Angle computeLookHeading(OrbitView view, ScreenAnnotation control, double headingStep)
{
    // Compute last pick point 'heading' relative to look control center on x
    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 pickDistanceFactor = Math.min(Math.abs(px) / 3000, 5) * Math.signum(px);
    // New heading
    Angle heading = view.getHeading().add(Angle.fromRadians(headingStep * pickDistanceFactor));
    heading = heading.degrees >= 0 ? heading : heading.addDegrees(360);
    return heading;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:13,代码来源:ViewControlsSelectListener.java


示例17: computeLookPitch

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


示例18: resetOrbitView

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
/**
 * Reset the view to an orbit view state if in first person mode (zoom = 0)
 *
 * @param view the orbit view to reset
 */
protected void resetOrbitView(OrbitView view)
{
    if (view.getZoom() > 0)   // already in orbit view mode
        return;

    // Find out where on the terrain the eye is looking at in the viewport center
    // TODO: if no terrain is found in the viewport center, iterate toward viewport bottom until it is found
    Vec4 centerPoint = computeSurfacePoint(view, view.getHeading(), view.getPitch());
    // Reset the orbit view center point heading, pitch and zoom
    if (centerPoint != null)
    {
        Vec4 eyePoint = view.getEyePoint();
        // Center pos on terrain surface
        Position centerPosition = wwd.getModel().getGlobe().computePositionFromPoint(centerPoint);
        // Compute pitch and heading relative to center position
        Vec4 normal = wwd.getModel().getGlobe().computeSurfaceNormalAtLocation(centerPosition.getLatitude(),
            centerPosition.getLongitude());
        Vec4 north = wwd.getModel().getGlobe().computeNorthPointingTangentAtLocation(centerPosition.getLatitude(),
            centerPosition.getLongitude());
        // Pitch
        view.setPitch(Angle.POS180.subtract(view.getForwardVector().angleBetween3(normal)));
        // Heading
        Vec4 perpendicular = view.getForwardVector().perpendicularTo3(normal);
        Angle heading = perpendicular.angleBetween3(north);
        double direction = Math.signum(-normal.cross3(north).dot3(perpendicular));
        view.setHeading(heading.multiply(direction));
        // Zoom
        view.setZoom(eyePoint.distanceTo3(centerPoint));
        // Center pos
        view.setCenterPosition(centerPosition);
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:38,代码来源:ViewControlsSelectListener.java


示例19: setZoomLimits

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
public void setZoomLimits( double minZoom, double maxZoom ) {
    View view = getWwd().getView();
    if (view != null && view instanceof OrbitView) {
        OrbitView oView = (OrbitView) view;
        OrbitViewLimits orbitViewLimits = oView.getOrbitViewLimits();
        orbitViewLimits.setZoomLimits(minZoom, maxZoom);
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:9,代码来源:NwwPanel.java


示例20: setPitchLimits

import gov.nasa.worldwind.view.orbit.OrbitView; //导入依赖的package包/类
public void setPitchLimits( Angle minAngle, Angle maxangle ) {
    View view = getWwd().getView();
    if (view != null && view instanceof OrbitView) {
        OrbitView oView = (OrbitView) view;
        OrbitViewLimits orbitViewLimits = oView.getOrbitViewLimits();
        orbitViewLimits.setPitchLimits(minAngle, maxangle);
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:9,代码来源:NwwPanel.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TableSectionElement类代码示例发布时间:2022-05-22
下一篇:
Java MasterNotDiscoveredException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap