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


Java View类代码示例

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


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

示例1: needToSplit

import gov.nasa.worldwind.View; //导入依赖的package包/类
protected boolean needToSplit(DrawContext dc, Sector sector)
{
    Vec4[] corners = sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
    Vec4 centerPoint = sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());

    View view = dc.getView();
    double d1 = view.getEyePoint().distanceTo3(corners[0]);
    double d2 = view.getEyePoint().distanceTo3(corners[1]);
    double d3 = view.getEyePoint().distanceTo3(corners[2]);
    double d4 = view.getEyePoint().distanceTo3(corners[3]);
    double d5 = view.getEyePoint().distanceTo3(centerPoint);

    double minDistance = d1;
    if (d2 < minDistance)
        minDistance = d2;
    if (d3 < minDistance)
        minDistance = d3;
    if (d4 < minDistance)
        minDistance = d4;
    if (d5 < minDistance)
        minDistance = d5;

    double cellSize = (Math.PI * sector.getDeltaLatRadians() * dc.getGlobe().getRadius()) / 20; // TODO

    return !(Math.log10(cellSize) <= (Math.log10(minDistance) - this.splitScale));
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:27,代码来源:DynamicImageTileLayer.java

示例2: needToSplit

import gov.nasa.worldwind.View; //导入依赖的package包/类
private boolean needToSplit(DrawContext dc, Sector sector)
{
	Vec4[] corners = sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
	Vec4 centerPoint = sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());

	View view = dc.getView();
	double d1 = view.getEyePoint().distanceTo3(corners[0]);
	double d2 = view.getEyePoint().distanceTo3(corners[1]);
	double d3 = view.getEyePoint().distanceTo3(corners[2]);
	double d4 = view.getEyePoint().distanceTo3(corners[3]);
	double d5 = view.getEyePoint().distanceTo3(centerPoint);

	double minDistance = d1;
	if (d2 < minDistance)
		minDistance = d2;
	if (d3 < minDistance)
		minDistance = d3;
	if (d4 < minDistance)
		minDistance = d4;
	if (d5 < minDistance)
		minDistance = d5;

	double cellSize = (Math.PI * sector.getDeltaLatRadians() * dc.getGlobe().getRadius()) / this.density ; // TODO

	return !(Math.log10(cellSize) <= (Math.log10(minDistance) - this.splitScale ));
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:27,代码来源:WWSceneGraph.java

示例3: goToDefaultView

import gov.nasa.worldwind.View; //导入依赖的package包/类
/**
 * Go to a view of a list of positions. This method computes a view looking straight down from
 * an altitude that brings all of the positions into view.
 * 
 * @param positions
 *            List of positions to bring into view
 */
public void goToDefaultView(final List<? extends Position> positions) {

	final View view = this.wwd.getView();
	final Globe globe = view.getGlobe();

	if (globe == null) {

		/*
		 * this happenes when a tour is selected and the 3d map is not yet opened but is being
		 * opened with an action button
		 */
		StatusUtil.logInfo("globe == null"); //$NON-NLS-1$

		// try again
		Display.getCurrent().timerExec(200, new Runnable() {
			public void run() {
				gotoView(positions);
			}
		});

		return;
	}

	gotoView(positions);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:33,代码来源:Map3ViewController.java

示例4: getScreenPointsPolygon

import gov.nasa.worldwind.View; //导入依赖的package包/类
/**
 * Get the lat/long world geometry from two screen corner coordinates.
 * 
 * @param wwd
 *            the {@link WorldWindow} instance.
 * @param x1
 *            the first point screen x.
 * @param y1
 *            the first point screen y.
 * @param x2
 *            the second point screen x.
 * @param y2
 *            the second point screen y.
 * @return the world geomnetry.
 */
public static Geometry getScreenPointsPolygon( WorldWindow wwd, int x1, int y1, int x2, int y2 ) {
    View view = wwd.getView();
    Position p1 = view.computePositionFromScreenPoint(x1, y1);
    Position p2 = view.computePositionFromScreenPoint(x1, y2);
    Position p3 = view.computePositionFromScreenPoint(x2, y2);
    Position p4 = view.computePositionFromScreenPoint(x2, y1);

    Coordinate[] coords = { //
            new Coordinate(p1.longitude.degrees, p1.latitude.degrees), //
            new Coordinate(p2.longitude.degrees, p2.latitude.degrees), //
            new Coordinate(p3.longitude.degrees, p3.latitude.degrees), //
            new Coordinate(p4.longitude.degrees, p4.latitude.degrees)//
    };
    Geometry convexHull = GeometryUtilities.gf().createMultiPoint(coords).convexHull();
    return convexHull;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:32,代码来源:NwwUtilities.java

示例5: getViewportBounds

import gov.nasa.worldwind.View; //导入依赖的package包/类
public ReferencedEnvelope getViewportBounds() {
    View view = wwd.getView();
    Position posUL = view.computePositionFromScreenPoint(0, 0);
    Position posLR = view.computePositionFromScreenPoint(getWidth(), getHeight());

    if (posLR != null && posUL != null) {
        double west = posUL.longitude.degrees;
        double north = posUL.latitude.degrees;
        double east = posLR.longitude.degrees;
        double south = posLR.latitude.degrees;

        ReferencedEnvelope env = new ReferencedEnvelope(west, east, south, north, DefaultGeographicCRS.WGS84);
        return env;
    } else {
        return null;// new ReferencedEnvelope(-180, 180, -90, 90,
                    // DefaultGeographicCRS.WGS84);
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:NwwPanel.java

示例6: focusPoint

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

示例7: needToSplit

import gov.nasa.worldwind.View; //导入依赖的package包/类
protected boolean needToSplit(DrawContext dc, RectTile tile)
{
    Vec4[] corners = tile.sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
    Vec4 centerPoint = tile.sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());

    View view = dc.getView();
    double d1 = view.getEyePoint().distanceTo3(corners[0]);
    double d2 = view.getEyePoint().distanceTo3(corners[1]);
    double d3 = view.getEyePoint().distanceTo3(corners[2]);
    double d4 = view.getEyePoint().distanceTo3(corners[3]);
    double d5 = view.getEyePoint().distanceTo3(centerPoint);

    double minDistance = d1;
    if (d2 < minDistance)
        minDistance = d2;
    if (d3 < minDistance)
        minDistance = d3;
    if (d4 < minDistance)
        minDistance = d4;
    if (d5 < minDistance)
        minDistance = d5;

    double logDist = Math.log10(minDistance);
    double target = this.computeTileResolutionTarget(dc, tile);

    boolean useTile = tile.log10CellSize <= (logDist - target);
    return !useTile;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:29,代码来源:MYEBSRectangularTessellator.java

示例8: computeHeading

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

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

示例9: computePitch

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

示例10: computeHeading

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

示例11: computePitch

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

示例12: panToPos

import gov.nasa.worldwind.View; //导入依赖的package包/类
public void panToPos(Position pos)
{
       long timeInMilliseconds = 3000L; // Time in milliseconds you want the animation to take.
       View view = wwMapPanel.getWwd().getView(); // How you get the view depends on the context.
       OrbitViewInputHandler ovih = (OrbitViewInputHandler) view.getViewInputHandler();
       ovih.addPanToAnimator(pos, view.getHeading(), view.getPitch(), 8000000, timeInMilliseconds, true);
	
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:9,代码来源:GISFrame.java

示例13: saveState

import gov.nasa.worldwind.View; //导入依赖的package包/类
private void saveState() {

		/*
		 * It can happen that this view is not yet restored with restoreState() but the saveState()
		 * method is called which causes a NPE
		 */
		if (_graphId == null) {
			return;
		}

		final boolean isLegendVisible = Map3Manager.getLayer_TourLegend().isEnabled();
		final boolean isMarkerVisible = Map3Manager.getLayer_Marker().isEnabled();
		final boolean isSliderVisible = Map3Manager.getLayer_TrackSlider().isEnabled();
		final boolean isTrackVisible = Map3Manager.getLayer_TourTrack().isEnabled();

		_state.put(STATE_IS_LEGEND_VISIBLE, isLegendVisible);
		_state.put(STATE_IS_MARKER_VISIBLE, isMarkerVisible);
		_state.put(STATE_IS_SYNC_MAP_POSITION_WITH_SLIDER, _isMapSynched_WithChartSlider);
		_state.put(STATE_IS_SYNC_MAP_VIEW_WITH_TOUR, _isMapSynched_WithTour);
		_state.put(STATE_IS_SYNC_MAP3_WITH_OTHER_MAP, _isMapSynched_WithOtherMap);
		_state.put(STATE_IS_TOUR_VISIBLE, isTrackVisible);
		_state.put(STATE_IS_TRACK_SLIDER_VISIBLE, isSliderVisible);

		_state.put(STATE_TOUR_COLOR_ID, _graphId.name());

		final View view = _wwCanvas.getView();

		try {
			_state.put(STATE_MAP3_VIEW, view.getRestorableState());
		} catch (final Exception e) {
			// this can occure
//			StatusUtil.log(e);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:35,代码来源:Map3View.java

示例14: setZoomLimits

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

示例15: setPitchLimits

import gov.nasa.worldwind.View; //导入依赖的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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。