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

Java WorldWind类代码示例

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

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



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

示例1: createPath

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private Path createPath(final Color color) {
	final ShapeAttributes attrs = new BasicShapeAttributes();
	attrs.setEnableLighting(true);
	attrs.setOutlineMaterial(new Material(color));
	attrs.setInteriorMaterial(new Material(new Color(color.getRed(), color.getGreen(), color.getBlue(), 50), 50));
	attrs.setInteriorOpacity(0.3);
	attrs.setOutlineWidth(_mapLineThickness);
	attrs.setOutlineOpacity(0.7);
	final Path path = new Path();
	path.setExtrude(true);
	path.setAttributes(attrs);
	path.setVisible(true);
	path.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
	path.setPathType(AVKey.GREAT_CIRCLE);
	path.setFollowTerrain(true);
	return path;
}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:18,代码来源:WWJPanel.java


示例2: doZoom

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

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public GridTileLayer(GridRetriever retriever, ImageResampler ImageResampler) {
	super(makeLevels(retriever.getNumLevels()), new GridTiler(retriever, ImageResampler));
	tiler = (GridTiler) getTiler();
	tiler.renderTools.addChangeListener(this);
	
	if (!WorldWind.getMemoryCacheSet().containsCache(TextureTile.class.getName()))
	{
		long size = Configuration.getLongValue(AVKey.TEXTURE_IMAGE_CACHE_SIZE, 3000000L);
		MemoryCache cache = new BasicMemoryCache((long) (0.85 * size), size);
		cache.setName("Texture Tiles");
		WorldWind.getMemoryCacheSet().addCache(TextureTile.class.getName(), cache);
	}
	
	this.setUseTransparentTextures(true);
	this.setDrawTileBoundaries(true);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:17,代码来源:GridTileLayer.java


示例4: retrieveLocalImage

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void retrieveLocalImage(TextureTile tile, String mimeType, int timeout) throws Exception
{
    if (!WorldWind.getLocalRetrievalService().isAvailable())
        return;

    RetrieverFactory retrieverFactory = (RetrieverFactory) this.getValue(AVKey.RETRIEVER_FACTORY_LOCAL);
    if (retrieverFactory == null)
        return;

    AVListImpl avList = new AVListImpl();
    avList.setValue(AVKey.SECTOR, tile.getSector());
    avList.setValue(AVKey.WIDTH, tile.getWidth());
    avList.setValue(AVKey.HEIGHT, tile.getHeight());
    avList.setValue(AVKey.FILE_NAME, tile.getPath());
    avList.setValue(AVKey.IMAGE_FORMAT, mimeType);

    Retriever retriever = retrieverFactory.createRetriever(avList, new CompositionRetrievalPostProcessor(tile));

    Logging.logger().log(java.util.logging.Level.FINE, "Locally retrieving " + tile.getPath());
    retriever.setReadTimeout(timeout);
    retriever.call();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:23,代码来源:ScalingTiledImageLayer.java


示例5: retrieveLocalTexture

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void retrieveLocalTexture(TextureTile tile, DownloadPostProcessor postProcessor)
{
    if (!WorldWind.getLocalRetrievalService().isAvailable())
        return;

    RetrieverFactory retrieverFactory = (RetrieverFactory) this.getValue(AVKey.RETRIEVER_FACTORY_LOCAL);
    if (retrieverFactory == null)
        return;

    AVListImpl avList = new AVListImpl();
    avList.setValue(AVKey.SECTOR, tile.getSector());
    avList.setValue(AVKey.WIDTH, tile.getWidth());
    avList.setValue(AVKey.HEIGHT, tile.getHeight());
    avList.setValue(AVKey.FILE_NAME, tile.getPath());

    Retriever retriever = retrieverFactory.createRetriever(avList, postProcessor);

    WorldWind.getLocalRetrievalService().runRetriever(retriever, tile.getPriority());
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:20,代码来源:BasicScalingTiledImageLayer.java


示例6: createComponent

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected static Object createComponent(WMSCapabilities caps, AVList params)
{
    AVList configParams = params.copy(); // Copy to insulate changes from the caller.

    // Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
    configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
    configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
    configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);

    try
    {
        String factoryKey = getFactoryKeyForCapabilities(caps);
        Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
        return factory.createFromConfigSource(caps, params);
    }
    catch (Exception e)
    {
        // Ignore the exception, and just return null.
    }

    return null;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:23,代码来源:WMSLayersPanel.java


示例7: main

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public static void main(String[] args)
{
    //List<File> cacheLocations = WorldWind.getDataFileStore().getCacheLocations();

    // Analyse and cleanup (if needed) the write cache location
    File writeCache = WorldWind.getDataFileStore().getWriteLocation();

    // Analyse location
    System.out.println("Analyzing: " + writeCache.getAbsolutePath());
    CacheLocationData cld = analyseCacheLocation(writeCache);
    System.out.println("Size: " + (int)(cld.sizeInBytes / Math.pow(2, 20)) + "Mb in " + cld.fileCount + " file(s) from " + cld.directories.size() + " dir(s)");
    //for (CacheDirectory dir : cld.directories)
    //    System.out.println(new Date(dir.file.lastModified()) + " " + dir.sizeInBytes / 1024 + "Kb " + dir.file.getAbsolutePath());

    // Any cleanup needed?
    if (cld.sizeInBytes >= HIGH_WATER_IN_BYTES)
    {
        System.out.println("Cleaning down to " + (int)(LOW_WATER_IN_BYTES / Math.pow(2, 20)) + "Mb");
        cleanupCacheLocation(cld, LOW_WATER_IN_BYTES);
        System.out.println("Size: " + (int)(cld.sizeInBytes / Math.pow(2, 20)) + "Mb in " + cld.fileCount + " file(s)");
    }
    else
        System.out.println("No cleanup needed until " + (int)(HIGH_WATER_IN_BYTES / Math.pow(2, 20)) + "Mb");
}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:25,代码来源:CacheCleaner.java


示例8: createComponent

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private Object createComponent(WMSCapabilities caps, AVList params) {
    AVList configParams = params.copy(); // Copy to insulate changes from the caller.

    // Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
    configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
    configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
    configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);

    try {
        String factoryKey = getFactoryKeyForCapabilities(caps);
        Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
        return factory.createFromConfigSource(caps, configParams);
    } catch (Exception e) {
        // Ignore the exception, and just return null.
    }

    return null;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:WmsHandler.java


示例9: addPoint

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private void addPoint( SimpleFeature pointFeature ) {
    Geometry geometry = (Geometry) pointFeature.getDefaultGeometry();
    if (geometry == null) {
        return;
    }
    int numGeometries = geometry.getNumGeometries();
    for( int i = 0; i < numGeometries; i++ ) {
        Geometry geometryN = geometry.getGeometryN(i);
        if (geometryN instanceof Point) {
            Point point = (Point) geometryN;
            FeaturePoint marker = new FeaturePoint(Position.fromDegrees(point.getY(), point.getX(), 0), featureStoreInfo);
            marker.setFeature(pointFeature);
            marker.setAltitudeMode(WorldWind.CLAMP_TO_GROUND);
            marker.setAttributes(basicMarkerAttributes);
            addRenderable(marker);
        }
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:FeatureCollectionPointsLayer.java


示例10: initWorldWindLayerModel

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private void initWorldWindLayerModel()
{
    Model model = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
    model.setShowWireframeExterior(false);
    model.setShowWireframeInterior(false);
    model.setShowTessellationBoundingVolumes(false);

    if (is3DGlobe) {
        model.setGlobe(new Earth());
    } else {
        model.setGlobe(new EarthFlat());
    }

    world = new WorldWindowGLCanvas();
    world.setModel(model);
}
 
开发者ID:vobject,项目名称:maru,代码行数:17,代码来源:WorldWindMap.java


示例11: makeVerts

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void makeVerts(DrawContext dc, RectTile tile)
{
    // First see if the vertices have been previously computed and are in the cache. Since the elevation model
    // contents can change between frames, regenerate and re-cache vertices every second.
    // TODO: Go back to event-generated geometry re-computation.
    MemoryCache cache = WorldWind.getMemoryCache(CACHE_ID);
    CacheKey cacheKey = this.createCacheKey(dc, tile);
    tile.ri = (RenderInfo) cache.getObject(cacheKey);
    if (tile.ri != null && tile.ri.time >= System.currentTimeMillis() - this.getUpdateFrequency())
        return;

    if (this.buildVerts(dc, tile, this.makeTileSkirts))
        cache.add(cacheKey, tile.ri, tile.ri.getSizeInBytes());
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:MYEBSRectangularTessellator.java


示例12: dispose

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public void dispose() {
	rwl.writeLock().lock();
	isDisposed = true;
	
	frame.dispose();
	renderTools.setGrid(null);
	if (centerGrid != null)
		centerGrid.dispose();
	centerGrid = null;
	
	for (Grid2DOverlay grid : grids.values()) {
		grid.dispose();
	}
	
	grids.clear();
	
	for (TileKey tileKey : inMemory) {
		TextureTile tile = (TextureTile) 
			WorldWind.getMemoryCache(TextureTile.class.getName())
				.getObject(tileKey);
		
		if (tile != null) {
			WorldWind.getMemoryCache(TextureTile.class.getName())
				.remove(tileKey);
		}
	}
	
	invalid.addAll(valid);
	
	inMemory.clear();
	valid.clear();
	
	rwl.writeLock().unlock();
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:35,代码来源:GridTileLayer.java


示例13: sendRequests

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
private void sendRequests()
{
	Runnable task = this.requestQ.poll();
	while (task != null)
	{
		if (!WorldWind.getTaskService().isFull())
		{
			WorldWind.getTaskService().addTask(task);
		}
		task = this.requestQ.poll();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:13,代码来源:ScalingTiledImageLayer.java


示例14: sendRequests

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected void sendRequests()
{
    Runnable task = this.requestQ.poll();
    while (task != null)
    {
        if (!WorldWind.getTaskService().isFull())
        {
            WorldWind.getTaskService().addTask(task);
        }
        task = this.requestQ.poll();
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:13,代码来源:DynamicImageTileLayer.java


示例15: submitMissingTilesRequests

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
protected synchronized void submitMissingTilesRequests() throws InterruptedException
{
    RetrievalService rs = WorldWind.getRetrievalService();
    int i = 0;
    while (this.missingTiles.size() > i && rs.isAvailable())
    {
        Thread.sleep(1); // generates InterruptedException if thread has been interrupted

        TextureTile tile = this.missingTiles.get(i);

        if (this.layer.getLevels().isResourceAbsent(tile))
        {
            removeAbsentTile(tile);  // tile is absent, count it off.
            continue;
        }

        URL url = this.fileStore.findFile(tile.getPath(), false);
        if (url != null)
        {
            // tile has been retrieved and is local now, count it as retrieved.
            removeRetrievedTile(tile);
            continue;
        }

        this.layer.retrieveRemoteTexture(tile, createBulkDownloadPostProcessor(tile));
        i++;
    }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:29,代码来源:BasicScalingTiledImageLayerBulkDownloader.java


示例16: goTo

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


示例17: computeCenterPosition

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
/**
 * Compute a center position from an eye position and an orientation. If the view is looking at
 * the earth, the center position is the intersection point of the globe and a ray beginning at
 * the eye point, in the direction of the forward vector. If the view is looking at the horizon,
 * the center position is the eye position. Otherwise, the center position is null.
 * 
 * @param eyePosition
 *            The eye position.
 * @param forward
 *            The forward vector.
 * @param pitch
 *            View pitch.
 * @param altitudeMode
 *            Altitude mode of {@code eyePosition}.
 * @return The center position of the view.
 */
protected Position computeCenterPosition(	final Position eyePosition,
											final Vec4 forward,
											final Angle pitch,
											final int altitudeMode) {
	double height;

	final Angle latitude = eyePosition.getLatitude();
	final Angle longitude = eyePosition.getLongitude();

	final Globe globe = _wwCanvas.getModel().getGlobe();

	if (altitudeMode == WorldWind.CLAMP_TO_GROUND) {
		height = globe.getElevation(latitude, longitude);
	} else if (altitudeMode == WorldWind.RELATIVE_TO_GROUND) {
		height = globe.getElevation(latitude, longitude) + eyePosition.getAltitude();
	} else {
		height = eyePosition.getAltitude();
	}

	final Vec4 eyePoint = globe.computePointFromPosition(new Position(latitude, longitude, height));

	// Find the intersection of the globe and the camera's forward vector. Looking at the horizon (tilt == 90)
	// is a special case because it is a valid view, but the view vector does not intersect the globe.
	Position lookAtPosition;
	final double tolerance = 0.001;
	if (Math.abs(pitch.degrees - 90.0) > tolerance) {
		lookAtPosition = globe.getIntersectionPosition(new Line(eyePoint, forward));
	} else {
		lookAtPosition = globe.computePositionFromPoint(eyePoint);
	}

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


示例18: getValidAltitudeModeValue

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public static int getValidAltitudeModeValue(final int stateAltitudeMode) {

		for (final ComboEntry altiMode : ALTITUDE_MODE) {
			if (altiMode.value == stateAltitudeMode) {
				return altiMode.value;
			}
		}

		// return default value
		return WorldWind.CLAMP_TO_GROUND;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:12,代码来源:TourTrackConfig.java


示例19: CacheInspectorDialog

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
/** Creates new form CacheInspectorDialog
 * @param parent
 * @param modal
 */
public CacheInspectorDialog(java.awt.Frame parent, boolean modal)
{
    super(parent, modal);
    initComponents();

    // set cache location box
    File writeCache = WorldWind.getDataFileStore().getWriteLocation();
    cacheTextField.setText(writeCache.getAbsolutePath());

    // anaylze cache
    analyzeCache();

}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:18,代码来源:CacheInspectorDialog.java


示例20: analyzeCache

import gov.nasa.worldwind.WorldWind; //导入依赖的package包/类
public void analyzeCache()
{
    // loop for each high lecel dir for each size and display total size in a thread
    SwingUtilities.invokeLater(new Runnable()
        {
            public void run()
            {
                // display each top level dir info
                File writeCache = WorldWind.getDataFileStore().getWriteLocation();
                String dataStr = "";
                cld = CacheCleaner.analyseCacheLocation(writeCache);

                int lenPathRoot = writeCache.getAbsolutePath().length();

                for(CacheDirectory cd : cld.directories)
                {
                    dataStr += cd.file.getAbsolutePath().substring(lenPathRoot)  + " size: " + String.format("%.3f",cd.sizeInBytes/Math.pow(2, 20)) + " MB \n";
                }

                dataStr += " ------------- \n";
                
                dataStr += "Total Number of Directories: " + cld.directories.size() + "\n";
                dataStr += "Total Number of Files: " + cld.fileCount + "\n";
                dataStr += "Total size (MB): " + String.format("%.3f",cld.sizeInBytes/Math.pow(2, 20));


                cacheDataTextArea.setText(dataStr);

            }
        });
}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:32,代码来源:CacheInspectorDialog.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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