├── WorldWindAndroid
├── .gitignore
├── src
│ ├── images
│ │ ├── notched-compass.png
│ │ ├── earth-map-512x256.png
│ │ └── world.topo.bathy.200405.3x2048x1024.pkm
│ ├── config
│ │ ├── SRTM30Plus_ExtremeElevations_5.bil
│ │ ├── worldwind.layers.xml
│ │ ├── worldwind.tessellator.xml
│ │ ├── DataFileStore.xml
│ │ └── Earth
│ │ │ ├── LandsatI3WMSLayer.xml
│ │ │ └── BMNGWMSLayer.xml
│ ├── shaders
│ │ ├── CompassLayerTexture.frag
│ │ ├── WorldMapLayerTexture.frag
│ │ ├── TextRenderer.frag
│ │ ├── SkyGradientLayer.frag
│ │ ├── ScalebarLayerColor.frag
│ │ ├── WorldMapLayerColor.frag
│ │ ├── CompassLayerTexture.vert
│ │ ├── WorldMapLayerTexture.vert
│ │ ├── AbstractShape.frag
│ │ ├── TextRenderer.vert
│ │ ├── TiledTessellatorPick.frag
│ │ ├── AbstractShape.vert
│ │ ├── ScalebarLayerColor.vert
│ │ ├── WorldMapLayerColor.vert
│ │ ├── SkyGradientLayer.vert
│ │ └── TiledTessellatorPick.vert
│ └── gov
│ │ └── nasa
│ │ └── worldwind
│ │ ├── kml
│ │ ├── KMLUpdateOperation.java
│ │ ├── KMLLineStyle.java
│ │ ├── KMLLinearRing.java
│ │ ├── KMLFolder.java
│ │ ├── KMLLabelStyle.java
│ │ ├── KMLBoundary.java
│ │ ├── KMLRenderable.java
│ │ ├── KMLSimpleData.java
│ │ ├── KMLItemIcon.java
│ │ ├── KMLAlias.java
│ │ ├── KMLAbstractColorStyle.java
│ │ ├── KMLScale.java
│ │ ├── KMLOrientation.java
│ │ ├── KMLSimpleField.java
│ │ ├── KMLAbstractView.java
│ │ ├── KMLPolyStyle.java
│ │ ├── KMLResourceMap.java
│ │ ├── KMLAbstractGeometry.java
│ │ ├── KMLLineString.java
│ │ ├── KMLAbstractSubStyle.java
│ │ ├── KMLAbstractTimePrimitive.java
│ │ ├── KMLSnippet.java
│ │ ├── KMLIconStyle.java
│ │ ├── KMLPair.java
│ │ ├── KMLSchema.java
│ │ ├── KMLLocation.java
│ │ ├── KMLCoordinatesParser.java
│ │ ├── KMLModel.java
│ │ ├── KMLVec2.java
│ │ ├── KMLAbstractLatLonBoxType.java
│ │ ├── KMLStyleUrl.java
│ │ ├── KMLChange.java
│ │ ├── KMLNetworkLinkControl.java
│ │ ├── KMLCreate.java
│ │ ├── KMLDelete.java
│ │ ├── impl
│ │ │ └── KMLController.java
│ │ ├── io
│ │ │ └── KMLDoc.java
│ │ ├── KMLPoint.java
│ │ └── KMLBalloonStyle.java
│ │ ├── Disposable.java
│ │ ├── cache
│ │ ├── Cacheable.java
│ │ ├── MemoryCacheSet.java
│ │ ├── FileStoreFilter.java
│ │ └── BasicMemoryCacheSet.java
│ │ ├── render
│ │ ├── Renderable.java
│ │ ├── SurfaceTile.java
│ │ ├── Highlightable.java
│ │ ├── OrderedRenderable.java
│ │ └── OffsetsList.java
│ │ ├── util
│ │ ├── xml
│ │ │ ├── XMLParserException.java
│ │ │ ├── UnrecognizedXMLEventParser.java
│ │ │ ├── XMLParserNotificationListener.java
│ │ │ ├── IntegerXMLEventParser.java
│ │ │ ├── DoubleXMLEventParser.java
│ │ │ ├── XMLEventReader.java
│ │ │ ├── StringXMLEventParser.java
│ │ │ ├── BooleanXMLEventParser.java
│ │ │ ├── BooleanIntegerXMLEventParser.java
│ │ │ ├── XMLEvent.java
│ │ │ ├── FakeXMLEvent.java
│ │ │ ├── StringSetXMLEventParser.java
│ │ │ └── XMLEventParser.java
│ │ ├── TaskService.java
│ │ ├── TileUrlBuilder.java
│ │ ├── dds
│ │ │ ├── Color32.java
│ │ │ ├── ColorBlock4x4.java
│ │ │ ├── ColorBlockExtractor.java
│ │ │ ├── AlphaBlockDXT3.java
│ │ │ ├── DDSConstants.java
│ │ │ ├── DXTCompressor.java
│ │ │ └── Color24.java
│ │ └── pkm
│ │ │ └── PKMReader.java
│ │ ├── retrieve
│ │ ├── RetrievalFuture.java
│ │ ├── RetrievalPostProcessor.java
│ │ ├── RetrieverFactory.java
│ │ ├── HTTPRetriever.java
│ │ ├── Retriever.java
│ │ ├── Progress.java
│ │ └── JarRetriever.java
│ │ ├── event
│ │ ├── RenderingListener.java
│ │ ├── MessageListener.java
│ │ ├── InputHandler.java
│ │ ├── BulkRetrievalListener.java
│ │ ├── NoOpInputHandler.java
│ │ ├── RenderingEvent.java
│ │ ├── Message.java
│ │ └── WWEvent.java
│ │ ├── terrain
│ │ ├── Tessellator.java
│ │ ├── SectorGeometryList.java
│ │ ├── SectorGeometry.java
│ │ ├── ZeroElevationModel.java
│ │ └── BasicTessellatorFactory.java
│ │ ├── Model.java
│ │ ├── globes
│ │ ├── GlobeStateKey.java
│ │ └── Earth.java
│ │ ├── exception
│ │ ├── WWTimeoutException.java
│ │ ├── WWUnrecognizedException.java
│ │ └── WWRuntimeException.java
│ │ ├── WWObject.java
│ │ ├── layers
│ │ └── Earth
│ │ │ └── BMNGOneImage.java
│ │ ├── Factory.java
│ │ ├── geom
│ │ ├── Rect.java
│ │ └── Extent.java
│ │ ├── pick
│ │ └── PickedObjectList.java
│ │ ├── ogc
│ │ ├── wms
│ │ │ ├── WMSAuthorityURL.java
│ │ │ └── WMSLayerIdentifier.java
│ │ └── OGCConstants.java
│ │ └── WWObjectImpl.java
├── .classpath
├── project.properties
├── AndroidManifest.xml
└── .project
├── WorldWindowApplicationSample
├── .gitignore
├── libs
│ ├── crouton-1.7.jar
│ ├── okhttp_10-05.jar
│ └── android-support-v4.jar
├── res
│ ├── drawable-hdpi
│ │ ├── icon.png
│ │ ├── grabber.png
│ │ ├── ic_launcher.png
│ │ ├── ic_menu_toc.png
│ │ ├── ic_action_grabber.png
│ │ └── ic_action_trilogis.png
│ ├── drawable-mdpi
│ │ ├── icon.png
│ │ ├── grabber.png
│ │ ├── ic_launcher.png
│ │ ├── ic_menu_toc.png
│ │ ├── ic_action_grabber.png
│ │ └── ic_action_trilogis.png
│ ├── drawable-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_menu_toc.png
│ │ ├── ic_action_grabber.png
│ │ └── ic_action_trilogis.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable
│ │ └── view_divider.xml
│ ├── values-v11
│ │ └── styles.xml
│ ├── values-v14
│ │ └── styles.xml
│ ├── values
│ │ ├── drag_list_attrs.xml
│ │ ├── styles.xml
│ │ ├── colors.xml
│ │ └── strings.xml
│ ├── menu
│ │ └── options.xml
│ └── layout
│ │ ├── toc_list_view_item.xml
│ │ ├── toc_view_dialog.xml
│ │ ├── dialog_wms_add.xml
│ │ └── main.xml
├── src
│ └── config
│ │ ├── wwandroiddemo.xml
│ │ ├── Earth
│ │ └── MSVirtualEarthAerialLayer.xml
│ │ └── worldwind.layers2.xml
├── .classpath
├── project.properties
└── .project
├── WorldDroidDemoApp
└── WorldDroid3.apk
├── CHANGELOG.md
└── README.md
/WorldWindAndroid/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | /gen
3 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | /gen
3 |
--------------------------------------------------------------------------------
/WorldDroidDemoApp/WorldDroid3.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldDroidDemoApp/WorldDroid3.apk
--------------------------------------------------------------------------------
/WorldWindAndroid/src/images/notched-compass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindAndroid/src/images/notched-compass.png
--------------------------------------------------------------------------------
/WorldWindAndroid/src/images/earth-map-512x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindAndroid/src/images/earth-map-512x256.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/libs/crouton-1.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/libs/crouton-1.7.jar
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/libs/okhttp_10-05.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/libs/okhttp_10-05.jar
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-hdpi/grabber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-hdpi/grabber.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-mdpi/grabber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-mdpi/grabber.png
--------------------------------------------------------------------------------
/WorldWindAndroid/src/config/SRTM30Plus_ExtremeElevations_5.bil:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindAndroid/src/config/SRTM30Plus_ExtremeElevations_5.bil
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-hdpi/ic_menu_toc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-hdpi/ic_menu_toc.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-mdpi/ic_menu_toc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-mdpi/ic_menu_toc.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-xhdpi/ic_menu_toc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-xhdpi/ic_menu_toc.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/WorldWindAndroid/src/images/world.topo.bathy.200405.3x2048x1024.pkm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindAndroid/src/images/world.topo.bathy.200405.3x2048x1024.pkm
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-hdpi/ic_action_grabber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-hdpi/ic_action_grabber.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-hdpi/ic_action_trilogis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-hdpi/ic_action_trilogis.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-mdpi/ic_action_grabber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-mdpi/ic_action_grabber.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-mdpi/ic_action_trilogis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-mdpi/ic_action_trilogis.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-xhdpi/ic_action_grabber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-xhdpi/ic_action_grabber.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable-xhdpi/ic_action_trilogis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TrilogisIT/WorldWind_Android/HEAD/WorldWindowApplicationSample/res/drawable-xhdpi/ic_action_trilogis.png
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/drawable/view_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/CompassLayerTexture.frag:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying vec2 vTextureCoord;
4 |
5 | uniform sampler2D sTexture;
6 |
7 | /*
8 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
9 | */
10 | void main()
11 | {
12 | gl_FragColor = texture2D(sTexture, vTextureCoord);
13 | }
14 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLUpdateOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * @author tag
9 | * @version $Id: KMLUpdateOperation.java 771 2012-09-14 19:30:10Z tgaskins $
10 | */
11 | public interface KMLUpdateOperation
12 | {
13 | public void applyOperation(KMLRoot operationsRoot);
14 | }
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/WorldMapLayerTexture.frag:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying vec2 vTextureCoord;
4 |
5 | uniform sampler2D sTexture;
6 |
7 | /*
8 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
9 | */
10 | void main()
11 | {
12 | gl_FragColor = texture2D(sTexture, vTextureCoord);
13 | /*gl_FragColor = vec4(1,0,0,1);*/
14 | }
15 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/TextRenderer.frag:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying vec2 vTextureCoord;
4 |
5 | varying vec4 vTextureColor;
6 |
7 | uniform sampler2D sTexture;
8 |
9 | /*
10 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
11 | */
12 | void main()
13 | {
14 | gl_FragColor = texture2D(sTexture, vTextureCoord) * vTextureColor;
15 | }
16 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/Disposable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: Disposable.java 733 2012-09-02 17:15:09Z dcollins $
11 | */
12 | public interface Disposable
13 | {
14 | void dispose();
15 | }
16 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/cache/Cacheable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.cache;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: Cacheable.java 733 2012-09-02 17:15:09Z dcollins $
11 | */
12 | public interface Cacheable
13 | {
14 | long getSizeInBytes();
15 | }
16 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/render/Renderable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.render;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: Renderable.java 733 2012-09-02 17:15:09Z dcollins $
11 | */
12 | public interface Renderable
13 | {
14 | void render(DrawContext dc);
15 | }
16 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/src/config/wwandroiddemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/WorldWindAndroid/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/XMLParserException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | /**
8 | * @author tag
9 | * @version $Id: XMLParserException.java 771 2012-09-14 19:30:10Z tgaskins $
10 | */
11 | public class XMLParserException extends Exception {
12 | /**
13 | *
14 | */
15 | private static final long serialVersionUID = 1944678042256045989L;
16 |
17 | public XMLParserException(Exception cause) {
18 | super(cause);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/RetrievalFuture.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.retrieve;
8 |
9 | /**
10 | * @author Tom Gaskins
11 | * @version $Id: RetrievalFuture.java 733 2012-09-02 17:15:09Z dcollins $
12 | */
13 | public interface RetrievalFuture extends java.util.concurrent.Future
14 | {
15 | Retriever getRetriever();
16 | }
17 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/TaskService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.util;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: TaskService.java 733 2012-09-02 17:15:09Z dcollins $
11 | */
12 | public interface TaskService
13 | {
14 | void runTask(Runnable task);
15 |
16 | boolean contains(Runnable task);
17 |
18 | boolean isFull();
19 | }
20 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/TileUrlBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util;
8 |
9 | import java.net.*;
10 |
11 | /**
12 | * @version $Id: TileUrlBuilder.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public interface TileUrlBuilder
15 | {
16 | URL getURL(Tile tile, String imageFormat) throws MalformedURLException;
17 | }
18 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/RenderingListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.event;
7 |
8 | import java.util.EventListener;
9 |
10 | /**
11 | * @author tag
12 | * @version $Id: RenderingListener.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public interface RenderingListener extends EventListener
15 | {
16 | void stageChanged(RenderingEvent event);
17 | }
18 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/MessageListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.event;
6 |
7 |
8 | /**
9 | * Listener for general purpose message events.
10 | *
11 | * @author pabercrombie
12 | * @version $Id: MessageListener.java 771 2012-09-14 19:30:10Z tgaskins $
13 | */
14 | public interface MessageListener
15 | {
16 | /**
17 | * Invoked when a message is received.
18 | *
19 | * @param msg The message that was received.
20 | */
21 | void onMessage(Message msg);
22 | }
23 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/RetrievalPostProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.retrieve;
8 |
9 | import java.nio.ByteBuffer;
10 |
11 | /**
12 | * @author Tom Gaskins
13 | * @version $Id: RetrievalPostProcessor.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public interface RetrievalPostProcessor
16 | {
17 | ByteBuffer run(Retriever retriever);
18 | }
19 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/UnrecognizedXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | /**
8 | * @author tag
9 | * @version $Id: UnrecognizedXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
10 | */
11 | public class UnrecognizedXMLEventParser extends AbstractXMLEventParser
12 | {
13 | public UnrecognizedXMLEventParser()
14 | {
15 | }
16 |
17 | public UnrecognizedXMLEventParser(String namespaceURI)
18 | {
19 | super(namespaceURI);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/RetrieverFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.retrieve;
8 |
9 | import gov.nasa.worldwind.avlist.AVList;
10 |
11 | /**
12 | * @author tag
13 | * @version $Id: RetrieverFactory.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public interface RetrieverFactory
16 | {
17 | Retriever createRetriever(AVList params, RetrievalPostProcessor postProcessor);
18 | }
19 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/SkyGradientLayer.frag:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | /*
4 | * Input varying vector from TiledTessellatorPick.vert defining the color for each primitive (triangle). This is
5 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
6 | */
7 | varying vec4 primColor;
8 |
9 | /*
10 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
11 | */
12 | void main()
13 | {
14 | /* Assign the fragment color to the varying vertex color. */
15 | gl_FragColor = primColor;
16 | }
17 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/ScalebarLayerColor.frag:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | /*
4 | * Input varying vector from TiledTessellatorPick.vert defining the color for each primitive (triangle). This is
5 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
6 | */
7 | varying vec4 primColor;
8 |
9 | /*
10 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
11 | */
12 | void main()
13 | {
14 | /* Assign the fragment color to the varying vertex color. */
15 | gl_FragColor = primColor;
16 | }
17 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/WorldMapLayerColor.frag:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | /*
4 | * Input varying vector from TiledTessellatorPick.vert defining the color for each primitive (triangle). This is
5 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
6 | */
7 | varying vec4 primColor;
8 |
9 | /*
10 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
11 | */
12 | void main()
13 | {
14 | /* Assign the fragment color to the varying vertex color. */
15 | gl_FragColor = primColor;
16 | }
17 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/terrain/Tessellator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.terrain;
7 |
8 | import gov.nasa.worldwind.WWObject;
9 | import gov.nasa.worldwind.render.DrawContext;
10 |
11 | /**
12 | * @author dcollins
13 | * @version $Id: Tessellator.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public interface Tessellator extends WWObject
16 | {
17 | SectorGeometryList tessellate(DrawContext dc);
18 | }
19 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/cache/MemoryCacheSet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.cache;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: MemoryCacheSet.java 834 2012-10-08 22:25:55Z dcollins $
11 | */
12 | public interface MemoryCacheSet
13 | {
14 | MemoryCache get(String key);
15 |
16 | MemoryCache put(String key, MemoryCache cache);
17 |
18 | boolean contains(String key);
19 |
20 | void clear();
21 | }
22 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/XMLParserNotificationListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | /**
8 | * @author tag
9 | * @version $Id: XMLParserNotificationListener.java 771 2012-09-14 19:30:10Z tgaskins $
10 | */
11 | public interface XMLParserNotificationListener
12 | {
13 | /**
14 | * Receives notification events from the parser context.
15 | *
16 | * @param notification the notification object containing the notificaton type and data.
17 | */
18 | public void notify(XMLParserNotification notification);
19 | }
20 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/render/SurfaceTile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.render;
7 |
8 | import gov.nasa.worldwind.geom.*;
9 |
10 | /**
11 | * @author dcollins
12 | * @version $Id: SurfaceTile.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public interface SurfaceTile
15 | {
16 | Sector getSector();
17 |
18 | boolean bind(DrawContext dc);
19 |
20 | void applyInternalTransform(DrawContext dc, Matrix matrix);
21 | }
22 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLLineStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML LineStyle element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLLineStyle.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLLineStyle extends KMLAbstractColorStyle
14 | {
15 | public KMLLineStyle(String namespaceURI)
16 | {
17 | super(namespaceURI);
18 | }
19 |
20 | public Double getWidth()
21 | {
22 | return (Double) this.getField("width");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/InputHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.event;
7 |
8 | import android.view.View;
9 | import gov.nasa.worldwind.*;
10 |
11 | /**
12 | * @author dcollins
13 | * @version $Id: InputHandler.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public interface InputHandler extends WWObject, View.OnTouchListener
16 | {
17 | WorldWindow getEventSource();
18 |
19 | void setEventSource(WorldWindow eventSource);
20 | }
21 |
--------------------------------------------------------------------------------
/WorldWindAndroid/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-15
15 | android.library=true
16 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/Model.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind;
7 |
8 | import gov.nasa.worldwind.globes.Globe;
9 | import gov.nasa.worldwind.layers.LayerList;
10 |
11 | /**
12 | * @author dcollins
13 | * @version $Id: Model.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public interface Model extends WWObject
16 | {
17 | Globe getGlobe();
18 |
19 | void setGlobe(Globe globe);
20 |
21 | LayerList getLayers();
22 |
23 | void setLayers(LayerList layers);
24 | }
25 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/values/drag_list_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLLinearRing.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML LinearRing element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLLinearRing.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLLinearRing extends KMLLineString
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLLinearRing(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 | android.library.reference.1=../WorldWindAndroid
16 |
--------------------------------------------------------------------------------
/WorldWindAndroid/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/globes/GlobeStateKey.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 | package gov.nasa.worldwind.globes;
6 |
7 | /**
8 | * Holds a globe's configuration state. The state can be used to compare a globe's current configuration with a previous
9 | * configuration.
10 | *
11 | * @author tag
12 | * @version $Id: GlobeStateKey.java 788 2012-09-22 00:05:42Z dcollins $
13 | */
14 | public interface GlobeStateKey
15 | {
16 | /**
17 | * Indicates the globe associated with this state key.
18 | *
19 | * @return the globe associated with this state key.
20 | */
21 | Globe getGlobe();
22 | }
23 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/CompassLayerTexture.vert:
--------------------------------------------------------------------------------
1 | /*
2 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
3 | * TODO.
4 | */
5 | attribute vec4 vertexPoint;
6 | attribute vec2 aTextureCoord;
7 | /*
8 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
9 | * coordinates.
10 | */
11 | uniform mat4 mvpMatrix;
12 | varying vec2 vTextureCoord;
13 |
14 | /*
15 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
16 | */
17 | void main()
18 | {
19 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
20 | gl_Position = mvpMatrix * vertexPoint;
21 | vTextureCoord = aTextureCoord;
22 | }
23 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/WorldMapLayerTexture.vert:
--------------------------------------------------------------------------------
1 | /*
2 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
3 | * TODO.
4 | */
5 | attribute vec4 vertexPoint;
6 | attribute vec2 aTextureCoord;
7 | /*
8 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
9 | * coordinates.
10 | */
11 | uniform mat4 mvpMatrix;
12 | varying vec2 vTextureCoord;
13 |
14 | /*
15 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
16 | */
17 | void main()
18 | {
19 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
20 | gl_Position = mvpMatrix * vertexPoint;
21 | vTextureCoord = aTextureCoord;
22 | }
23 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
16 |
17 |
18 |
21 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLFolder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML Folder element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLFolder.java 822 2012-09-28 03:16:15Z dcollins $
12 | */
13 | public class KMLFolder extends KMLAbstractContainer
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLFolder(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLLabelStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML LabelStyle element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLLabelStyle.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLLabelStyle extends KMLAbstractColorStyle
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLLabelStyle(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public Double getScale()
26 | {
27 | return (Double) this.getField("scale");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLBoundary.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML Boundary style and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLBoundary.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLBoundary extends KMLAbstractObject
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLBoundary(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public KMLLinearRing getLinearRing()
26 | {
27 | return (KMLLinearRing) this.getField("LinearRing");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLRenderable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.MessageListener;
8 | import gov.nasa.worldwind.render.DrawContext;
9 |
10 | /**
11 | * Interface for rendering KML elements.
12 | *
13 | * @author tag
14 | * @version $Id: KMLRenderable.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public interface KMLRenderable extends MessageListener
17 | {
18 | /**
19 | * Render this element.
20 | *
21 | * @param tc the current KML traversal context.
22 | * @param dc the current draw context.
23 | *
24 | * @throws IllegalArgumentException if either the traversal context or the draw context is null.
25 | */
26 | void render(KMLTraversalContext tc, DrawContext dc);
27 | }
28 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/exception/WWTimeoutException.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 | package gov.nasa.worldwind.exception;
6 |
7 | /**
8 | * Thrown when a World Wind operation times out.
9 | *
10 | * @author tag
11 | * @version $Id: WWTimeoutException.java 804 2012-09-26 01:46:04Z dcollins $
12 | */
13 | public class WWTimeoutException extends WWRuntimeException {
14 | /**
15 | *
16 | */
17 | private static final long serialVersionUID = -1247567988322973160L;
18 |
19 | /**
20 | * Construct an exception with a message string.
21 | *
22 | * @param msg
23 | * the message.
24 | */
25 | public WWTimeoutException(String msg) {
26 | super(msg);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/config/worldwind.layers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/WWObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind;
7 |
8 | import gov.nasa.worldwind.avlist.AVList;
9 | import gov.nasa.worldwind.event.MessageListener;
10 |
11 | import java.beans.PropertyChangeListener;
12 |
13 | /**
14 | * An interface provided by the major World Wind components to provide attribute-value list management and property
15 | * change management. Classifies implementers as property-change listeners, allowing them to receive property-change
16 | * events.
17 | *
18 | * @author dcollins
19 | * @version $Id: WWObject.java 771 2012-09-14 19:30:10Z tgaskins $
20 | */
21 | public interface WWObject extends AVList, PropertyChangeListener, MessageListener
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLSimpleData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.xml.AbstractXMLEventParser;
8 |
9 | /**
10 | * Represents the KML SimpleData element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLSimpleData.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLSimpleData extends AbstractXMLEventParser
16 | {
17 | /**
18 | * Construct an instance.
19 | *
20 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
21 | */
22 | public KMLSimpleData(String namespaceURI)
23 | {
24 | super(namespaceURI);
25 | }
26 |
27 | public String getName()
28 | {
29 | return (String) this.getField("name");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/IntegerXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 |
9 | /**
10 | * @author tag
11 | * @version $Id: IntegerXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class IntegerXMLEventParser extends AbstractXMLEventParser
14 | {
15 | public IntegerXMLEventParser()
16 | {
17 | }
18 |
19 | public IntegerXMLEventParser(String namespaceUri)
20 | {
21 | super(namespaceUri);
22 | }
23 |
24 | public Object parse(XMLEventParserContext ctx, XMLEvent integerEvent, Object... args)
25 | throws XMLParserException
26 |
27 | {
28 | String s = this.parseCharacterContent(ctx, integerEvent);
29 | return s != null ? WWUtil.convertStringToInteger(s) : null;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/AbstractShape.frag:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 |
6 | /*
7 | * OpenGL ES Shading Language v1.00 fragment shader for AbstractShape. Displays each fragment in the color specified by
8 | * the uniform variable named 'color'.
9 | *
10 | * version $Id: AbstractShape.frag 817 2012-09-27 19:03:38Z dcollins $
11 | */
12 |
13 | precision mediump float;
14 |
15 | /*
16 | * Input uniform vec4 defining the current color. Every fragment rasterized by this fragment shader is displayed in this
17 | * color.
18 | */
19 | uniform vec4 color;
20 |
21 | /*
22 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
23 | */
24 | void main()
25 | {
26 | gl_FragColor = color;
27 | }
28 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/TextRenderer.vert:
--------------------------------------------------------------------------------
1 | uniform vec4 uTextureColor;
2 | /*
3 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
4 | * TODO.
5 | */
6 | attribute vec4 vertexPoint;
7 | attribute vec2 aTextureCoord;
8 | /*
9 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
10 | * coordinates.
11 | */
12 | uniform mat4 mvpMatrix;
13 | varying vec2 vTextureCoord;
14 | varying vec4 vTextureColor;
15 |
16 | /*
17 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
18 | */
19 | void main()
20 | {
21 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
22 | gl_Position = mvpMatrix * vertexPoint;
23 | vTextureCoord = aTextureCoord;
24 | vTextureColor = uTextureColor;
25 | }
26 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/BulkRetrievalListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.event;
8 |
9 | import java.util.EventListener;
10 |
11 | /**
12 | * Interface for listening for bulk-download events.
13 | *
14 | * @author tag
15 | * @version $Id: BulkRetrievalListener.java 733 2012-09-02 17:15:09Z dcollins $
16 | */
17 | public interface BulkRetrievalListener extends EventListener
18 | {
19 | /**
20 | * A bulk-download event occurred, either a succes, a failure or an extended event.
21 | *
22 | * @param event the event that occurred.
23 | * @see gov.nasa.worldwind.retrieve.BulkRetrievable
24 | */
25 | void eventOccurred(BulkRetrievalEvent event);
26 | }
27 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLItemIcon.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML ItemIcon element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLItemIcon.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLItemIcon extends KMLAbstractObject
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLItemIcon(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public String getHref()
26 | {
27 | return (String) this.getField("href");
28 | }
29 |
30 | public String getState()
31 | {
32 | return (String) this.getField("state");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAlias.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML Alias element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLAlias.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLAlias extends KMLAbstractObject
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLAlias(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public String getTargetHref()
26 | {
27 | return (String) this.getField("targetHref");
28 | }
29 |
30 | public String getSourceRef()
31 | {
32 | return (String) this.getField("sourceHref");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/NoOpInputHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.event;
7 |
8 | import android.view.*;
9 | import android.view.View;
10 | import gov.nasa.worldwind.*;
11 |
12 | /**
13 | * @author dcollins
14 | * @version $Id: NoOpInputHandler.java 733 2012-09-02 17:15:09Z dcollins $
15 | */
16 | public class NoOpInputHandler extends WWObjectImpl implements InputHandler
17 | {
18 | public NoOpInputHandler()
19 | {
20 | }
21 |
22 | public WorldWindow getEventSource()
23 | {
24 | return null;
25 | }
26 |
27 | public void setEventSource(WorldWindow eventSource)
28 | {
29 | }
30 |
31 | public boolean onTouch(View view, MotionEvent motionEvent)
32 | {
33 | return false;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | #7f00
10 | #770000ff
11 | #7700ff00
12 | #77ffff00
13 |
14 | #ff000000
15 | #e0000000
16 | #00000000
17 |
18 | #f00
19 | #0000ff
20 | #f0f0
21 | #ffffff00
22 |
23 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/cache/FileStoreFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.cache;
7 |
8 | /**
9 | * A filter for named file paths in a {@link FileStore}.
10 | *
11 | * @author dcollins
12 | * @version $Id: FileStoreFilter.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public interface FileStoreFilter
15 | {
16 | /**
17 | * Returns whether or not this filter accepts the file name under a specified FileStore.
18 | *
19 | * @param fileStore the FileStore containing the named file path.
20 | * @param fileName the named file path in question.
21 | *
22 | * @return true if the file name should be accepted; false otherwise.
23 | */
24 | boolean accept(FileStore fileStore, String fileName);
25 | }
26 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAbstractColorStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML ColorStyle element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLAbstractColorStyle.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public abstract class KMLAbstractColorStyle extends KMLAbstractSubStyle
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | protected KMLAbstractColorStyle(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public String getColor()
26 | {
27 | return (String) this.getField("color");
28 | }
29 |
30 | public String getColorMode()
31 | {
32 | return (String) this.getField("colorMode");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | WorldWindAndroid
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLScale.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML Scale element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLScale.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLScale extends KMLAbstractObject
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLScale(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public Double getX()
26 | {
27 | return (Double) this.getField("x");
28 | }
29 |
30 | public Double getY()
31 | {
32 | return (Double) this.getField("y");
33 | }
34 |
35 | public Double getZ()
36 | {
37 | return (Double) this.getField("z");
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | WorldWindowApplicationSample
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/DoubleXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 |
9 | /**
10 | * @author tag
11 | * @version $Id: DoubleXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class DoubleXMLEventParser extends AbstractXMLEventParser {
14 | public DoubleXMLEventParser() {
15 | }
16 |
17 | public DoubleXMLEventParser(String namespaceUri) {
18 | super(namespaceUri);
19 | }
20 |
21 | public Object parse(XMLEventParserContext ctx, XMLEvent doubleEvent, Object... args) throws XMLParserException
22 |
23 | {
24 | String s = this.parseCharacterContent(ctx, doubleEvent);
25 | return s != null ? WWUtil.convertStringToDouble(s) : null;
26 | }
27 |
28 | public Double parseDouble(XMLEventParserContext ctx, XMLEvent doubleEvent, Object... args) throws XMLParserException
29 |
30 | {
31 | return (Double) this.parse(ctx, doubleEvent, args);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/XMLEventReader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import java.io.IOException;
8 | import org.xmlpull.v1.XmlPullParser;
9 | import org.xmlpull.v1.XmlPullParserException;
10 |
11 | /**
12 | * Edited By: Nicola Dorigatti, Trilogis
13 | *
14 | * @author tag
15 | * @version $Id: XMLEventReader.java 771 2012-09-14 19:30:10Z tgaskins $
16 | */
17 | public class XMLEventReader {
18 | protected XmlPullParser parser;
19 |
20 | public XMLEventReader(XmlPullParser parser) {
21 | this.parser = parser;
22 | }
23 |
24 | public XMLEvent nextEvent() throws XMLParserException {
25 | try {
26 | int eventType = this.parser.next();
27 |
28 | if (eventType == XmlPullParser.END_DOCUMENT) return null;
29 |
30 | return new XMLEvent(eventType, parser);
31 | } catch (IOException e) {
32 | throw new XMLParserException(e);
33 | } catch (XmlPullParserException e) {
34 | throw new XMLParserException(e);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLOrientation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML Orientation element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLOrientation.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLOrientation extends KMLAbstractObject
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLOrientation(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public Double getHeading()
26 | {
27 | return (Double) this.getField("heading");
28 | }
29 |
30 | public Double getTilt()
31 | {
32 | return (Double) this.getField("tilt");
33 | }
34 |
35 | public Double getRoll()
36 | {
37 | return (Double) this.getField("roll");
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/StringXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | /**
8 | * @author tag
9 | * @version $Id: StringXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
10 | */
11 | public class StringXMLEventParser extends AbstractXMLEventParser
12 | {
13 | public StringXMLEventParser()
14 | {
15 | }
16 |
17 | public StringXMLEventParser(String namespaceUri)
18 | {
19 | super(namespaceUri);
20 | }
21 |
22 | public Object parse(XMLEventParserContext ctx, XMLEvent stringEvent, Object... args)
23 | throws XMLParserException
24 |
25 | {
26 | String s = this.parseCharacterContent(ctx, stringEvent, args);
27 | return s != null ? s.trim() : null;
28 | }
29 |
30 | public String parseString(XMLEventParserContext ctx, XMLEvent stringEvent, Object... args)
31 | throws XMLParserException
32 |
33 | {
34 | return (String) this.parse(ctx, stringEvent, args);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/BooleanXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 |
9 | /**
10 | * @author tag
11 | * @version $Id: BooleanXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class BooleanXMLEventParser extends AbstractXMLEventParser
14 | {
15 | public BooleanXMLEventParser()
16 | {
17 | }
18 |
19 | public BooleanXMLEventParser(String namespaceUri)
20 | {
21 | super(namespaceUri);
22 | }
23 |
24 | public Object parse(XMLEventParserContext ctx, XMLEvent booleanEvent, Object... args)
25 | throws XMLParserException
26 |
27 | {
28 | String s = this.parseCharacterContent(ctx, booleanEvent);
29 | if (s == null)
30 | return false;
31 |
32 | s = s.trim();
33 |
34 | if (s.length() > 1)
35 | return s.equalsIgnoreCase("true");
36 |
37 | return WWUtil.convertNumericStringToBoolean(s);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/menu/options.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/BooleanIntegerXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 |
9 | /**
10 | * @author tag
11 | * @version $Id: BooleanIntegerXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class BooleanIntegerXMLEventParser extends AbstractXMLEventParser
14 | {
15 | public BooleanIntegerXMLEventParser()
16 | {
17 | }
18 |
19 | public BooleanIntegerXMLEventParser(String namespaceUri)
20 | {
21 | super(namespaceUri);
22 | }
23 |
24 | public Object parse(XMLEventParserContext ctx, XMLEvent booleanEvent, Object... args)
25 | throws XMLParserException
26 | {
27 | String s = this.parseCharacterContent(ctx, booleanEvent);
28 | if (s == null)
29 | return false;
30 |
31 | s = s.trim();
32 |
33 | if (s.length() > 1)
34 | return s.equalsIgnoreCase("true");
35 |
36 | return WWUtil.convertNumericStringToBoolean(s);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/TiledTessellatorPick.frag:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | /*
8 | * OpenGL ES Shading Language v1.00 fragment shader for TiledTessellator picking. Displays either a constant unique RGB
9 | * color or a unique RGB color assigned to each primitive (triangle).
10 | *
11 | * version $Id: TiledTessellatorPick.frag 733 2012-09-02 17:15:09Z dcollins $
12 | */
13 |
14 | precision mediump float;
15 |
16 | /*
17 | * Input varying vector from TiledTessellatorPick.vert defining the color for each primitive (triangle). This is
18 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
19 | */
20 | varying vec4 primColor;
21 |
22 | /*
23 | * OpenGL ES fragment shader entry point. Called for each fragment rasterized when this shader's program is bound.
24 | */
25 | void main()
26 | {
27 | /* Assign the fragment color to the varying vertex color. */
28 | gl_FragColor = primColor;
29 | }
30 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/render/Highlightable.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 | package gov.nasa.worldwind.render;
6 |
7 | /**
8 | * Highlightable provides an interface to control an object's highlighting. Objects implementing this interface have
9 | * their own highlighting behaviors and attributes and the means for setting them.
10 | *
11 | * @author tag
12 | * @version $Id: Highlightable.java 791 2012-09-24 17:14:43Z dcollins $
13 | */
14 | public interface Highlightable
15 | {
16 | /**
17 | * Indicates whether this object is currently highlighted.
18 | *
19 | * @return true if this object is highlighted, otherwise false.
20 | */
21 | boolean isHighlighted();
22 |
23 | /**
24 | * Specifies whether to highlight this object.
25 | *
26 | * @param highlighted true to highlight this object, otherwise false.
27 | */
28 | void setHighlighted(boolean highlighted);
29 | }
30 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLSimpleField.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.xml.AbstractXMLEventParser;
8 |
9 | /**
10 | * Represents the KML SimpleField element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLSimpleField.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLSimpleField extends AbstractXMLEventParser
16 | {
17 | /**
18 | * Construct an instance.
19 | *
20 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
21 | */
22 | public KMLSimpleField(String namespaceURI)
23 | {
24 | super(namespaceURI);
25 | }
26 |
27 | public String getType()
28 | {
29 | return (String) this.getField("type");
30 | }
31 |
32 | public String getName()
33 | {
34 | return (String) this.getField("name");
35 | }
36 |
37 | public String getDisplayName()
38 | {
39 | return (String) this.getField("displayName");
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/AbstractShape.vert:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 |
6 | /*
7 | * OpenGL ES Shading Language v1.00 vertex shader for AbstractShape. Transforms shape points from model coordinates to
8 | * eye coordinates.
9 | *
10 | * version $Id: AbstractShape.vert 817 2012-09-27 19:03:38Z dcollins $
11 | */
12 |
13 | /*
14 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
15 | * SurfaceGeometry.render.
16 | */
17 | attribute vec4 vertexPoint;
18 | /*
19 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
20 | * coordinates.
21 | */
22 | uniform mat4 mvpMatrix;
23 |
24 | /*
25 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
26 | */
27 | void main()
28 | {
29 | /* Transform the shape vertex point from model coordinates to eye coordinates. */
30 | gl_Position = mvpMatrix * vertexPoint;
31 | }
32 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/exception/WWUnrecognizedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.exception;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: WWUnrecognizedException.java 733 2012-09-02 17:15:09Z dcollins $
11 | */
12 | public class WWUnrecognizedException extends WWRuntimeException {
13 | /**
14 | *
15 | */
16 | private static final long serialVersionUID = -5525150187232623055L;
17 |
18 | /**
19 | * Construct an exception with a message string.
20 | *
21 | * @param msg
22 | * the message.
23 | */
24 | public WWUnrecognizedException(String msg) {
25 | super(msg);
26 | }
27 |
28 | /**
29 | * Construct an exception with a message string and a initial-cause exception.
30 | *
31 | * @param msg
32 | * the message.
33 | * @param t
34 | * the exception causing this exception.
35 | */
36 | public WWUnrecognizedException(String msg, Throwable t) {
37 | super(msg, t);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAbstractView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * Represents the KML AbstractView element.
12 | *
13 | * @author tag
14 | * @version $Id: KMLAbstractView.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public abstract class KMLAbstractView extends KMLAbstractObject
17 | {
18 | protected KMLAbstractView(String namespaceURI)
19 | {
20 | super(namespaceURI);
21 | }
22 |
23 | @Override
24 | public void applyChange(KMLAbstractObject sourceValues)
25 | {
26 | if (!(sourceValues instanceof KMLAbstractView))
27 | {
28 | String message = Logging.getMessage("KML.InvalidElementType", sourceValues.getClass().getName());
29 | Logging.warning(message);
30 | throw new IllegalArgumentException(message);
31 | }
32 |
33 | super.applyChange(sourceValues);
34 |
35 | this.onChange(new Message(KMLAbstractObject.MSG_VIEW_CHANGED, this));
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/render/OrderedRenderable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.render;
7 |
8 | import android.graphics.Point;
9 |
10 | /**
11 | * @author tag
12 | * @version $Id: OrderedRenderable.java 779 2012-09-19 18:51:21Z dcollins $
13 | */
14 | public interface OrderedRenderable extends Renderable
15 | {
16 | /**
17 | * Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a
18 | * list of ordered renderables according to eye distance, and only during frame generation when a view is active.
19 | *
20 | * @return the distance of the ordered renderable from the current view's eye point.
21 | */
22 | double getDistanceFromEye();
23 |
24 | /**
25 | * Executes a pick of the ordered renderable.
26 | *
27 | * @param dc the current draw context.
28 | * @param pickPoint the pick point.
29 | */
30 | public void pick(DrawContext dc, Point pickPoint);
31 | }
32 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLPolyStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML PolyStyle element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLPolyStyle.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLPolyStyle extends KMLAbstractColorStyle
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLPolyStyle(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | public Boolean getFill()
26 | {
27 | return (Boolean) this.getField("fill");
28 | }
29 |
30 | public boolean isFill()
31 | {
32 | return this.getFill() == null || this.getFill();
33 | }
34 |
35 | public Boolean getOutline()
36 | {
37 | return (Boolean) this.getField("outline");
38 | }
39 |
40 | public boolean isOutline()
41 | {
42 | return this.getOutline() == null || this.getOutline();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/layout/toc_list_view_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
18 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLResourceMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.xml.*;
8 |
9 | import java.util.*;
10 |
11 | /**
12 | * Represents the KML ResourceMap element and provides access to its contents.
13 | *
14 | * @author tag
15 | * @version $Id: KMLResourceMap.java 771 2012-09-14 19:30:10Z tgaskins $
16 | */
17 | public class KMLResourceMap extends KMLAbstractObject
18 | {
19 | protected List aliases = new ArrayList();
20 |
21 | public KMLResourceMap(String namespaceURI)
22 | {
23 | super(namespaceURI);
24 | }
25 |
26 | @Override
27 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
28 | {
29 | if (o instanceof KMLAlias)
30 | this.addAlias((KMLAlias) o);
31 | else
32 | super.doAddEventContent(o, ctx, event, args);
33 | }
34 |
35 | protected void addAlias(KMLAlias o)
36 | {
37 | this.aliases.add(o);
38 | }
39 |
40 | public List getAliases()
41 | {
42 | return this.aliases;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/render/OffsetsList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.render;
8 |
9 | import java.util.*;
10 |
11 | /**
12 | * Defines a structure to hold all the uv offsets for textures applied to a particular shape.
13 | *
14 | * @author ccrick
15 | * @version $Id: OffsetsList.java 733 2012-09-02 17:15:09Z dcollins $
16 | */
17 | public class OffsetsList
18 | {
19 | protected Map offsets;
20 |
21 | public OffsetsList()
22 | {
23 | offsets = new HashMap();
24 |
25 | // set default values to zero offset
26 | float[] zeroOffset = {0.0f, 0.0f};
27 | for (int i = 0; i < 4; i++)
28 | {
29 | offsets.put(i, zeroOffset);
30 | }
31 | }
32 |
33 | public float[] getOffset(int index)
34 | {
35 | return offsets.get(index);
36 | }
37 |
38 | public void setOffset(int index, float uOffset, float vOffset)
39 | {
40 | float[] offsetPair = {uOffset, vOffset};
41 | offsets.put(index, offsetPair);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/layers/Earth/BMNGOneImage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.layers.Earth;
7 |
8 | import gov.nasa.worldwind.geom.Sector;
9 | import gov.nasa.worldwind.layers.AbstractLayer;
10 | import gov.nasa.worldwind.render.*;
11 | import gov.nasa.worldwind.util.Logging;
12 |
13 | /**
14 | * @author dcollins
15 | * @version $Id: BMNGOneImage.java 777 2012-09-19 17:49:54Z dcollins $
16 | */
17 | public class BMNGOneImage extends AbstractLayer
18 | {
19 | //protected static final String IMAGE_PATH = "images/world.topo.bathy.200405.3x2048x1024.dds";
20 | protected static final String IMAGE_PATH = "images/world.topo.bathy.200405.3x2048x1024.pkm";
21 |
22 | protected SurfaceImage surfaceImage;
23 |
24 | public BMNGOneImage()
25 | {
26 | this.surfaceImage = new SurfaceImage(IMAGE_PATH, Sector.fromFullSphere());
27 | this.setName(Logging.getMessage("layers.Earth.BlueMarbleOneImageLayer.Name"));
28 | }
29 |
30 | @Override
31 | protected void doRender(DrawContext dc)
32 | {
33 | this.surfaceImage.render(dc);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAbstractGeometry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * Represents the KML Geometry element.
12 | *
13 | * @author tag
14 | * @version $Id: KMLAbstractGeometry.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public abstract class KMLAbstractGeometry extends KMLAbstractObject
17 | {
18 | /**
19 | * Construct an instance.
20 | *
21 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
22 | */
23 | protected KMLAbstractGeometry(String namespaceURI)
24 | {
25 | super(namespaceURI);
26 | }
27 |
28 | @Override
29 | public void applyChange(KMLAbstractObject sourceValues)
30 | {
31 | if (!(sourceValues instanceof KMLAbstractGeometry))
32 | {
33 | String message = Logging.getMessage("nullValue.SourceIsNull");
34 | Logging.warning(message);
35 | throw new IllegalArgumentException(message);
36 | }
37 |
38 | super.applyChange(sourceValues);
39 |
40 | this.onChange(new Message(KMLAbstractObject.MSG_GEOMETRY_CHANGED, this));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLLineString.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.geom.Position;
8 |
9 | /**
10 | * Represents the KML LineString element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLLineString.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLLineString extends KMLAbstractGeometry
16 | {
17 | public KMLLineString(String namespaceURI)
18 | {
19 | super(namespaceURI);
20 | }
21 |
22 | public boolean isExtrude()
23 | {
24 | return this.getExtrude() == Boolean.TRUE;
25 | }
26 |
27 | public Boolean getExtrude()
28 | {
29 | return (Boolean) this.getField("extrude");
30 | }
31 |
32 | public boolean isTessellate()
33 | {
34 | return this.getTessellate() == Boolean.TRUE;
35 | }
36 |
37 | public Boolean getTessellate()
38 | {
39 | return (Boolean) this.getField("tessellate");
40 | }
41 |
42 | public String getAltitudeMode()
43 | {
44 | return (String) this.getField("altitudeMode");
45 | }
46 |
47 | public Position.PositionList getCoordinates()
48 | {
49 | return (Position.PositionList) this.getField("coordinates");
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAbstractSubStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * Represents the KML SubStyle element.
12 | *
13 | * @author tag
14 | * @version $Id: KMLAbstractSubStyle.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public class KMLAbstractSubStyle extends KMLAbstractObject
17 | {
18 | /**
19 | * Construct an instance.
20 | *
21 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
22 | */
23 | protected KMLAbstractSubStyle(String namespaceURI)
24 | {
25 | super(namespaceURI);
26 | }
27 |
28 | @Override
29 | public void applyChange(KMLAbstractObject sourceValues)
30 | {
31 | if (!(sourceValues instanceof KMLAbstractSubStyle))
32 | {
33 | String message = Logging.getMessage("KML.InvalidElementType", sourceValues.getClass().getName());
34 | Logging.warning(message);
35 | throw new IllegalArgumentException(message);
36 | }
37 |
38 | super.applyChange(sourceValues);
39 |
40 | this.onChange(new Message(KMLAbstractObject.MSG_STYLE_CHANGED, this));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 | WorldDroid³
11 | WorldDroid³
12 | Dashboard
13 | Latitude:
14 | Longitude:
15 | Off globe
16 |
17 | TRILOGIS
18 | TOC
19 | Add WMS
20 | WMS Available Layers
21 | Table of Contents (Layers)
22 | Get Capabilities
23 | …
24 | Drag Item
25 | Delete Layer
26 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/Color32.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util.dds;
8 |
9 | /**
10 | * 32 bit 8888 ARGB color.
11 | *
12 | * @author dcollins
13 | * @version $Id: Color32.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public class Color32 extends Color24
16 | {
17 | /**
18 | * The alpha component.
19 | */
20 | public int a;
21 |
22 | /**
23 | * Creates a 32 bit 8888 ARGB color with all values set to 0.
24 | */
25 | public Color32()
26 | {
27 | super();
28 | this.a = 0;
29 | }
30 |
31 | public Color32(int a, int r, int g, int b)
32 | {
33 | super(r, g, b);
34 | this.a = a;
35 | }
36 |
37 | public static Color32 multiplyAlpha(Color32 color)
38 | {
39 | if (null == color)
40 | {
41 | return null;
42 | }
43 |
44 | Color32 result = new Color32();
45 |
46 | double alphaF = color.a / 256d;
47 |
48 | result.a = color.a;
49 | result.r = (int) (color.r * alphaF);
50 | result.g = (int) (color.g * alphaF);
51 | result.b = (int) (color.b * alphaF);
52 |
53 | return result;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/Factory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind;
7 |
8 | import gov.nasa.worldwind.avlist.AVList;
9 |
10 | /**
11 | * General factory interface.
12 | * Edited By: Nicola Dorigatti, Trilogis
13 | *
14 | * @author dcollins
15 | * @version $Id: Factory.java 733 2012-09-02 17:15:09Z dcollins $
16 | */
17 | public interface Factory {
18 | /**
19 | * Creates an object from a general configuration source.
20 | *
21 | * @param configSource
22 | * the configuration source.
23 | * @return the new object.
24 | * @throws IllegalArgumentException
25 | * if the configuration source is null or an empty string.
26 | * @throws gov.nasa.worldwind.exception.WWUnrecognizedException
27 | * if the type of source or some object-specific value is unrecognized.
28 | * @throws gov.nasa.worldwind.exception.WWRuntimeException
29 | * if object creation fails. The exception indicating the source of the failure is
30 | * included as the {@link Exception#initCause(Throwable)}.
31 | */
32 | Object createFromConfigSource(Object configSource);
33 |
34 | Object createFromConfigSource(Object configSource, AVList params);
35 | }
36 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAbstractTimePrimitive.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * Represents the KML TimePrimitive element.
12 | *
13 | * @author tag
14 | * @version $Id: KMLAbstractTimePrimitive.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public abstract class KMLAbstractTimePrimitive extends KMLAbstractObject
17 | {
18 | /**
19 | * Construct an instance.
20 | *
21 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
22 | */
23 | protected KMLAbstractTimePrimitive(String namespaceURI)
24 | {
25 | super(namespaceURI);
26 | }
27 |
28 | @Override
29 | public void applyChange(KMLAbstractObject sourceValues)
30 | {
31 | if (!(sourceValues instanceof KMLAbstractTimePrimitive))
32 | {
33 | String message = Logging.getMessage("KML.InvalidElementType", sourceValues.getClass().getName());
34 | Logging.warning(message);
35 | throw new IllegalArgumentException(message);
36 | }
37 |
38 | super.applyChange(sourceValues);
39 |
40 | this.onChange(new Message(KMLAbstractObject.MSG_TIME_CHANGED, this));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/RenderingEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.event;
7 |
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * @author dcollins
12 | * @version $Id: RenderingEvent.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public class RenderingEvent extends WWEvent {
15 | /**
16 | *
17 | */
18 | private static final long serialVersionUID = -7987723354928670370L;
19 | public static final String BEFORE_RENDERING = "gov.nasa.worldwind.RenderingEvent.BeforeRendering";
20 | public static final String AFTER_RENDERING = "gov.nasa.worldwind.RenderingEvent.AfterRendering";
21 |
22 | protected String stage;
23 |
24 | public RenderingEvent(Object source, String stage) {
25 | super(source);
26 | this.stage = stage;
27 | }
28 |
29 | public String getStage() {
30 | return this.stage != null ? this.stage : "gov.nasa.worldwind.RenderingEvent.UnknownStage";
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | StringBuilder sb = new StringBuilder();
36 | sb.append(this.getClass().getName());
37 | sb.append(" ");
38 | sb.append(this.stage != null ? this.stage : Logging.getMessage("term.Unknown"));
39 |
40 | return sb.toString();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLSnippet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 | import gov.nasa.worldwind.util.xml.*;
9 |
10 | /**
11 | * Represents the KML Snippet element and provides access to its contents.
12 | *
13 | * @author tag
14 | * @version $Id: KMLSnippet.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public class KMLSnippet extends KMLAbstractObject
17 | {
18 | /**
19 | * Construct an instance.
20 | *
21 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
22 | */
23 | public KMLSnippet(String namespaceURI)
24 | {
25 | super(namespaceURI);
26 | }
27 |
28 | @Override
29 | protected void doAddEventAttribute(String key, Object value, XMLEventParserContext ctx, XMLEvent event, Object... args)
30 | {
31 | if ("maxLines".equals(key))
32 | this.setMaxLines(WWUtil.makeInteger(value.toString()));
33 | else
34 | super.doAddEventAttribute(key, value, ctx, event, args);
35 | }
36 |
37 | public Integer getMaxLines()
38 | {
39 | return (Integer) this.getField("maxLines");
40 | }
41 |
42 | public void setMaxLines(Integer o)
43 | {
44 | this.setField("maxLines", o);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/layout/toc_view_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
18 |
27 |
28 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/config/worldwind.tessellator.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
30 |
31 | gov.nasa.worldwind.terrain.TiledTessellator
32 |
33 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/exception/WWRuntimeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.exception;
7 |
8 | /**
9 | * @author dcollins
10 | * @version $Id: WWRuntimeException.java 733 2012-09-02 17:15:09Z dcollins $
11 | */
12 | public class WWRuntimeException extends RuntimeException {
13 | /**
14 | *
15 | */
16 | private static final long serialVersionUID = 4560764319453773951L;
17 |
18 | /**
19 | * Construct an exception with a message string.
20 | *
21 | * @param msg
22 | * the message.
23 | */
24 | public WWRuntimeException(String msg) {
25 | super(msg);
26 | }
27 |
28 | /**
29 | * Construct an exception from an initial-cause exception.
30 | *
31 | * @param throwable
32 | * the exception causing this exception.
33 | */
34 | public WWRuntimeException(Throwable throwable) {
35 | super(throwable);
36 | }
37 |
38 | /**
39 | * Construct an exception with a message string and a initial-cause exception.
40 | *
41 | * @param msg
42 | * the message.
43 | * @param throwable
44 | * the exception causing this exception.
45 | */
46 | public WWRuntimeException(String msg, Throwable throwable) {
47 | super(msg, throwable);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/ScalebarLayerColor.vert:
--------------------------------------------------------------------------------
1 | /*
2 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
3 | * TODO.
4 | */
5 | attribute vec4 vertexPoint;
6 | /*
7 | * Input vertex attribute defining the unique RGB color of each primitive. This attribute is specified in TODO. Although
8 | * this attribute can vary per-vertex, it is assumed that either (a) this is a constant value for the entire primitive,
9 | * or (b) the same color is assigned to each triangle vertex.
10 | */
11 | uniform vec4 uColor;
12 | /*
13 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
14 | * coordinates.
15 | */
16 | uniform mat4 mvpMatrix;
17 |
18 | /*
19 | * Output variable vector to TiledTessellatorPick.frag defining the color for each primitive (triangle). This is
20 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
21 | */
22 | varying vec4 primColor;
23 |
24 | /*
25 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
26 | */
27 | void main()
28 | {
29 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
30 | gl_Position = mvpMatrix * vertexPoint;
31 |
32 | /* Assign the varying fragment color to the current vertex's color. */
33 | primColor = uColor;
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/WorldMapLayerColor.vert:
--------------------------------------------------------------------------------
1 | /*
2 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
3 | * TODO.
4 | */
5 | attribute vec4 vertexPoint;
6 | /*
7 | * Input vertex attribute defining the unique RGB color of each primitive. This attribute is specified in TODO. Although
8 | * this attribute can vary per-vertex, it is assumed that either (a) this is a constant value for the entire primitive,
9 | * or (b) the same color is assigned to each triangle vertex.
10 | */
11 | uniform vec4 uColor;
12 | /*
13 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
14 | * coordinates.
15 | */
16 | uniform mat4 mvpMatrix;
17 |
18 | /*
19 | * Output variable vector to TiledTessellatorPick.frag defining the color for each primitive (triangle). This is
20 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
21 | */
22 | varying vec4 primColor;
23 |
24 | /*
25 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
26 | */
27 | void main()
28 | {
29 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
30 | gl_Position = mvpMatrix * vertexPoint;
31 |
32 | /* Assign the varying fragment color to the current vertex's color. */
33 | primColor = uColor;
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/SkyGradientLayer.vert:
--------------------------------------------------------------------------------
1 | /*
2 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
3 | * TODO.
4 | */
5 | attribute vec4 vertexPoint;
6 | /*
7 | * Input vertex attribute defining the unique RGB color of each primitive. This attribute is specified in TODO. Although
8 | * this attribute can vary per-vertex, it is assumed that either (a) this is a constant value for the entire primitive,
9 | * or (b) the same color is assigned to each triangle vertex.
10 | */
11 | attribute vec4 vertexColor;
12 | /*
13 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
14 | * coordinates.
15 | */
16 | uniform mat4 mvpMatrix;
17 |
18 | /*
19 | * Output variable vector to TiledTessellatorPick.frag defining the color for each primitive (triangle). This is
20 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
21 | */
22 | varying vec4 primColor;
23 |
24 | /*
25 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
26 | */
27 | void main()
28 | {
29 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
30 | gl_Position = mvpMatrix * vertexPoint;
31 |
32 | /* Assign the varying fragment color to the current vertex's color. */
33 | primColor = vertexColor;
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLIconStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 |
9 | /**
10 | * Represents the KML IconStyle element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLIconStyle.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLIconStyle extends KMLAbstractColorStyle
16 | {
17 | /**
18 | * Construct an instance.
19 | *
20 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
21 | */
22 | public KMLIconStyle(String namespaceURI)
23 | {
24 | super(namespaceURI);
25 | }
26 |
27 | public Double getScale()
28 | {
29 | return (Double) this.getField("scale");
30 | }
31 |
32 | public Double getHeading()
33 | {
34 | return (Double) this.getField("heading");
35 | }
36 |
37 | public KMLVec2 getHotSpot()
38 | {
39 | return (KMLVec2) this.getField("hotSpot");
40 | }
41 | // TODO
42 | // public KMLIcon getIcon()
43 | // {
44 | // return (KMLIcon) this.getField("Icon");
45 | // }
46 |
47 | @Override
48 | public void onChange(Message msg)
49 | {
50 | if (KMLAbstractObject.MSG_LINK_CHANGED.equals(msg.getName()))
51 | this.onChange(new Message(KMLAbstractObject.MSG_STYLE_CHANGED, this));
52 |
53 | super.onChange(msg);
54 | }
55 | }
--------------------------------------------------------------------------------
/WorldWindAndroid/src/config/DataFileStore.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/globes/Earth.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.globes;
7 |
8 | import gov.nasa.worldwind.*;
9 | import gov.nasa.worldwind.avlist.AVKey;
10 | import gov.nasa.worldwind.terrain.*;
11 | import gov.nasa.worldwind.util.WWUtil;
12 |
13 | /**
14 | * @author dcollins
15 | * @version $Id: Earth.java 733 2012-09-02 17:15:09Z dcollins $
16 | */
17 | public class Earth extends EllipsoidalGlobe
18 | {
19 | public static final double WGS84_EQUATORIAL_RADIUS = 6378137.0; // ellipsoid equatorial getRadius, in meters
20 | protected static final double WGS84_POLAR_RADIUS = 6356752.3; // ellipsoid polar getRadius, in meters
21 | protected static final double WGS84_ES = 0.00669437999013; // eccentricity squared, semi-major axis
22 |
23 | public Earth()
24 | {
25 | super(WGS84_EQUATORIAL_RADIUS, WGS84_POLAR_RADIUS, WGS84_ES, createElevationModel());
26 | }
27 |
28 | protected static ElevationModel createElevationModel()
29 | {
30 | String configFile = Configuration.getStringValue(AVKey.EARTH_ELEVATION_MODEL_CONFIG_FILE);
31 | if (WWUtil.isEmpty(configFile))
32 | return new ZeroElevationModel();
33 |
34 | return (ElevationModel) BasicFactory.create(AVKey.ELEVATION_MODEL_FACTORY, configFile);
35 | }
36 |
37 | public String toString()
38 | {
39 | return "Earth";
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/src/config/Earth/MSVirtualEarthAerialLayer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MS Virtual Earth Aerial
5 |
6 | http://worldwind28.arc.nasa.gov/vewms/vewms.aspx
7 |
8 |
9 | 19 09 2009 04:10:00 GMT
10 | a
11 | Earth/MS_Virtual_Earth_a
12 | image/jpg
13 |
14 | image/jpg
15 |
16 | .jpg
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | true
37 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLPair.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.xml.*;
8 |
9 | /**
10 | * Represents the KML Pair element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLPair.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLPair extends KMLAbstractObject
16 | {
17 | /**
18 | * Construct an instance.
19 | *
20 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
21 | */
22 | public KMLPair(String namespaceURI)
23 | {
24 | super(namespaceURI);
25 | }
26 |
27 | @Override
28 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
29 | {
30 | if (o instanceof KMLAbstractStyleSelector)
31 | this.setStyleSelector((KMLAbstractStyleSelector) o);
32 | else
33 | super.doAddEventContent(o, ctx, event, args);
34 | }
35 |
36 | public String getKey()
37 | {
38 | return (String) this.getField("key");
39 | }
40 |
41 | public KMLStyleUrl getStyleUrl()
42 | {
43 | return (KMLStyleUrl) this.getField("styleUrl");
44 | }
45 |
46 | public KMLAbstractStyleSelector getStyleSelector()
47 | {
48 | return (KMLAbstractStyleSelector) this.getField("StyleSelector");
49 | }
50 |
51 | protected void setStyleSelector(KMLAbstractStyleSelector o)
52 | {
53 | this.setField("StyleSelector", o);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | Change Log
2 | ===============================================================================
3 | Version 1.0.3 *(2014-04-28)*
4 | ----------------------------
5 |
6 | * LIBRARY: Added support to every device by using ETC1 texture compression instead of DDS.
7 | * LIBRARY: Added WMSLayerName parameter in the TiledImageLayer (for further usages).
8 | * LIBRARY: Added a function in BasicView that enables animation to a specific location.
9 | * LIBRARY: Added GPSMarker as a new renderer item, so it is possible to render the user position in 3D.
10 | * EXAMPLE: Updated manifest to support more devices (Phones too)
11 | * DEMOAPP: Updated APK to latest version (1.0.3) available in Google Play Store too.
12 |
13 | Version 1.0.1 *(2013-11-22)*
14 | ----------------------------
15 |
16 | * LIBRARY: Fixed CompassLayer issue which lead the compass to rotate with a wrong heading.
17 |
18 |
19 | Version 1.0.1 *(2013-10-25)*
20 | ----------------------------
21 |
22 | * DEMOAPP: Added APK with ready to try demo application
23 | * EXAMPLE: Demo Application renaming and installation limited to tablets since phones are not able to read DDS for the services. We are working to support phones with lower detailed tiles.
24 |
25 |
26 | Version 1.0.0 *(2013-10-23)*
27 | ----------------------------
28 | Initial release.
29 |
30 | * LIBRARY: Supported the addition of WMS Layers, Compass Layer, WorldMap Layer, SkyGradient Layer, ScaleBarLayer. Fixed some issues with XML parsing that lead to loose opening tags in placeholders.
31 | * EXAMPLE: Added an extra demo with an integration with Picasso library in CardThumbnail
32 |
33 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/geom/Rect.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.geom;
7 |
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * @author dcollins
12 | * @version $Id: Rect.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public class Rect
15 | {
16 | public double x;
17 | public double y;
18 | public double width;
19 | public double height;
20 |
21 | public Rect()
22 | {
23 | }
24 |
25 | public Rect(double x, double y, double width, double height)
26 | {
27 | this.x = x;
28 | this.y = y;
29 | this.width = width;
30 | this.height = height;
31 | }
32 |
33 | public Rect copy()
34 | {
35 | return new Rect(this.x, this.y, this.width, this.height);
36 | }
37 |
38 | public Rect set(Rect rect)
39 | {
40 | if (rect == null)
41 | {
42 | String msg = Logging.getMessage("nullValue.RectIsNull");
43 | Logging.error(msg);
44 | throw new IllegalArgumentException(msg);
45 | }
46 |
47 | this.x = rect.x;
48 | this.y = rect.y;
49 | this.width = rect.width;
50 | this.height = rect.height;
51 |
52 | return this;
53 | }
54 |
55 | public Rect set(double x, double y, double width, double height)
56 | {
57 | this.x = x;
58 | this.y = y;
59 | this.width = width;
60 | this.height = height;
61 |
62 | return this;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLSchema.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.xml.*;
8 |
9 | import java.util.*;
10 |
11 | /**
12 | * Represents the KML Schema element and provides access to its contents.
13 | *
14 | * @author tag
15 | * @version $Id: KMLSchema.java 771 2012-09-14 19:30:10Z tgaskins $
16 | */
17 | public class KMLSchema extends AbstractXMLEventParser
18 | {
19 | protected List simpleFields = new ArrayList();
20 |
21 | /**
22 | * Construct an instance.
23 | *
24 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
25 | */
26 | public KMLSchema(String namespaceURI)
27 | {
28 | super(namespaceURI);
29 | }
30 |
31 | @Override
32 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
33 | {
34 | if (o instanceof KMLSimpleField)
35 | this.addSimpleField((KMLSimpleField) o);
36 | else
37 | super.doAddEventContent(o, ctx, event, args);
38 | }
39 |
40 | public String getName()
41 | {
42 | return (String) this.getField("name");
43 | }
44 |
45 | public String getId()
46 | {
47 | return (String) this.getField("id");
48 | }
49 |
50 | protected void addSimpleField(KMLSimpleField o)
51 | {
52 | this.simpleFields.add(o);
53 | }
54 |
55 | public List getSimpleFields()
56 | {
57 | return this.simpleFields;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/pkm/PKMReader.java:
--------------------------------------------------------------------------------
1 | package gov.nasa.worldwind.util.pkm;
2 |
3 | import gov.nasa.worldwind.util.Logging;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import android.opengl.ETC1;
7 | import android.opengl.ETC1Util;
8 | import android.opengl.ETC1Util.ETC1Texture;
9 |
10 | /**
11 | * @author nicastel
12 | * @version $Id: PKMReader.java 2014-14-04 ndorigatti $
13 | */
14 | public class PKMReader {
15 |
16 | public PKMReader() {
17 | }
18 |
19 | public PKMGpuTextureData read(InputStream stream) throws IOException {
20 | if (stream == null)
21 | {
22 | String msg = Logging.getMessage("nullValue.InputStreamIsNull");
23 | Logging.error(msg);
24 | throw new IllegalArgumentException(msg);
25 | }
26 | try {
27 | stream.mark(1024);
28 | ETC1Texture texture = ETC1Util.createTexture(stream);
29 |
30 | if (texture != null) {
31 | //Estimate the memory size
32 | int estimatedMemorySize = ETC1.ETC_PKM_HEADER_SIZE + texture.getHeight() * texture.getWidth() / 2;
33 | return PKMGpuTextureData.fromETCCompressedData(texture, estimatedMemorySize);
34 | } else {
35 | return null;
36 | }
37 | } catch (IOException e) {
38 | //stream.reset();
39 | //texture = encodeTexture(stream);
40 | //e.printStackTrace();
41 | //System.out.println("Texture PKM failed ");
42 | String msg = Logging.getMessage("nullValue.InputStreamIOException");
43 | Logging.error(msg);
44 | return null;
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/src/config/worldwind.layers2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
16 |
17 |
20 |
23 |
28 |
32 |
36 |
40 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLLocation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.geom.Position;
8 |
9 | /**
10 | * Represents the KML Location element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLLocation.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLLocation extends KMLAbstractObject
16 | {
17 | /**
18 | * Construct an instance.
19 | *
20 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
21 | */
22 | public KMLLocation(String namespaceURI)
23 | {
24 | super(namespaceURI);
25 | }
26 |
27 | public Double getLongitude()
28 | {
29 | return (Double) this.getField("longitude");
30 | }
31 |
32 | public Double getLatitude()
33 | {
34 | return (Double) this.getField("latitude");
35 | }
36 |
37 | public Double getAltitude()
38 | {
39 | return (Double) this.getField("altitude");
40 | }
41 |
42 | /**
43 | * Retrieves this location as a {@link gov.nasa.worldwind.geom.Position}. Fields that are not set are treated as zero.
44 | *
45 | * @return Position object representing this location.
46 | */
47 | public Position getPosition()
48 | {
49 | Double lat = this.getLatitude();
50 | Double lon = this.getLongitude();
51 | Double alt = this.getAltitude();
52 |
53 | return Position.fromDegrees(
54 | lat != null ? lat : 0,
55 | lon != null ? lon : 0,
56 | alt != null ? alt : 0);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/terrain/SectorGeometryList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.terrain;
7 |
8 | import android.graphics.Point;
9 | import gov.nasa.worldwind.geom.*;
10 | import gov.nasa.worldwind.render.DrawContext;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * @author dcollins
16 | * @version $Id: SectorGeometryList.java 802 2012-09-26 01:37:27Z dcollins $
17 | */
18 | public interface SectorGeometryList extends List
19 | {
20 | Sector getSector();
21 |
22 | /**
23 | * Computes the point in model coordinates on the geometry's surface at specified geographic location.
24 | *
25 | * @param latitude the latitude of the point to compute.
26 | * @param longitude the longitude of the point to compute.
27 | * @param result contains the model coordinate point in meters, relative to an origin of (0, 0, 0) after this
28 | * method exits. The result parameter is left unchanged if this method returns false.
29 | *
30 | * @return true if there is sector geometry in this list for the specified location, otherwise
31 | * false.
32 | *
33 | * @throws IllegalArgumentException if any of the latitude, longitude or result are null.
34 | */
35 | boolean getSurfacePoint(Angle latitude, Angle longitude, Vec4 result);
36 |
37 | void beginRendering(DrawContext dc);
38 |
39 | void endRendering(DrawContext dc);
40 |
41 | void pick(DrawContext dc, Point pickPoint);
42 | }
43 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLCoordinatesParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.geom.Position;
8 | import gov.nasa.worldwind.util.xml.AbstractXMLEventParser;
9 | import gov.nasa.worldwind.util.xml.XMLEvent;
10 | import gov.nasa.worldwind.util.xml.XMLEventParserContext;
11 | import gov.nasa.worldwind.util.xml.XMLParserException;
12 | import java.util.ArrayList;
13 |
14 | /**
15 | * Parses KML coordinates elements.
16 | *
17 | * @author tag
18 | * @version $Id: KMLCoordinatesParser.java 771 2012-09-14 19:30:10Z tgaskins $
19 | */
20 | public class KMLCoordinatesParser extends AbstractXMLEventParser {
21 | public KMLCoordinatesParser() {
22 | }
23 |
24 | public KMLCoordinatesParser(String namespaceURI) {
25 | super(namespaceURI);
26 | }
27 |
28 | public Position.PositionList parse(XMLEventParserContext ctx, XMLEvent doubleEvent, Object... args) throws XMLParserException {
29 | String s = ctx.getStringParser().parseString(ctx, doubleEvent);
30 | if (s == null || s.length() < 3) // "a,b" is the smallest possible coordinate string
31 | return null;
32 |
33 | ArrayList positions = new ArrayList();
34 |
35 | KMLCoordinateTokenizer tokenizer = new KMLCoordinateTokenizer(s);
36 |
37 | while (tokenizer.hasMoreTokens()) {
38 | try {
39 | positions.add(tokenizer.nextPosition());
40 | } catch (NumberFormatException e) {
41 | continue; // TODO: issue warning?
42 | } catch (NullPointerException e) {
43 | continue; // TODO: issue warning?
44 | } catch (Exception e) {
45 | continue; // TODO: issue warning
46 | }
47 | }
48 |
49 | return new Position.PositionList(positions);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/pick/PickedObjectList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.pick;
7 |
8 | import java.util.ArrayList;
9 |
10 | /**
11 | * @author tag
12 | * @version $Id: PickedObjectList.java 830 2012-10-08 20:47:53Z tgaskins $
13 | */
14 | public class PickedObjectList extends ArrayList {
15 | /**
16 | *
17 | */
18 | private static final long serialVersionUID = 8471685774055837886L;
19 |
20 | public PickedObjectList() {
21 | }
22 |
23 | public void set(PickedObjectList list) {
24 | super.clear();
25 | super.addAll(list);
26 | }
27 |
28 | public boolean hasNonTerrainObjects() {
29 | return this.size() > 1 || (this.size() == 1 && this.getTerrainObject() == null);
30 | }
31 |
32 | public Object getTopObject() {
33 | PickedObject po = this.getTopPickedObject();
34 | return po != null ? po.getObject() : null;
35 | }
36 |
37 | public PickedObject getTopPickedObject() {
38 | int size = this.size();
39 |
40 | if (1 < size) {
41 | for (PickedObject po : this) {
42 | if (po.isOnTop()) return po;
43 | }
44 | }
45 |
46 | if (0 < size) { // if we are here, then no objects were mark as 'top'
47 | return this.get(0);
48 | }
49 |
50 | return null;
51 | }
52 |
53 | public PickedObject getTerrainObject() {
54 | for (PickedObject po : this) {
55 | if (po.isTerrain()) return po;
56 | }
57 |
58 | return null;
59 | }
60 |
61 | public PickedObject getMostRecentPickedObject() {
62 | return this.size() > 0 ? this.get(this.size() - 1) : null;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML Model element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLModel.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLModel extends KMLAbstractGeometry
14 | {
15 | /** Flag to indicate that the link has been fetched from the hash map. */
16 | protected boolean linkFetched = false;
17 | // protected KMLLink link; // TODO
18 |
19 | /**
20 | * Construct an instance.
21 | *
22 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
23 | */
24 | public KMLModel(String namespaceURI)
25 | {
26 | super(namespaceURI);
27 | }
28 |
29 | public String getAltitudeMode()
30 | {
31 | return (String) this.getField("altitudeMode");
32 | }
33 |
34 | public KMLLocation getLocation()
35 | {
36 | return (KMLLocation) this.getField("Location");
37 | }
38 |
39 | public KMLOrientation getOrientation()
40 | {
41 | return (KMLOrientation) this.getField("Orientation");
42 | }
43 |
44 | public KMLScale getScale()
45 | {
46 | return (KMLScale) this.getField("Scale");
47 | }
48 | //
49 | // public KMLLink getLink() // TODO
50 | // {
51 | // if (!this.linkFetched)
52 | // {
53 | // this.link = (KMLLink) this.getField("Link");
54 | // this.linkFetched = true;
55 | // }
56 | // return this.link;
57 | // }
58 |
59 | public KMLResourceMap getResourceMap()
60 | {
61 | return (KMLResourceMap) this.getField("ResourceMap");
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/Message.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.event;
6 |
7 | /**
8 | * General purpose message event.
9 | *
10 | * @author pabercrombie
11 | * @version $Id: Message.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class Message extends WWEvent {
14 | /**
15 | *
16 | */
17 | private static final long serialVersionUID = -2961985628983809212L;
18 | /** Message name. */
19 | protected String name;
20 | /** Time at which the message was sent. */
21 | protected long when;
22 |
23 | /**
24 | * Create a message. The message will be timestamped with the current system time.
25 | *
26 | * @param name
27 | * The name of the message.
28 | * @param source
29 | * The object that generated the message.
30 | */
31 | public Message(String name, Object source) {
32 | this(name, source, System.currentTimeMillis());
33 | }
34 |
35 | /**
36 | * Create a message, with a timestamp.
37 | *
38 | * @param name
39 | * The name of the message.
40 | * @param source
41 | * The object that generated the message.
42 | * @param when
43 | * The timestamp to apply to the message.
44 | */
45 | public Message(String name, Object source, long when) {
46 | super(source);
47 | this.name = name;
48 | this.when = when;
49 | }
50 |
51 | /**
52 | * Indicates the message name.
53 | *
54 | * @return The message name.
55 | */
56 | public String getName() {
57 | return this.name;
58 | }
59 |
60 | /**
61 | * Indicates the time at which the message was sent.
62 | *
63 | * @return Time, in milliseconds since the Epoch, at which the message was sent.
64 | */
65 | public long getWhen() {
66 | return this.when;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/ColorBlock4x4.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util.dds;
8 |
9 | /**
10 | * Uncompressed 4x4 color block.
11 | *
12 | * @author dcollins
13 | * @version $Id: ColorBlock4x4.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public class ColorBlock4x4
16 | {
17 | /**
18 | * The 4x4 color values stored as an array of length 16. This property is publicly exposed, so its contents are
19 | * mutable. It is declared final to prevent a caller form reassigning the array reference.
20 | */
21 | public final Color32[] color = new Color32[16];
22 |
23 | /**
24 | * Creates a 4x4 color block with the color values initialized to non-null references.
25 | * Initially all color values are set to 0.
26 | */
27 | public ColorBlock4x4()
28 | {
29 | for (int i = 0; i < 16; i++)
30 | {
31 | this.color[i] = new Color32();
32 | }
33 | }
34 |
35 | /**
36 | * Returns the color value at the specified index.
37 | *
38 | * @param index the color index to return.
39 | * @return color value at the index.
40 | */
41 | public Color32 getColor(int index)
42 | {
43 | return this.color[index];
44 | }
45 |
46 | /**
47 | * Sets the color value at the specified index.
48 | *
49 | * @param index the color index to set.
50 | * @param color new color value at the specified index.
51 | */
52 | public void setColor(int index, Color32 color)
53 | {
54 | this.color[index] = color;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/ColorBlockExtractor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util.dds;
8 |
9 | /**
10 | * The ColorBlockExtrator interface will copy a 4x4 block of pixel data from an image source. Gaining
11 | * access to an image source is left to the implementation. This interface makes access to different kinds of image
12 | * sources transparent by allowing the caller to request the location to extract, and a destination to place the result.
13 | *
14 | * @see ColorBlock4x4
15 | *
16 | * @author dcollins
17 | * @version $Id: ColorBlockExtractor.java 733 2012-09-02 17:15:09Z dcollins $
18 | */
19 | public interface ColorBlockExtractor
20 | {
21 | /**
22 | * Extracts a 4x4 block of pixel data at the specified coordinate (x, y), and places the data in the
23 | * specified colorBlock. If the coordinate (x, y) with the image, but the entire 4x4
24 | * block is not, this will either truncate the block to fit the image, or copy nearby pixels to fill the block.
25 | *
26 | * @param attributes the DXT compression attributes which may affect how colors are accessed.
27 | * @param x horizontal coordinate origin to extract pixel data from.
28 | * @param y vertical coordinate origin to extract pixel data from.
29 | * @param colorBlock 4x4 block of pixel data that will receive the data.
30 | *
31 | * @throws IllegalArgumentException if either attributes or colorBlock is null.
32 | */
33 | void extractColorBlock4x4(DXTCompressionAttributes attributes, int x, int y, ColorBlock4x4 colorBlock);
34 | }
35 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/terrain/SectorGeometry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.terrain;
7 |
8 | import android.graphics.Point;
9 | import gov.nasa.worldwind.geom.*;
10 | import gov.nasa.worldwind.render.DrawContext;
11 |
12 | /**
13 | * @author dcollins
14 | * @version $Id: SectorGeometry.java 802 2012-09-26 01:37:27Z dcollins $
15 | */
16 | public interface SectorGeometry
17 | {
18 | Sector getSector();
19 |
20 | Extent getExtent();
21 |
22 | /**
23 | * Computes the point in model coordinates on the geometry's surface at the specified location.
24 | *
25 | * @param latitude the latitude of the point to compute.
26 | * @param longitude the longitude of the point to compute.
27 | * @param result contains the model coordinate point in meters, relative to an origin of (0, 0, 0) after this
28 | * method exits. The result parameter is left unchanged if this method returns false.
29 | *
30 | * @return true if the specified location is within this geometry's sector and its internal geometry
31 | * exists, otherwise false.
32 | *
33 | * @throws IllegalArgumentException if any of the latitude, longitude or result are null.
34 | */
35 | boolean getSurfacePoint(Angle latitude, Angle longitude, Vec4 result);
36 |
37 | void render(DrawContext dc);
38 |
39 | void renderWireframe(DrawContext dc);
40 |
41 | void renderOutline(DrawContext dc);
42 |
43 | void beginRendering(DrawContext dc);
44 |
45 | void endRendering(DrawContext dc);
46 |
47 | void pick(DrawContext dc, Point pickPoint);
48 | }
49 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLVec2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 | import gov.nasa.worldwind.util.xml.*;
9 |
10 | /**
11 | * Represents the KML Vec2 element and provides access to its contents.
12 | *
13 | * @author tag
14 | * @version $Id: KMLVec2.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public class KMLVec2 extends KMLAbstractObject
17 | {
18 | protected Double x;
19 | protected Double y;
20 |
21 | /**
22 | * Construct an instance.
23 | *
24 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
25 | */
26 | public KMLVec2(String namespaceURI)
27 | {
28 | super(namespaceURI);
29 | }
30 |
31 | @Override
32 | protected void doAddEventAttribute(String key, Object value, XMLEventParserContext ctx, XMLEvent event, Object... args)
33 | {
34 | if ("x".equals(key))
35 | this.setX(WWUtil.makeDouble((String) value));
36 | else if ("y".equals(key))
37 | this.setY(WWUtil.makeDouble((String) value));
38 | else
39 | super.doAddEventAttribute(key, value, ctx, event, args);
40 | }
41 |
42 | protected void setX(Double o)
43 | {
44 | this.x = o;
45 | }
46 |
47 | public Double getX()
48 | {
49 | return this.x;
50 | }
51 |
52 | protected void setY(Double o)
53 | {
54 | this.y = o;
55 | }
56 |
57 | public Double getY()
58 | {
59 | return this.y;
60 | }
61 |
62 | public String getXunits()
63 | {
64 | return (String) this.getField("xunits");
65 | }
66 |
67 | public String getYunits()
68 | {
69 | return (String) this.getField("yunits");
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/XMLEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.avlist.AVList;
8 | import gov.nasa.worldwind.avlist.AVListImpl;
9 | import javax.xml.namespace.QName;
10 | import org.xmlpull.v1.XmlPullParser;
11 |
12 | /**
13 | * Edited By: Nicola Dorigatti, Trilogis (Fixed a bug that was leaving unclosed tags to be unrecognized)
14 | *
15 | * @author tag
16 | * @version $Id: XMLEvent.java 771 2012-09-14 19:30:10Z tgaskins $
17 | */
18 | public class XMLEvent {
19 | protected int eventType;
20 | protected XmlPullParser xpp;
21 |
22 | public XMLEvent(int eventType, XmlPullParser pullParser) {
23 | this.eventType = eventType;
24 | this.xpp = pullParser;
25 | }
26 |
27 | public int getLineNumber() {
28 | return this.xpp.getLineNumber();
29 | }
30 |
31 | public boolean isStartElement() {
32 | return this.eventType == XmlPullParser.START_TAG;
33 | }
34 |
35 | public boolean isEndElement() {
36 | return this.eventType == XmlPullParser.END_TAG;
37 | }
38 |
39 | public boolean isCharacters() {
40 | return this.eventType == XmlPullParser.TEXT;
41 | }
42 |
43 | public boolean isWhiteSpace() {
44 | return this.isCharacters() && (this.getData() == null || this.getData().trim().length() == 0);
45 | }
46 |
47 | public QName getName() {
48 | return new QName(this.xpp.getNamespace(), xpp.getName());
49 | }
50 |
51 | public String getData() {
52 | return this.xpp.getText();
53 | }
54 |
55 | public AVList getAttributes() {
56 | if (this.xpp.getAttributeCount() == 0) return null;
57 |
58 | AVListImpl avList = new AVListImpl();
59 |
60 | for (int i = 0; i < this.xpp.getAttributeCount(); i++) {
61 | avList.setValue(this.xpp.getAttributeName(i), this.xpp.getAttributeValue(i));
62 | }
63 |
64 | return avList;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/ogc/wms/WMSAuthorityURL.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.ogc.wms;
8 |
9 | import gov.nasa.worldwind.avlist.AVList;
10 | import gov.nasa.worldwind.util.xml.XMLEvent;
11 | import gov.nasa.worldwind.util.xml.XMLEventParserContext;
12 | import java.util.Map.Entry;
13 | import java.util.Set;
14 |
15 | /**
16 | * Parses a WMS AuthorityURL element.
17 | *
18 | * @author Nicola Dorigatti Trilogis SRL
19 | * @version $Id: WMSAuthorityURL.java 1 2011-07-16 23:22:47Z dcollins $
20 | */
21 | public class WMSAuthorityURL extends WMSLayerInfoURL {
22 | protected String authority;
23 |
24 | public WMSAuthorityURL(String namespaceURI) {
25 | super(namespaceURI);
26 | }
27 |
28 | protected void doParseEventAttributes(XMLEventParserContext ctx, XMLEvent event, Object... args) {
29 | AVList attrAvList = event.getAttributes();
30 | if (null == attrAvList || attrAvList.getEntries().isEmpty()) return;
31 | // Iterator iter = event.asStartElement().getAttributes();
32 | // if (iter == null) return;
33 | Set> avListEntries = attrAvList.getEntries();
34 | for (Entry entry : avListEntries) {
35 | if (entry.getKey().equals("authority") && entry.getValue() != null) this.setAuthority(entry.getValue().toString());
36 |
37 | }
38 | // while (iter.hasNext()) {
39 | // Attribute attr = (Attribute) iter.next();
40 | // if (attr.getName().getLocalPart().equals("authority") && attr.getValue() != null) this.setAuthority(attr.getValue());
41 | // }
42 | }
43 |
44 | public String getAuthority() {
45 | return authority;
46 | }
47 |
48 | protected void setAuthority(String authority) {
49 | this.authority = authority;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLAbstractLatLonBoxType.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2001, 2012 United States Government as represented by
2 | the Administrator of the National Aeronautics and Space Administration.
3 | All Rights Reserved.
4 | */
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | /**
11 | * Represents the KML LatLonBox element and provides access to its contents.
12 | *
13 | * @author tag
14 | * @version $Id: KMLAbstractLatLonBoxType.java 822 2012-09-28 03:16:15Z dcollins $
15 | */
16 | public abstract class KMLAbstractLatLonBoxType extends KMLAbstractObject
17 | {
18 | /**
19 | * Construct an instance.
20 | *
21 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
22 | */
23 | protected KMLAbstractLatLonBoxType(String namespaceURI)
24 | {
25 | super(namespaceURI);
26 | }
27 |
28 | public Double getNorth()
29 | {
30 | return (Double) this.getField("north");
31 | }
32 |
33 | public Double getSouth()
34 | {
35 | return (Double) this.getField("south");
36 | }
37 |
38 | public Double getEast()
39 | {
40 | return (Double) this.getField("east");
41 | }
42 |
43 | public Double getWest()
44 | {
45 | return (Double) this.getField("west");
46 | }
47 |
48 | @Override
49 | public void applyChange(KMLAbstractObject sourceValues)
50 | {
51 | if (!(sourceValues instanceof KMLAbstractLatLonBoxType))
52 | {
53 | String msg = Logging.getMessage("nullValue.SourceIsNull");
54 | Logging.error(msg);
55 | throw new IllegalArgumentException(msg);
56 | }
57 |
58 | super.applyChange(sourceValues);
59 |
60 | this.onChange(new Message(KMLAbstractObject.MSG_BOX_CHANGED, this));
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLStyleUrl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.event.Message;
8 | import gov.nasa.worldwind.util.*;
9 |
10 | /**
11 | * @author tag
12 | * @version $Id: KMLStyleUrl.java 771 2012-09-14 19:30:10Z tgaskins $
13 | */
14 | public class KMLStyleUrl extends KMLAbstractObject
15 | {
16 | /**
17 | * Construct an instance.
18 | *
19 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
20 | */
21 | public KMLStyleUrl(String namespaceURI)
22 | {
23 | super(namespaceURI);
24 | }
25 |
26 | /**
27 | * Resolves a styleUrl to a style selector, which is either a style or style map.
28 | *
29 | * If the url refers to a remote resource and the resource has not been retrieved and cached locally, this method
30 | * returns null and initiates a retrieval.
31 | *
32 | * @return the style or style map referred to by the style URL.
33 | */
34 | public KMLAbstractStyleSelector resolveStyleUrl()
35 | {
36 | if (WWUtil.isEmpty(this.getCharacters()))
37 | return null;
38 |
39 | Object o = this.getRoot().resolveReference(this.getCharacters());
40 | return o instanceof KMLAbstractStyleSelector ? (KMLAbstractStyleSelector) o : null;
41 | }
42 |
43 | @Override
44 | public void applyChange(KMLAbstractObject sourceValues)
45 | {
46 | if (!(sourceValues instanceof KMLStyleUrl))
47 | {
48 | String message = Logging.getMessage("KML.InvalidElementType", sourceValues.getClass().getName());
49 | Logging.warning(message);
50 | throw new IllegalArgumentException(message);
51 | }
52 |
53 | super.applyChange(sourceValues);
54 |
55 | this.onChange(new Message(KMLAbstractObject.MSG_STYLE_CHANGED, this));
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/FakeXMLEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.avlist.AVList;
8 | import javax.xml.namespace.QName;
9 |
10 | /**
11 | * Edited By: Nicola Dorigatti, Trilogis
12 | *
13 | * @author tag
14 | * @version $Id: XMLEvent.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public class FakeXMLEvent extends XMLEvent {
17 | private QName qname;
18 |
19 | public FakeXMLEvent(QName qname) {
20 | super(0, null);
21 | this.qname = qname;
22 | }
23 |
24 | public FakeXMLEvent(String namespace, String localPart) {
25 | super(0, null);
26 | this.qname = new QName(namespace, localPart);
27 | }
28 |
29 | @Override
30 | public int getLineNumber() {
31 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
32 | }
33 |
34 | @Override
35 | public boolean isStartElement() {
36 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
37 | }
38 |
39 | @Override
40 | public boolean isEndElement() {
41 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
42 | }
43 |
44 | @Override
45 | public boolean isCharacters() {
46 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
47 | }
48 |
49 | @Override
50 | public boolean isWhiteSpace() {
51 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
52 | }
53 |
54 | @Override
55 | public QName getName() {
56 | return this.qname;
57 | }
58 |
59 | @Override
60 | public String getData() {
61 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
62 | }
63 |
64 | @Override
65 | public AVList getAttributes() {
66 | throw new IllegalArgumentException("This is a fake element, only get Name method is allowed!");
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/WWObjectImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind;
7 |
8 | import gov.nasa.worldwind.avlist.AVListImpl;
9 | import gov.nasa.worldwind.event.Message;
10 | import gov.nasa.worldwind.util.Logging;
11 |
12 | import java.beans.PropertyChangeEvent;
13 |
14 | /**
15 | * Implements WWObject functionality. Meant to be either subclassed or aggregated by classes implementing
16 | * WWObject.
17 | *
18 | * @author dcollins
19 | * @version $Id: WWObjectImpl.java 771 2012-09-14 19:30:10Z tgaskins $
20 | */
21 | public class WWObjectImpl extends AVListImpl implements WWObject
22 | {
23 | /** Constructs a new WWObjectImpl. */
24 | public WWObjectImpl()
25 | {
26 | }
27 |
28 | public WWObjectImpl(Object source)
29 | {
30 | super(source);
31 | }
32 |
33 | /**
34 | * The property change listener for this instance. Receives property change notifications that this
35 | * instance has registered with other property change notifiers.
36 | *
37 | * @param event the property change event.
38 | *
39 | * @throws IllegalArgumentException if propertyChangeEvent is null
40 | */
41 | public void propertyChange(PropertyChangeEvent event)
42 | {
43 | if (event == null)
44 | {
45 | String msg = Logging.getMessage("nullValue.EventIsNull");
46 | Logging.error(msg);
47 | throw new IllegalArgumentException(msg);
48 | }
49 |
50 | // Notify all *my* listeners of the change that I caught
51 | super.firePropertyChange(event);
52 | }
53 |
54 | /** Empty implementation of MessageListener. */
55 | public void onMessage(Message message)
56 | {
57 | // Empty implementation
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/AlphaBlockDXT3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util.dds;
8 |
9 | /**
10 | * AlphaBlockDXT3 is a data structure representing the compressed alpha values in a single DXT2/DXT3 block.
11 | * The DXT2/DXT3 alpha block contains alpha values for 4x4 pixels, each quantized to fit into 4 bits. The alpha values
12 | * are tightly packed into 64 bits in the DXT file as follows, where the value aN represents the Nth alpha value in
13 | * hexadecimal notation:
14 | *
15 | * | 63-56 | 55-48 | 47-40 | 39-32 | 31-24 | 23-16 | 15-8 | 7-0 |
16 | * | aFaE | aDaC | aBaA | a9a8 | a7a6 | a5a4 | a3a2 | a1a0 |
17 | *
18 | * @author dcollins
19 | * @version $Id: AlphaBlockDXT3.java 733 2012-09-02 17:15:09Z dcollins $
20 | */
21 | public class AlphaBlockDXT3
22 | {
23 | /**
24 | * The 4x4 block of 4 bit alpha values stored as a 64 bit long number.
25 | */
26 | public long alphaValueMask;
27 |
28 | /**
29 | * Creates a new DXT2/DXT3 alpha block with all alpha values set to 0.
30 | */
31 | public AlphaBlockDXT3()
32 | {
33 | }
34 |
35 | public AlphaBlockDXT3(long alphaValueMask)
36 | {
37 | this.alphaValueMask = alphaValueMask;
38 | }
39 |
40 | /**
41 | * Returns the 4x4 block of 4 bit alpha values as a 64 bit number.
42 | *
43 | * @return 4x4 block of 4 bit alpha values.
44 | */
45 | public long getAlphaValueMask()
46 | {
47 | return this.alphaValueMask;
48 | }
49 |
50 | /**
51 | * Sets the 4x4 block of 4 bit alpha values as a 64 bit number.
52 | *
53 | * @param valueMask 4x4 block of 4 bit alpha values.
54 | */
55 | public void setAlphaValueMask(long valueMask)
56 | {
57 | this.alphaValueMask = valueMask;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/HTTPRetriever.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.retrieve;
8 |
9 | import gov.nasa.worldwind.util.Logging;
10 |
11 | import java.net.*;
12 | import java.nio.ByteBuffer;
13 |
14 | /**
15 | * @author Tom Gaskins
16 | * @version $Id: HTTPRetriever.java 733 2012-09-02 17:15:09Z dcollins $
17 | */
18 | public class HTTPRetriever extends URLRetriever
19 | {
20 | private int responseCode;
21 | private String responseMessage;
22 |
23 | public HTTPRetriever(URL url, RetrievalPostProcessor postProcessor)
24 | {
25 | super(url, postProcessor);
26 | }
27 |
28 | public int getResponseCode()
29 | {
30 | return this.responseCode;
31 | }
32 |
33 | public String getResponseMessage()
34 | {
35 | return this.responseMessage;
36 | }
37 |
38 | @Override
39 | protected ByteBuffer doRead(URLConnection connection) throws Exception
40 | {
41 | if (connection == null)
42 | {
43 | String msg = Logging.getMessage("nullValue.ConnectionIsNull");
44 | Logging.error(msg);
45 | throw new IllegalArgumentException(msg);
46 | }
47 |
48 | HttpURLConnection htpc = (HttpURLConnection) connection;
49 | this.responseCode = htpc.getResponseCode();
50 | this.responseMessage = htpc.getResponseMessage();
51 | String contentType = connection.getContentType();
52 |
53 | String msg = Logging.getMessage("HTTPRetriever.ResponseInfo", this.responseCode, connection.getContentLength(),
54 | contentType != null ? contentType : "content type not returned", connection.getURL());
55 | Logging.verbose(msg);
56 |
57 | if (this.responseCode == HttpURLConnection.HTTP_OK)
58 | return super.doRead(connection);
59 |
60 | return null;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/config/Earth/LandsatI3WMSLayer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | i-cubed Landsat
5 |
6 | http://data.worldwind.arc.nasa.gov/wms
7 | http://data.worldwind.arc.nasa.gov/wms
8 | esat
9 |
10 |
11 | 26 03 2009 00:00:00 GMT
12 | Earth/NASA LandSat I3 WMS
13 | image/png
14 |
15 | image/png
16 | image/dds
17 |
18 | .png
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/shaders/TiledTessellatorPick.vert:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | /*
8 | * OpenGL ES Shading Language v1.00 vertex shader for TiledTessellator picking. Transforms surface geometry vertices
9 | * from model coordinates to eye coordinates, and specifies either a constant or a per-vertex color that can be used to
10 | * draw a terrain tile in a unique pick color, or draw each of its triangles in a unique pick color.
11 | *
12 | * version $Id: TiledTessellatorPick.vert 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 |
15 | /*
16 | * Input vertex attribute defining the surface vertex point in model coordinates. This attribute is specified in
17 | * TODO.
18 | */
19 | attribute vec4 vertexPoint;
20 | /*
21 | * Input vertex attribute defining the unique RGB color of each primitive. This attribute is specified in TODO. Although
22 | * this attribute can vary per-vertex, it is assumed that either (a) this is a constant value for the entire primitive,
23 | * or (b) the same color is assigned to each triangle vertex.
24 | */
25 | attribute vec4 vertexColor;
26 | /*
27 | * Input uniform matrix defining the current modelview-projection transform matrix. Maps model coordinates to eye
28 | * coordinates.
29 | */
30 | uniform mat4 mvpMatrix;
31 |
32 | /*
33 | * Output variable vector to TiledTessellatorPick.frag defining the color for each primitive (triangle). This is
34 | * specified for each vertex and is interpolated for each rasterized fragment of each primitive.
35 | */
36 | varying vec4 primColor;
37 |
38 | /*
39 | * OpenGL ES vertex shader entry point. Called for each vertex processed when this shader's program is bound.
40 | */
41 | void main()
42 | {
43 | /* Transform the surface vertex point from model coordinates to eye coordinates. */
44 | gl_Position = mvpMatrix * vertexPoint;
45 |
46 | /* Assign the varying fragment color to the current vertex's color. */
47 | primColor = vertexColor;
48 | }
49 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/ogc/OGCConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.ogc;
8 |
9 | /**
10 | * Defines constants used in the OGC package and sub-packages.
11 | *
12 | * @author Nicola Dorigatti Trilogis SRL
13 | * @version $Id: OGCConstants.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public class OGCConstants {
16 |
17 | /**
18 | * The name of the OGC Web Service GetCapabilities operation. The GetCapabilities operation returns metadata about the operations
19 | * and data provided by an OGC Web Service. GetCapabilities is valid value for the request parameter. Used by all versions of all
20 | * OGC web services.
21 | */
22 | final String GET_CAPABILITIES = "GetCapabilities";
23 | /**
24 | * The name of the OGC Web Service request parameter. The associated value must be the name of an
25 | * operation to execute (for example, GetCapabilities). Used by all versions of all OGC web services.
26 | */
27 | final String REQUEST = "request";
28 | /**
29 | * The name of the OGC Web Service service parameter. The associated value must be the abbreviated OGC
30 | * Web Service name (for example, WMS). Used by all versions of all OGC web services.
31 | */
32 | final String SERVICE = "service";
33 | /**
34 | * The name of the OGC Web Service version parameter. The associated value must be the version of the
35 | * OGC Web Service protocol to use. The version must be formatted as x.y.z, where x, y and z are integers in the
36 | * range 0-99. Used by all versions of all OGC web services.
37 | */
38 | final String VERSION = "version";
39 |
40 | public static final String WMS_SERVICE_NAME = "OGC:WMS";
41 | public static final String WMS_NAMESPACE_URI = "http://www.opengis.net/wms";
42 | }
43 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/ogc/wms/WMSLayerIdentifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.ogc.wms;
8 |
9 | import gov.nasa.worldwind.avlist.AVList;
10 | import gov.nasa.worldwind.util.xml.AbstractXMLEventParser;
11 | import gov.nasa.worldwind.util.xml.XMLEvent;
12 | import gov.nasa.worldwind.util.xml.XMLEventParserContext;
13 | import java.util.Map.Entry;
14 | import java.util.Set;
15 |
16 | /**
17 | * Parses a WMS layer Identifier element.
18 | *
19 | * @author Nicola Dorigatti Trilogis SRL
20 | * @version $Id: WMSLayerIdentifier.java 1 2011-07-16 23:22:47Z dcollins $
21 | */
22 | public class WMSLayerIdentifier extends AbstractXMLEventParser {
23 | protected String identifier;
24 | protected String authority;
25 |
26 | public WMSLayerIdentifier(String namespaceURI) {
27 | super(namespaceURI);
28 | }
29 |
30 | @Override
31 | protected void doParseEventAttributes(XMLEventParserContext ctx, XMLEvent event, Object... args) {
32 | AVList attrAvList = event.getAttributes();
33 | if (null == attrAvList || attrAvList.getEntries().isEmpty()) return;
34 | // Iterator iter = event.asStartElement().getAttributes();
35 | // if (iter == null) return;
36 | Set> avListEntries = attrAvList.getEntries();
37 | for (Entry entry : avListEntries) {
38 | if (entry.getKey().equals("authority") && entry.getValue() != null) this.setAuthority(entry.getValue().toString());
39 |
40 | }
41 | // while (iter.hasNext()) {
42 | // Attribute attr = (Attribute) iter.next();
43 | // if (attr.getName().getLocalPart().equals("authority") && attr.getValue() != null) this.setAuthority(attr.getValue());
44 | // }
45 | }
46 |
47 | public String getIdentifier() {
48 | return this.getCharacters();
49 | }
50 |
51 | public String getAuthority() {
52 | return authority;
53 | }
54 |
55 | protected void setAuthority(String authority) {
56 | this.authority = authority;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/Retriever.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.retrieve;
8 |
9 | import gov.nasa.worldwind.WWObject;
10 |
11 | import java.nio.ByteBuffer;
12 |
13 | /**
14 | * @author Tom Gaskins
15 | * @version $Id: Retriever.java 733 2012-09-02 17:15:09Z dcollins $
16 | */
17 | public interface Retriever extends WWObject, java.util.concurrent.Callable
18 | {
19 | public final String RETRIEVER_STATE_NOT_STARTED = "gov.nasa.worldwind.RetrieverStatusNotStarted";
20 | public final String RETRIEVER_STATE_STARTED = "gov.nasa.worldwind.RetrieverStatusStarted";
21 | public final String RETRIEVER_STATE_CONNECTING = "gov.nasa.worldwind.RetrieverStatusConnecting";
22 | public final String RETRIEVER_STATE_READING = "gov.nasa.worldwind.RetrieverStatusReading";
23 | public final String RETRIEVER_STATE_INTERRUPTED = "gov.nasa.worldwind.RetrieverStatusInterrupted";
24 | public final String RETRIEVER_STATE_ERROR = "gov.nasa.worldwind.RetrieverStatusError";
25 | public final String RETRIEVER_STATE_SUCCESSFUL = "gov.nasa.worldwind.RetrieverStatusSuccessful";
26 |
27 | ByteBuffer getBuffer();
28 |
29 | int getContentLength();
30 |
31 | int getContentLengthRead();
32 |
33 | String getName();
34 |
35 | String getState();
36 |
37 | String getContentType();
38 |
39 | long getSubmitTime();
40 |
41 | void setSubmitTime(long submitTime);
42 |
43 | long getBeginTime();
44 |
45 | void setBeginTime(long beginTime);
46 |
47 | long getEndTime();
48 |
49 | void setEndTime(long endTime);
50 |
51 | int getConnectTimeout();
52 |
53 | int getReadTimeout();
54 |
55 | void setReadTimeout(int readTimeout);
56 |
57 | void setConnectTimeout(int connectTimeout);
58 |
59 | int getStaleRequestLimit();
60 |
61 | void setStaleRequestLimit(int staleRequestLimit);
62 | }
63 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLChange.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 | import gov.nasa.worldwind.util.xml.*;
9 |
10 | import java.util.*;
11 |
12 | /**
13 | * Represents the KML Change element and provides access to its contents.
14 | *
15 | * @author tag
16 | * @version $Id: KMLChange.java 771 2012-09-14 19:30:10Z tgaskins $
17 | */
18 | public class KMLChange extends AbstractXMLEventParser implements KMLUpdateOperation
19 | {
20 | protected List objects = new ArrayList();
21 |
22 | /**
23 | * Construct an instance.
24 | *
25 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
26 | */
27 | public KMLChange(String namespaceURI)
28 | {
29 | super(namespaceURI);
30 | }
31 |
32 | @Override
33 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
34 | {
35 | if (o instanceof KMLAbstractObject)
36 | this.addObject((KMLAbstractObject) o);
37 | else
38 | super.doAddEventContent(o, ctx, event, args);
39 | }
40 |
41 | protected void addObject(KMLAbstractObject o)
42 | {
43 | this.objects.add(o);
44 | }
45 |
46 | public List getObjects()
47 | {
48 | return this.objects;
49 | }
50 |
51 | public void applyOperation(KMLRoot targetRoot)
52 | {
53 | for (KMLAbstractObject sourceValues : this.objects)
54 | {
55 | String targetId = sourceValues.getTargetId();
56 | if (WWUtil.isEmpty(targetId))
57 | continue;
58 |
59 | Object o = targetRoot.getItemByID(targetId);
60 | if (o == null || !(o instanceof KMLAbstractObject))
61 | continue;
62 |
63 | KMLAbstractObject objectToChange = (KMLAbstractObject) o;
64 |
65 | objectToChange.applyChange(sourceValues);
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/DDSConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.util.dds;
7 |
8 | /**
9 | * Documentation on Direct3D format constants is available at
10 | * http://msdn.microsoft.com/en-us/library/bb172558(VS.85).aspx.
11 | *
12 | * @author dcollins
13 | * @version $Id: DDSConstants.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 | public class DDSConstants
16 | {
17 | public static final int DDS_SIGNATURE_SIZE = 4;
18 | public static final int DDS_HEADER_SIZE = 124;
19 | public static final int DDS_PIXEL_FORMAT_SIZE = 32;
20 | public static final int DDS_PIXEL_FORMAT_OFFSET = 76;
21 |
22 | public static final int DDS_DATA_OFFSET = DDS_SIGNATURE_SIZE + DDS_HEADER_SIZE;
23 |
24 |
25 | public static final int DDPF_FOURCC = 0x0004;
26 | public static final int DDSCAPS_TEXTURE = 0x1000;
27 | public static final int DDSD_CAPS = 0x0001;
28 | public static final int DDSD_HEIGHT = 0x0002;
29 | public static final int DDSD_WIDTH = 0x0004;
30 | public static final int DDSD_PIXELFORMAT = 0x1000;
31 | public static final int DDSD_MIPMAPCOUNT = 0x20000;
32 | public static final int DDSD_LINEARSIZE = 0x80000;
33 |
34 | public static final int D3DFMT_DXT1 = makeFourCC('D', 'X', 'T', '1');
35 | public static final int D3DFMT_DXT2 = makeFourCC('D', 'X', 'T', '2');
36 | public static final int D3DFMT_DXT3 = makeFourCC('D', 'X', 'T', '3');
37 | public static final int D3DFMT_DXT4 = makeFourCC('D', 'X', 'T', '4');
38 | public static final int D3DFMT_DXT5 = makeFourCC('D', 'X', 'T', '5');
39 |
40 | // A DWORD (magic number) containing the four character code value 'DDS ' (0x20534444)
41 | public static final int MAGIC = makeFourCC('D', 'D', 'S', ' ');
42 |
43 | public static int makeFourCC(char ch0, char ch1, char ch2, char ch3)
44 | {
45 | return (((int) ch0))
46 | | (((int) ch1) << 8)
47 | | (((int) ch2) << 16)
48 | | (((int) ch3) << 24);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLNetworkLinkControl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.xml.*;
8 |
9 | /**
10 | * Represents the KML NetworkLinkControl element and provides access to its contents.
11 | *
12 | * @author tag
13 | * @version $Id: KMLNetworkLinkControl.java 771 2012-09-14 19:30:10Z tgaskins $
14 | */
15 | public class KMLNetworkLinkControl extends AbstractXMLEventParser
16 | {
17 | public KMLNetworkLinkControl(String namespaceURI)
18 | {
19 | super(namespaceURI);
20 | }
21 |
22 | @Override
23 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
24 | {
25 | if (o instanceof KMLAbstractView)
26 | this.setField("AbstractView", o);
27 | else
28 | super.doAddEventContent(o, ctx, event, args);
29 | }
30 |
31 | public Double getMinRefreshPeriod()
32 | {
33 | return (Double) this.getField("minRefreshPeriod");
34 | }
35 |
36 | public Double getMaxSessionLength()
37 | {
38 | return (Double) this.getField("maxSessionLength");
39 | }
40 |
41 | public String getCookie()
42 | {
43 | return (String) this.getField("cookie");
44 | }
45 |
46 | public String getMessage()
47 | {
48 | return (String) this.getField("message");
49 | }
50 |
51 | public String getLinkName()
52 | {
53 | return (String) this.getField("linkName");
54 | }
55 |
56 | public String getLinkDescription()
57 | {
58 | return (String) this.getField("linkDescription");
59 | }
60 |
61 | public KMLSnippet getLinkSnippet()
62 | {
63 | return (KMLSnippet) this.getField("linkSnippet");
64 | }
65 |
66 | public String getExpires()
67 | {
68 | return (String) this.getField("expires");
69 | }
70 |
71 | public KMLUpdate getUpdate()
72 | {
73 | return (KMLUpdate) this.getField("Update");
74 | }
75 |
76 | public KMLAbstractView getView()
77 | {
78 | return (KMLAbstractView) this.getField("AbstractView");
79 | }
80 | }
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/event/WWEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.event;
7 |
8 | import java.util.EventObject;
9 |
10 | /**
11 | * WWEvent is the base class which all World Wind event objects derive from. It extends Java's base {@link java.util.EventObject} by adding the capability to
12 | * consume the event by calling {@link #consume()}. Consuming a
13 | * WWEvent prevents is from being processed in the default manner by the source that originated the event. If the event
14 | * cannot be consumed, calling {@code consume()} has no effect, though {@link #isConsumed()} returns whether or not {@code consume()} has been called.
15 | *
16 | * @author dcollins
17 | * @version $Id: WWEvent.java 733 2012-09-02 17:15:09Z dcollins $
18 | */
19 | public class WWEvent extends EventObject {
20 | /**
21 | *
22 | */
23 | private static final long serialVersionUID = -393214983244700821L;
24 | /** Denotes whether or not the event has been consumed. Initially {@code false}. */
25 | protected boolean consumed;
26 |
27 | /**
28 | * Creates a new WWEvent with the object that originated the event.
29 | *
30 | * @param source
31 | * the object that originated the event.
32 | * @throws IllegalArgumentException
33 | * if the source is {@code null}.
34 | */
35 | public WWEvent(Object source) {
36 | super(source);
37 | }
38 |
39 | /**
40 | * Returns whether or not the event has been consumed.
41 | *
42 | * Note: if the event cannot be consumed, this still returns {@code true} if {@link #consume()} has been called, though this has no effect.
43 | *
44 | * @return {@code true} if the event has been consumed, and {@code false} otherwise.
45 | */
46 | public boolean isConsumed() {
47 | return this.consumed;
48 | }
49 |
50 | /**
51 | * Consumes the event so it will not be processed in the default manner by the source which originated it. This does
52 | * nothing if the event cannot be consumed.
53 | */
54 | public void consume() {
55 | this.consumed = true;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/Progress.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.retrieve;
7 |
8 | /**
9 | * Stores progress information.
10 | *
11 | * @author Patrick Murris
12 | * @version $Id: Progress.java 733 2012-09-02 17:15:09Z dcollins $
13 | */
14 | public class Progress
15 | {
16 | private long startTime; // from System.currentTimeMillis
17 | private long lastUpdateTime; // from System.currentTimeMillis
18 | private long totalSize;
19 | private long currentSize;
20 | private long totalCount;
21 | private long currentCount;
22 |
23 | public Progress()
24 | {
25 | this.startTime = System.currentTimeMillis();
26 | }
27 |
28 | public long getStartTime()
29 | {
30 | return this.startTime;
31 | }
32 |
33 | public void setStartTime(long time)
34 | {
35 | this.startTime = time;
36 | }
37 |
38 | public long getLastUpdateTime()
39 | {
40 | return this.lastUpdateTime;
41 | }
42 |
43 | public void setLastUpdateTime(long time)
44 | {
45 | this.lastUpdateTime = time;
46 | }
47 |
48 | public long getTotalSize()
49 | {
50 | return this.totalSize;
51 | }
52 |
53 | public void setTotalSize(long size)
54 | {
55 | this.totalSize = size;
56 | }
57 |
58 | public long getCurrentSize()
59 | {
60 | return this.currentSize;
61 | }
62 |
63 | public void setCurrentSize(long size)
64 | {
65 | this.currentSize = size;
66 | }
67 |
68 | public long getTotalCount()
69 | {
70 | return this.totalCount;
71 | }
72 |
73 | public void setTotalCount(long count)
74 | {
75 | this.totalCount = count;
76 | }
77 |
78 | public long getCurrentCount()
79 | {
80 | return this.currentCount;
81 | }
82 |
83 | public void setCurrentCount(long count)
84 | {
85 | this.currentCount = count;
86 | }
87 | }
88 |
89 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/terrain/ZeroElevationModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.terrain;
8 |
9 | import gov.nasa.worldwind.geom.Angle;
10 | import gov.nasa.worldwind.geom.LatLon;
11 | import gov.nasa.worldwind.geom.Sector;
12 | import java.util.Arrays;
13 | import java.util.List;
14 |
15 | /**
16 | * An elevation model that always returns zero elevations.
17 | *
18 | * @author tag
19 | * @version $Id: ZeroElevationModel.java 733 2012-09-02 17:15:09Z dcollins $
20 | */
21 | public class ZeroElevationModel extends AbstractElevationModel {
22 | public double getMaxElevation() {
23 | return 1;
24 | }
25 |
26 | public double getMinElevation() {
27 | return 0;
28 | }
29 |
30 | public double[] getExtremeElevations(Angle latitude, Angle longitude) {
31 | return new double[] { 0, 1 };
32 | }
33 |
34 | public double[] getExtremeElevations(Sector sector) {
35 | return new double[] { 0, 1 };
36 | }
37 |
38 | public double getElevations(Sector sector, List extends LatLon> latlons, double targetResolution, double[] buffer) {
39 | for (int i = 0; i < latlons.size(); i++) {
40 | buffer[i] = 0;
41 | }
42 |
43 | return 0;
44 | }
45 |
46 | public double getElevations(Sector sector, int numLat, int numLon, double targetResolution, double[] buffer) {
47 | Arrays.fill(buffer, 0);
48 | return 1.6e-6; // corresponds to about 10 meters for Earth (radius approx. 6.4e6 meters);
49 | }
50 |
51 | public double getUnmappedElevations(Sector sector, List extends LatLon> latlons, double targetResolution, double[] buffer) {
52 | return this.getElevations(sector, latlons, targetResolution, buffer);
53 | }
54 |
55 | public int intersects(Sector sector) {
56 | return 0;
57 | }
58 |
59 | public boolean contains(Angle latitude, Angle longitude) {
60 | return true;
61 | }
62 |
63 | public double getBestResolution(Sector sector) {
64 | return 1.6e-6; // corresponds to about 10 meters for Earth (radius approx. 6.4e6 meters)
65 | }
66 |
67 | public double getUnmappedElevation(Angle latitude, Angle longitude) {
68 | return 0;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/retrieve/JarRetriever.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.retrieve;
8 |
9 | import gov.nasa.worldwind.util.Logging;
10 | import java.net.HttpURLConnection;
11 | import java.net.JarURLConnection;
12 | import java.net.URL;
13 | import java.net.URLConnection;
14 | import java.nio.ByteBuffer;
15 |
16 | /**
17 | * Retrieves resources identified by a jar url, which has the form jar:!/{entry}, as in:
18 | * jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class. See {@link java.net.JarURLConnection} for a full description
19 | * of jar URLs.
20 | *
21 | * @author tag
22 | * @version $Id: JarRetriever.java 733 2012-09-02 17:15:09Z dcollins $
23 | */
24 | public class JarRetriever extends URLRetriever {
25 | private int responseCode;
26 | private String responseMessage;
27 |
28 | public JarRetriever(URL url, RetrievalPostProcessor postProcessor) {
29 | super(url, postProcessor);
30 | }
31 |
32 | public int getResponseCode() {
33 | return this.responseCode;
34 | }
35 |
36 | public String getResponseMessage() {
37 | return this.responseMessage;
38 | }
39 |
40 | @Override
41 | protected ByteBuffer doRead(URLConnection connection) throws Exception {
42 | if (connection == null) {
43 | String msg = Logging.getMessage("nullValue.ConnectionIsNull");
44 | Logging.error(msg);
45 | throw new IllegalArgumentException(msg);
46 | }
47 |
48 | JarURLConnection htpc = (JarURLConnection) connection;
49 | this.responseCode = htpc.getContentLength() >= 0 ? HttpURLConnection.HTTP_OK : -1;
50 | this.responseMessage = this.responseCode >= 0 ? "OK" : "FAILED";
51 |
52 | String contentType = connection.getContentType();
53 |
54 | String msg = Logging.getMessage("HTTPRetriever.ResponseInfo", this.responseCode, connection.getContentLength(), contentType != null ? contentType
55 | : "content type not returned", connection.getURL());
56 | Logging.verbose(msg);
57 |
58 | if (this.responseCode == HttpURLConnection.HTTP_OK) // intentionally re-using HTTP constant
59 | return super.doRead(connection);
60 |
61 | return null;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLCreate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 | import gov.nasa.worldwind.util.xml.*;
9 |
10 | import java.util.*;
11 |
12 | /**
13 | * Represents the KML Create element and provides access to its contents.
14 | *
15 | * @author tag
16 | * @version $Id: KMLCreate.java 771 2012-09-14 19:30:10Z tgaskins $
17 | */
18 | public class KMLCreate extends AbstractXMLEventParser implements KMLUpdateOperation
19 | {
20 | protected List containers = new ArrayList();
21 |
22 | /**
23 | * Construct an instance.
24 | *
25 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
26 | */
27 | public KMLCreate(String namespaceURI)
28 | {
29 | super(namespaceURI);
30 | }
31 |
32 | @Override
33 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
34 | {
35 | if (o instanceof KMLAbstractContainer)
36 | this.addContainer((KMLAbstractContainer) o);
37 | else
38 | super.doAddEventContent(o, ctx, event, args);
39 | }
40 |
41 | protected void addContainer(KMLAbstractContainer o)
42 | {
43 | this.containers.add(o);
44 | }
45 |
46 | public List getContainers()
47 | {
48 | return this.containers;
49 | }
50 |
51 | public void applyOperation(KMLRoot targetRoot)
52 | {
53 | for (KMLAbstractContainer container : this.containers)
54 | {
55 | String targetId = container.getTargetId();
56 | if (WWUtil.isEmpty(targetId))
57 | continue;
58 |
59 | Object o = targetRoot.getItemByID(targetId);
60 | if (o == null || !(o instanceof KMLAbstractContainer))
61 | continue;
62 |
63 | KMLAbstractContainer receivingContainer = (KMLAbstractContainer) o;
64 |
65 | for (KMLAbstractFeature feature : container.getFeatures())
66 | {
67 | receivingContainer.addFeature(feature);
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLDelete.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 | import gov.nasa.worldwind.util.xml.*;
9 |
10 | import java.util.*;
11 |
12 | /**
13 | * Represents the KML Delete element and provides access to its contents.
14 | *
15 | * @author tag
16 | * @version $Id: KMLDelete.java 771 2012-09-14 19:30:10Z tgaskins $
17 | */
18 | public class KMLDelete extends AbstractXMLEventParser implements KMLUpdateOperation
19 | {
20 | protected List features = new ArrayList();
21 |
22 | /**
23 | * Construct an instance.
24 | *
25 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
26 | */
27 | public KMLDelete(String namespaceURI)
28 | {
29 | super(namespaceURI);
30 | }
31 |
32 | @Override
33 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
34 | {
35 | if (o instanceof KMLAbstractFeature)
36 | this.addFeature((KMLAbstractFeature) o);
37 | else
38 | super.doAddEventContent(o, ctx, event, args);
39 | }
40 |
41 | protected void addFeature(KMLAbstractFeature o)
42 | {
43 | this.features.add(o);
44 | }
45 |
46 | public List getFeatures()
47 | {
48 | return this.features;
49 | }
50 |
51 | public void applyOperation(KMLRoot targetRoot)
52 | {
53 | for (KMLAbstractFeature feature : this.features)
54 | {
55 | String targetId = feature.getTargetId();
56 | if (WWUtil.isEmpty(targetId))
57 | continue;
58 |
59 | Object o = targetRoot.getItemByID(targetId);
60 | if (o == null || !(o instanceof KMLAbstractFeature))
61 | continue;
62 |
63 | KMLAbstractFeature featureToDelete = (KMLAbstractFeature) o;
64 |
65 | Object p = featureToDelete.getParent();
66 | if (!(p instanceof KMLAbstractContainer))
67 | continue;
68 |
69 | ((KMLAbstractContainer) p).removeFeature(featureToDelete);
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/StringSetXMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | import gov.nasa.worldwind.util.WWUtil;
8 |
9 | import javax.xml.namespace.QName;
10 | import java.util.*;
11 |
12 | /**
13 | * @author tag
14 | * @version $Id: StringSetXMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public class StringSetXMLEventParser extends AbstractXMLEventParser implements Iterable
17 | {
18 | protected QName elementName;
19 | protected Set strings = new HashSet();
20 |
21 | public StringSetXMLEventParser()
22 | {
23 | }
24 |
25 | public StringSetXMLEventParser(String namespaceUri)
26 | {
27 | super(namespaceUri);
28 | }
29 |
30 | /**
31 | * Create a parser. All sub-elements of a specified name are parsed as strings and retained.
32 | *
33 | * @param namespaceURI the namespace URI to attach to this parser. May be null.
34 | * @param elementName the name of the sub-elements that contain the strings.
35 | */
36 | public StringSetXMLEventParser(String namespaceURI, QName elementName)
37 | {
38 | super(namespaceURI);
39 |
40 | this.elementName = elementName;
41 | }
42 |
43 | public Object parse(XMLEventParserContext ctx, XMLEvent listEvent, Object... args)
44 | throws XMLParserException
45 |
46 | {
47 | this.strings.clear();
48 |
49 | return super.parse(ctx, listEvent, args);
50 | }
51 |
52 | @Override
53 | protected void doParseEventContent(XMLEventParserContext ctx, XMLEvent event, Object... args)
54 | throws XMLParserException
55 | {
56 | if (ctx.isStartElement(event, this.elementName))
57 | {
58 | String s = ctx.getStringParser().parseString(ctx, event);
59 | if (!WWUtil.isEmpty(s))
60 | this.addString(s);
61 | }
62 | }
63 |
64 | public Iterator iterator()
65 | {
66 | return this.strings.iterator();
67 | }
68 |
69 | public Set getStrings()
70 | {
71 | return this.strings;
72 | }
73 |
74 | protected void addString(String string)
75 | {
76 | this.strings.add(string);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/geom/Extent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.geom;
7 |
8 | /**
9 | * Represents a volume enclosing one or more objects or collections of points. Primarily used to test intersections with
10 | * other objects.
11 | *
12 | * @author Tom Gaskins
13 | * @version $Id: Extent.java 807 2012-09-26 17:40:25Z dcollins $
14 | */
15 | public interface Extent
16 | {
17 | /**
18 | * Returns the extent's center point.
19 | *
20 | * @return the extent's center point.
21 | */
22 | Vec4 getCenter();
23 |
24 | /**
25 | * Returns the extent's radius. The computation of the radius depends on the implementing class. See the
26 | * documentation for the individual classes to determine how they compute a radius.
27 | *
28 | * @return the extent's radius.
29 | */
30 | double getRadius();
31 |
32 | /**
33 | * Computes the distance between this extent and the specified point. This returns 0 if the point is inside this
34 | * extent. This does not retain any reference to the specified point, or modify it in any way.
35 | *
36 | * @param point the point who's distance to this extent is computed.
37 | *
38 | * @return the distance between the point and this extent, or 0 if the point is inside this extent.
39 | *
40 | * @throws IllegalArgumentException if the point is null.
41 | */
42 | double distanceTo(Vec4 point);
43 |
44 | /**
45 | * Computes the effective radius of the extent relative to a specified plane.
46 | *
47 | * @param plane the plane.
48 | *
49 | * @return the effective radius, or 0 if the plane is null.
50 | */
51 | double getEffectiveRadius(Plane plane);
52 |
53 | /**
54 | * Determines whether or not this Extent intersects frustum. Returns true if any part of
55 | * these two objects intersect, including the case where either object wholly contains the other, false otherwise.
56 | *
57 | * @param frustum the Frustum with which to test for intersection.
58 | *
59 | * @return true if there is an intersection, false otherwise.
60 | */
61 | boolean intersects(Frustum frustum);
62 | }
63 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/config/Earth/BMNGWMSLayer.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 | Blue Marble (WMS) 2004
12 |
13 | http://data.worldwind.arc.nasa.gov/wms
14 | http://data.worldwind.arc.nasa.gov/wms
15 | bmng200405
16 |
17 |
18 | 26 03 2009 00:00:00 GMT
19 | Earth/BMNGWMS/BMNG(Shaded + Bathymetry) Tiled - Version 1.1 - 5.2004
20 | image/png
21 |
22 | image/png
23 | image/dds
24 |
25 | .png
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 2
51 | 1000
52 |
53 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/cache/BasicMemoryCacheSet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.cache;
7 |
8 | import gov.nasa.worldwind.util.Logging;
9 |
10 | import java.util.concurrent.ConcurrentHashMap;
11 |
12 | /**
13 | * @author dcollins
14 | * @version $Id: BasicMemoryCacheSet.java 834 2012-10-08 22:25:55Z dcollins $
15 | */
16 | public class BasicMemoryCacheSet implements MemoryCacheSet
17 | {
18 | protected ConcurrentHashMap caches = new ConcurrentHashMap();
19 |
20 | public BasicMemoryCacheSet()
21 | {
22 | }
23 |
24 | /** {@inheritDoc} */
25 | public synchronized MemoryCache get(String key)
26 | {
27 | if (key == null)
28 | {
29 | String msg = Logging.getMessage("nullValue.KeyIsNull");
30 | Logging.error(msg);
31 | throw new IllegalArgumentException(msg);
32 | }
33 |
34 | return this.caches.get(key);
35 | }
36 |
37 | /** {@inheritDoc} */
38 | public synchronized MemoryCache put(String key, MemoryCache cache)
39 | {
40 | if (key == null)
41 | {
42 | String msg = Logging.getMessage("nullValue.KeyIsNull");
43 | Logging.error(msg);
44 | throw new IllegalArgumentException(msg);
45 | }
46 |
47 | if (cache == null)
48 | {
49 | String msg = Logging.getMessage("nullValue.CacheIsNull");
50 | Logging.error(msg);
51 | throw new IllegalArgumentException(msg);
52 | }
53 |
54 | return this.caches.putIfAbsent(key, cache);
55 | }
56 |
57 | /** {@inheritDoc} */
58 | public synchronized boolean contains(String key)
59 | {
60 | if (key == null)
61 | {
62 | String msg = Logging.getMessage("nullValue.KeyIsNull");
63 | Logging.error(msg);
64 | throw new IllegalArgumentException(msg);
65 | }
66 |
67 | return this.caches.containsKey(key);
68 | }
69 |
70 | /** {@inheritDoc} */
71 | public synchronized void clear()
72 | {
73 | for (MemoryCache cache : this.caches.values())
74 | {
75 | cache.clear();
76 | }
77 |
78 | this.caches.clear();
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/DXTCompressor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util.dds;
8 |
9 | import android.graphics.Bitmap;
10 |
11 | import java.nio.ByteBuffer;
12 |
13 | /**
14 | * The DXTCompressor interface will compress an in-memory image using one of the DXT block compression
15 | * schemes. The details of each block compression scheme is handled by the implementation.
16 | *
17 | * @author dcollins
18 | * @version $Id: DXTCompressor.java 733 2012-09-02 17:15:09Z dcollins $
19 | */
20 | public interface DXTCompressor
21 | {
22 | /**
23 | * Returns the DXT format constant associated with this compressor.
24 | *
25 | * @return DXT format for this compressor.
26 | *
27 | * @see DDSConstants
28 | */
29 | int getDXTFormat();
30 |
31 | /**
32 | * Returns the compressed size in bytes of the specified image.
33 | *
34 | * @param image the image to compute the compressed size for.
35 | * @param attributes the attributes that may affect the compressed size.
36 | *
37 | * @return compressed size in bytes of the specified image.
38 | *
39 | * @throws IllegalArgumentException if either image or attributes is null.
40 | */
41 | int getCompressedSize(Bitmap image, DXTCompressionAttributes attributes);
42 |
43 | /**
44 | * Encodes the specified image image into a compressed DXT codec, and writes the compressed bytes to
45 | * the specified buffer. The buffer should be allocated with enough space to hold the compressed
46 | * output. The correct size should be computed by calling getCompressedSize(image, attributes).
47 | *
48 | * @param image the image to compress.
49 | * @param attributes the attributes that may affect the compression.
50 | * @param buffer the buffer that will receive the compressed output.
51 | *
52 | * @throws IllegalArgumentException if any of image, attributes, or buffer
53 | * are null.
54 | * @see #getCompressedSize(Bitmap, DXTCompressionAttributes)
55 | */
56 | void compressImage(Bitmap image, DXTCompressionAttributes attributes, ByteBuffer buffer);
57 | }
58 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | WorldWind_Android
2 | =================
3 |
4 | WorldWind Library and Example code for the Android framework.
5 |
6 | This repository contains the updates to the **NASA WorldWind** library for the Android mobile OS.
7 | The Library has updated with some bugfixing (XML parsing and other small issues), and with the support for new layers.
8 |
9 | * `CompassLayer` to display a Compass (that dinamically rotates and tilts) in the upper right corner of the view.
10 | * `ScalebarLayer` to display a Scalebar in the bottom part of the view.
11 | * `SkyGradientLayer` to display the Sky in the three dimensional environment. This layer has a nice visual impact when looking at the horizon.
12 | * `WMSTiledImageLayer` to display an arbitrary WMS layer. See the application example.
13 | * `WorldMapLayer` to display a WorldMap thumbnail in the upper left part of the view which shows where in the world the user is looking at.
14 |
15 | ** We fixed the "Tablets only" support. Now textures used are PKM (ETC1) that are widely supported in mobile devices. DDS support is still in the library but is not enabled by default and in the demo application.
16 | **It requires API 15+**
17 |
18 |
19 | ## Examples
20 |
21 | The project `WorldWindowApplicationSample` contains a full and working example of how to use the new layers.
22 | The folder `WorldDroidDemoApp` contains a ready to install apk with the latest version of the application.
23 |
24 | ChangeLog
25 | -------
26 |
27 | * [Changelog:](https://github.com/TrilogisIT/WorldWind_Android/tree/master/CHANGELOG.md) A complete changelog
28 |
29 |
30 | Credits
31 | -------
32 |
33 | Author: Nicola Dorigatti ([Trilogis Srl](http://www.trilogis.it))
34 |
35 | * WorldWind is an opensource API relased by [NASA](http://www.nasa.gov/) under the [NASA Open Source Agreement (NOSA)](http://worldwind.arc.nasa.gov/worldwind-nosa-1.3.html)
36 |
37 | * The WMS Layers used in the Application Sample are kindly made available from the [Autonomous Province of Bolzano (Italy)](http://www.provincia.bz.it/aprov/amministrazione/default.asp).
38 |
39 | 
40 | 
41 | 
42 |
43 | Further information and screenshots can be found at [our website](http://www.trilogis.it/?portfolio=3ddroid&lang=en)
44 |
45 | NASA and the NASA logo are registered trademarks of NASA, used with permission.
46 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/impl/KMLController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml.impl;
6 |
7 | import gov.nasa.worldwind.WWObjectImpl;
8 | import gov.nasa.worldwind.event.*;
9 | import gov.nasa.worldwind.kml.*;
10 | import gov.nasa.worldwind.render.*;
11 |
12 | /**
13 | * Executes the mapping from KML to World Wind. Traverses a parsed KML document and creates the appropriate World Wind
14 | * object to represent the KML.
15 | *
16 | * @author tag
17 | * @version $Id: KMLController.java 771 2012-09-14 19:30:10Z tgaskins $
18 | */
19 | public class KMLController extends WWObjectImpl implements Renderable, MessageListener
20 | {
21 | protected KMLRoot kmlRoot;
22 | protected KMLTraversalContext tc;
23 |
24 | public KMLController(KMLRoot root)
25 | {
26 | this.setKmlRoot(root);
27 | this.tc = new KMLTraversalContext();
28 | this.initializeTraversalContext(tc);
29 | }
30 |
31 | public KMLRoot getKmlRoot()
32 | {
33 | return this.kmlRoot;
34 | }
35 |
36 | public void setKmlRoot(KMLRoot kmlRoot)
37 | {
38 | // Stop listening for property changes in previous KMLRoot
39 | KMLRoot oldRoot = this.getKmlRoot();
40 | if (oldRoot != null)
41 | oldRoot.removePropertyChangeListener(this);
42 |
43 | this.kmlRoot = kmlRoot;
44 |
45 | if (kmlRoot != null)
46 | kmlRoot.addPropertyChangeListener(this);
47 | }
48 |
49 | public KMLTraversalContext getTraversalContext()
50 | {
51 | return this.tc;
52 | }
53 |
54 | public void render(DrawContext dc)
55 | {
56 | this.initializeTraversalContext(this.getTraversalContext());
57 | this.kmlRoot.render(this.getTraversalContext(), dc);
58 | }
59 |
60 | /**
61 | * Initializes this KML controller's traversal context to its default state. A KML traversal context must be
62 | * initialized prior to use during preRendering or rendering, to ensure that state from the previous pass does not
63 | * affect the current pass.
64 | *
65 | * @param tc the KML traversal context to initialize.
66 | */
67 | protected void initializeTraversalContext(KMLTraversalContext tc)
68 | {
69 | tc.initialize();
70 | tc.setDetailHint(this.kmlRoot.getDetailHint());
71 | }
72 |
73 | public void onMessage(Message msg)
74 | {
75 | if (this.kmlRoot != null)
76 | this.kmlRoot.onMessage(msg);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/io/KMLDoc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml.io;
6 |
7 | import java.io.*;
8 |
9 | /**
10 | * Defines the interface for opening a KML or KMZ file or stream and for resolving paths to files referenced by the KML
11 | * content.
12 | *
13 | * @author tag
14 | * @version $Id: KMLDoc.java 771 2012-09-14 19:30:10Z tgaskins $
15 | */
16 | public interface KMLDoc
17 | {
18 | /**
19 | * Returns an {@link java.io.InputStream} to the associated KML document within either a KML file or stream or a KMZ file or
20 | * stream.
21 | *
22 | * Implementations of this interface do not close the stream; the user of the class must close the stream.
23 | *
24 | * @return an input stream positioned to the head of the KML document.
25 | *
26 | * @throws java.io.IOException if an error occurs while attempting to create or open the input stream.
27 | */
28 | InputStream getKMLStream() throws IOException;
29 |
30 | /**
31 | * Returns a file specified by a path relative to the KML document. If the document is in a KML file, the path is
32 | * resolved relative to the KML file's location in the file system. If the document is in a KMZ file or stream, the
33 | * path is resolved relative to the root of the KMZ file or stream. If the document is a KML stream, the relative
34 | * path is resolved relative to the base URI of the stream, if a base URI has been specified.
35 | *
36 | * @param path the path of the requested file.
37 | *
38 | * @return an input stream positioned to the start of the requested file, or null if the file cannot be found.
39 | *
40 | * @throws IllegalArgumentException if the path is null.
41 | * @throws IOException if an error occurs while attempting to create or open the input stream.
42 | */
43 | InputStream getSupportFileStream(String path) throws IOException;
44 |
45 | /**
46 | * Returns an absolute path or URL to a file indicated by a path relative to the KML file's location.
47 | *
48 | * @param path the path of the requested file.
49 | *
50 | * @return an absolute path or URL to the file, or null if the file does not exist.
51 | *
52 | * @throws IllegalArgumentException if the specified path is null.
53 | * @throws java.io.IOException if an error occurs while attempting to read the support file.
54 | */
55 | String getSupportFilePath(String path) throws IOException;
56 | }
57 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/xml/XMLEventParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.util.xml;
6 |
7 | /**
8 | * @author tag
9 | * @version $Id: XMLEventParser.java 771 2012-09-14 19:30:10Z tgaskins $
10 | */
11 | public interface XMLEventParser
12 | {
13 | /**
14 | * Parse the event and initialize the parser's values to those found in the event.
15 | *
16 | * @param context a current parser context.
17 | * @param event the event to parse.
18 | * @param args an optional list of arguments that may by used by subclasses.
19 | *
20 | * @return if parsing is successful, returns this, otherwise returns null.
21 | *
22 | * @throws XMLParserException if a parsing exception occurs.
23 | */
24 | Object parse(XMLEventParserContext context, XMLEvent event, Object... args) throws XMLParserException;
25 |
26 | /**
27 | * Creates a new empty parser instance of the same type. This is used by {@link
28 | * gov.nasa.worldwind.util.xml.XMLEventParserContext} when creating parsers associated with specific event types.
29 | * The returned parser has the same namespace as the instance creating it, but has empty fields for all other
30 | * values.
31 | *
32 | * @return a new parser instance. The namespace URI is the same as the creating parser, but all other fields are
33 | * empty.
34 | *
35 | * @throws Exception if an error or exception occurs while attempting to create the parser.
36 | */
37 | XMLEventParser newInstance() throws Exception;
38 |
39 | /**
40 | * Specifies the parent parser of this parser.
41 | *
42 | * @param parent this parser's parent parser.
43 | */
44 | void setParent(XMLEventParser parent);
45 |
46 | /**
47 | * Returns this parser's parent parser.
48 | *
49 | * @return this parser's parent parser.
50 | */
51 | XMLEventParser getParent();
52 |
53 | /**
54 | * Release large resources used by the parser, but does not dispose of the parser itself. Call this method once its
55 | * data is no longer needed, such as after mappings and related representations are created. For example, if a
56 | * parser holds a large number of positions, and those positions are no longer needed after the positions are
57 | * converted to points or copied to other storage, this method releases the memory associated with the original
58 | * positions.
59 | */
60 | void freeResources();
61 | }
62 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLPoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | import gov.nasa.worldwind.geom.Position;
8 | import gov.nasa.worldwind.util.Logging;
9 | import gov.nasa.worldwind.util.xml.*;
10 |
11 | /**
12 | * Represents the KML Point element and provides access to its contents.
13 | *
14 | * @author tag
15 | * @version $Id: KMLPoint.java 771 2012-09-14 19:30:10Z tgaskins $
16 | */
17 | public class KMLPoint extends KMLAbstractGeometry
18 | {
19 | protected Position coordinates;
20 |
21 | /**
22 | * Construct an instance.
23 | *
24 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
25 | */
26 | public KMLPoint(String namespaceURI)
27 | {
28 | super(namespaceURI);
29 | }
30 |
31 | @Override
32 | protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args)
33 | {
34 | if (event.getName().getLocalPart().equals("coordinates"))
35 | this.setCoordinates((Position.PositionList) o);
36 | else
37 | super.doAddEventContent(o, ctx, event, args);
38 | }
39 |
40 | public boolean isExtrude()
41 | {
42 | return this.getExtrude() == Boolean.TRUE;
43 | }
44 |
45 | public Boolean getExtrude()
46 | {
47 | return (Boolean) this.getField("extrude");
48 | }
49 |
50 | public String getAltitudeMode()
51 | {
52 | return (String) this.getField("altitudeMode");
53 | }
54 |
55 | public Position getCoordinates()
56 | {
57 | return this.coordinates;
58 | }
59 |
60 | protected void setCoordinates(Position.PositionList coordsList)
61 | {
62 | if (coordsList != null && coordsList.list.size() > 0)
63 | this.coordinates = coordsList.list.get(0);
64 | }
65 |
66 | @Override
67 | public void applyChange(KMLAbstractObject sourceValues)
68 | {
69 | if (!(sourceValues instanceof KMLPoint))
70 | {
71 | String message = Logging.getMessage("nullValue.SourceIsNull");
72 | Logging.warning(message);
73 | throw new IllegalArgumentException(message);
74 | }
75 |
76 | KMLPoint point = (KMLPoint) sourceValues;
77 |
78 | if (point.getCoordinates() != null)
79 | this.coordinates = point.getCoordinates();
80 |
81 | super.applyChange(sourceValues); // sends geometry-changed notification
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/layout/dialog_wms_add.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
18 |
19 |
29 |
30 |
41 |
42 |
43 |
44 |
52 |
53 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/WorldWindowApplicationSample/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
15 |
16 |
21 |
22 |
26 |
27 |
28 |
29 |
38 |
39 |
44 |
45 |
50 |
51 |
57 |
58 |
63 |
64 |
69 |
70 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/terrain/BasicTessellatorFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 | package gov.nasa.worldwind.terrain;
7 |
8 | import gov.nasa.worldwind.BasicFactory;
9 | import gov.nasa.worldwind.exception.WWUnrecognizedException;
10 | import gov.nasa.worldwind.util.*;
11 | import org.w3c.dom.Element;
12 |
13 | /**
14 | * @author dcollins
15 | * @version $Id: BasicTessellatorFactory.java 733 2012-09-02 17:15:09Z dcollins $
16 | */
17 | public class BasicTessellatorFactory extends BasicFactory
18 | {
19 | /** Creates an instance of BasicTessellatorFactory; otherwise does nothing. */
20 | public BasicTessellatorFactory()
21 | {
22 | }
23 |
24 | public Object createFromConfigSource(Object configSource)
25 | {
26 | Object tessellator = super.createFromConfigSource(configSource);
27 |
28 | if (tessellator == null)
29 | {
30 | String msg = Logging.getMessage("generic.SourceTypeUnrecognized", configSource);
31 | throw new WWUnrecognizedException(msg);
32 | }
33 |
34 | return tessellator;
35 | }
36 |
37 | /**
38 | * Creates an tessellator from an XML description. An "href" link to an external tessellator description is followed
39 | * if it exists.
40 | *
41 | * @param domElement an XML element containing the tessellator description.
42 | *
43 | * @return the requested tessellator, or null if the specified element does not describe a tessellator.
44 | *
45 | * @throws Exception if a problem occurs during creation.
46 | */
47 | @Override
48 | protected Tessellator doCreateFromElement(Element domElement) throws Exception
49 | {
50 | String href = WWXML.getText(domElement, "@href", null);
51 | if (href != null && href.length() > 0)
52 | return (Tessellator) this.createFromConfigSource(href);
53 |
54 | String tessellatorType = WWXML.getText(domElement, "@tessellatorType", null);
55 | if (tessellatorType != null && tessellatorType.equalsIgnoreCase("TiledTessellator"))
56 | {
57 | return this.createTiledTessellator(domElement);
58 | }
59 | else
60 | {
61 | String msg = Logging.getMessage("generic.TessellatorTypeUnrecognized", tessellatorType);
62 | throw new WWUnrecognizedException(msg);
63 | }
64 | }
65 |
66 | protected Tessellator createTiledTessellator(Element domElement)
67 | {
68 | return new TiledTessellator(domElement);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/util/dds/Color24.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 United States Government as represented by the Administrator of the
3 | * National Aeronautics and Space Administration.
4 | * All Rights Reserved.
5 | */
6 |
7 | package gov.nasa.worldwind.util.dds;
8 |
9 | /**
10 | * 24 bit 888 RGB color
11 | *
12 | * @author Lado Garakanidze
13 | * @version $Id: Color24.java 733 2012-09-02 17:15:09Z dcollins $
14 | */
15 |
16 | public class Color24
17 | {
18 | /**
19 | * The red color component.
20 | */
21 | public int r;
22 | /**
23 | * The green color component.
24 | */
25 | public int g;
26 | /**
27 | * The blue color component.
28 | */
29 | public int b;
30 |
31 | /**
32 | * Creates a 24 bit 888 RGB color with all values set to 0.
33 | */
34 | public Color24()
35 | {
36 | this.r = this.g = this.b = 0;
37 | }
38 |
39 | public Color24(int r, int g, int b)
40 | {
41 | this.r = r;
42 | this.g = g;
43 | this.b = b;
44 | }
45 |
46 | public int getPixel888()
47 | {
48 | return (this.r << 16 | this.g << 8 | this.b);
49 | }
50 |
51 | public static Color24 fromPixel565(int pixel)
52 | {
53 | Color24 color = new Color24();
54 |
55 | color.r = (int) (((long) pixel) & 0xf800) >>> 8;
56 | color.g = (int) (((long) pixel) & 0x07e0) >>> 3;
57 | color.b = (int) (((long) pixel) & 0x001f) << 3;
58 |
59 | return color;
60 | }
61 |
62 | public static Color24 multiplyAlpha(Color24 color, int alpha)
63 | {
64 | Color24 result = new Color24();
65 |
66 | double alphaF = alpha / 256.0;
67 |
68 | result.r = (int) (color.r * alphaF);
69 | result.g = (int) (color.g * alphaF);
70 | result.b = (int) (color.b * alphaF);
71 |
72 | return result;
73 | }
74 |
75 | public static Color24[] expandLookupTable(short minColor, short maxColor)
76 | {
77 | Color24 colorMin = Color24.fromPixel565(minColor);
78 | Color24 colorMax = Color24.fromPixel565(maxColor);
79 |
80 | Color24 color3 = new Color24();
81 | Color24 color4 = new Color24();
82 |
83 | color3.r = (2 * colorMin.r + colorMax.r + 1) / 3;
84 | color3.g = (2 * colorMin.g + colorMax.g + 1) / 3;
85 | color3.b = (2 * colorMin.b + colorMax.b + 1) / 3;
86 |
87 | color4.r = (colorMin.r + 2 * colorMax.r + 1) / 3;
88 | color4.g = (colorMin.g + 2 * colorMax.g + 1) / 3;
89 | color4.b = (colorMin.b + 2 * colorMax.b + 1) / 3;
90 |
91 | return new Color24[]{colorMin, colorMax, color3, color4};
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/WorldWindAndroid/src/gov/nasa/worldwind/kml/KMLBalloonStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 DreamHammer.com
3 | */
4 |
5 | package gov.nasa.worldwind.kml;
6 |
7 | /**
8 | * Represents the KML BalloonStyle element and provides access to its contents.
9 | *
10 | * @author tag
11 | * @version $Id: KMLBalloonStyle.java 771 2012-09-14 19:30:10Z tgaskins $
12 | */
13 | public class KMLBalloonStyle extends KMLAbstractSubStyle
14 | {
15 | /**
16 | * Construct an instance.
17 | *
18 | * @param namespaceURI the qualifying namespace URI. May be null to indicate no namespace qualification.
19 | */
20 | public KMLBalloonStyle(String namespaceURI)
21 | {
22 | super(namespaceURI);
23 | }
24 |
25 | /**
26 | * Specifies this KMLBalloonStyle's background color as a hexadecimal string in the form: aabbggrr
27 | * (deprecated). The color style attribute was Deprecated in KML 2.1 and replaced by
28 | * bgColor.
29 | *
30 | * @return the background color as a hexadecimal string.
31 | */
32 | public String getColor()
33 | {
34 | return (String) this.getField("color");
35 | }
36 |
37 | /**
38 | * Specifies this KMLBalloonStyle's background color as a hexadecimal string in the form: aabbggrr.
39 | * This is the preferred attribute for encoding a balloon's background color since KML 2.1.
40 | *
41 | * @return the background color as a hexadecimal string.
42 | */
43 | public String getBgColor()
44 | {
45 | return (String) this.getField("bgColor");
46 | }
47 |
48 | public String getTextColor()
49 | {
50 | return (String) this.getField("textColor");
51 | }
52 |
53 | /**
54 | * Get the text field.
55 | *
56 | * @return Balloon text field.
57 | */
58 | public String getText()
59 | {
60 | return (String) this.getField("text");
61 | }
62 |
63 | public String getDisplayMode()
64 | {
65 | return (String) this.getField("displayMode");
66 | }
67 |
68 | /**
69 | * Does the style have at least one BalloonStyle field set? This method tests for the existence of the BalloonStyle
70 | * content fields (text, displayMode, bgColor, etc).
71 | *
72 | * @return True if at least one of the BalloonStyle fields is set (text, displayMode, bgColor, etc).
73 | */
74 | public boolean hasStyleFields()
75 | {
76 | return this.hasField("text")
77 | || this.hasField("bgColor")
78 | || this.hasField("textColor")
79 | || this.hasField("color")
80 | || this.hasField("displayMode");
81 | }
82 | }
83 |
--------------------------------------------------------------------------------