public boolean addAllCoverages(ElevationModel model) { if (model == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "ElevationModel", "addAllCoverages", "missingModel")); } ArrayList<ElevationCoverage> thisList = this.coverages; ArrayList<ElevationCoverage> thatList = model.coverages; thisList.ensureCapacity(thatList.size()); boolean changed = false; for (int idx = 0, len = thatList.size(); idx < len; idx++) { ElevationCoverage thatCoverage = thatList.get(idx); // we know the contents of model.coverages is valid changed |= this.addCoverage(thatCoverage); } return changed; }
public ElevationModel(Iterable<? extends ElevationCoverage> iterable) { if (iterable == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "ElevationModel", "constructor", "missingIterable")); } for (ElevationCoverage coverage : iterable) { if (coverage == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "ElevationModel", "constructor", "missingCoverage")); } this.addCoverage(coverage); } }
/** * Creates a new WorldWindow (GLSurfaceView) object. */ public WorldWindow createWorldWindow() { // Create the WorldWindow (a GLSurfaceView) which displays the globe. this.wwd = new WorldWindow(getContext()); // Setup the WorldWindow's layers. this.wwd.getLayers().addLayer(new BackgroundLayer()); this.wwd.getLayers().addLayer(new BlueMarbleLandsatLayer()); // Setup the WorldWindow's elevation coverages. this.wwd.getGlobe().getElevationModel().addCoverage(new BasicElevationCoverage()); return this.wwd; }
/** * Creates a new WorldWindow (GLSurfaceView) object with a WCS Elevation Coverage * * @return The WorldWindow object containing the globe. */ @Override public WorldWindow createWorldWindow() { // Let the super class (BasicGlobeFragment) do the creation WorldWindow wwd = super.createWorldWindow(); // Specify the bounding sector - provided by the WCS Sector coverageSector = Sector.fromDegrees(25.0, -125.0, 25.0, 60.0); // Specify the number of levels to match data resolution int numberOfLevels = 12; // Specify the version 1.0.0 WCS address String serviceAddress = "https://worldwind26.arc.nasa.gov/wcs"; // Specify the coverage name String coverage = "USGS-NED"; // Create an elevation coverage from a version 1.0.0 WCS ElevationCoverage usgsNed = new Wcs100ElevationCoverage(coverageSector, numberOfLevels, serviceAddress, coverage); // Remove any existing coverages from the Globe wwd.getGlobe().getElevationModel().clearCoverages(); // Add the coverage to the Globes elevation model wwd.getGlobe().getElevationModel().addCoverage(usgsNed); // Position the camera to look at Mt. Rainier this.positionView(wwd); return wwd; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Establish the activity content setContentView(this.layoutResourceId); setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_basic_globe)); setAboutBoxText("Demonstrates how to construct a WorldWindow with a few layers.\n" + "The globe uses the default navigation gestures: \n" + " - one-finger pan moves the camera,\n" + " - two-finger pinch-zoom adjusts the range to the look at position, \n" + " - two-finger rotate arcs the camera horizontally around the look at position,\n" + " - three-finger tilt arcs the camera vertically around the look at position."); // Create the WorldWindow (a GLSurfaceView) which displays the globe. this.wwd = new WorldWindow(this); // Add the WorldWindow view object to the layout that was reserved for the globe. FrameLayout globeLayout = (FrameLayout) findViewById(R.id.globe); globeLayout.addView(this.wwd); // Setup the WorldWindow's layers. this.wwd.getLayers().addLayer(new BackgroundLayer()); this.wwd.getLayers().addLayer(new BlueMarbleLandsatLayer()); this.wwd.getLayers().addLayer(new AtmosphereLayer()); // Setup the WorldWindow's elevation coverages. this.wwd.getGlobe().getElevationModel().addCoverage(new BasicElevationCoverage()); }