Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/release/0.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdavidc committed May 31, 2016
2 parents 61b6afb + d164f1b commit 7014367
Show file tree
Hide file tree
Showing 91 changed files with 3,568 additions and 978 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ use to represent information on the globe or in space.
- [World Wind Forum](http://forum.worldwindcentral.com) provides help from the World Wind community
- [Android Studio](http://developer.android.com/sdk/) is used for World Wind Android development

# Release 0.2.5, May 31, 2016

World Wind Android v0.2.5 provides support for 'picking', a feature that enables applications to determine the World
Wind objects displayed at a screen point. This capability is accessible via the method [WorldWindow.pick](http://worldwindserver.net/android/0.2.5/doc/gov/nasa/worldwind/WorldWindow.html#pick-float-float-).
Along with the core capability, two examples demonstrate how developers can use picking in their own apps:
PlacemarksPickingActivity and PlacemarksSelectDragActivity.

- [World Wind Examples 0.2.5](http://worldwindserver.net/android/0.2.5/worldwind-examples.apk) - Example App for 0.2.5; runs on Android 4.4 and newer
- [World Wind Library 0.2.5](http://worldwindserver.net/android/0.2.5/worldwind.aar) - Android Archive (AAR) for 0.2.5
- [API Docs 0.2.5](http://worldwindserver.net/android/0.2.5/doc) - Developer documentation for 0.2.5
- [JIRA 0.2.5](http://issues.worldwind.arc.nasa.gov/jira/browse/WWA/fixforversion/10916) - Detailed release notes for 0.2.5

#### Release Notes

###### Requirement
- [WWA-16](http://issues.worldwind.arc.nasa.gov/jira/browse/WWA-16) - Picking

###### Bug
- [WWA-76](http://issues.worldwind.arc.nasa.gov/jira/browse/WWA-76) - Blank screen when EGL context lost

# Release 0.2.0, May 13, 2016

World Wind Android v0.2.0 adds support for screen placemarks and navigation events. The World Wind Android v0.2.0
Expand Down
4 changes: 2 additions & 2 deletions worldwind-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'gov.nasa.worldwindx.examples'
minSdkVersion 16
targetSdkVersion 23
versionCode 20
versionName '0.2.0'
versionCode 25
versionName '0.2.5'
}
buildTypes {
release {
Expand Down
12 changes: 12 additions & 0 deletions worldwind-examples/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@
android:launchMode="singleInstance"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity
android:name=".PlacemarksPickingActivity"
android:label="@string/title_placemarks_picking"
android:launchMode="singleInstance"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity
android:name=".PlacemarksSelectDragActivity"
android:label="@string/title_placemarks_select_drag"
android:launchMode="singleInstance"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity
android:name=".PlacemarksStressTestActivity"
android:label="@string/title_placemarks_stress_test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.LayoutRes;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
Expand All @@ -21,10 +19,8 @@
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

import gov.nasa.worldwind.WorldWindow;
import gov.nasa.worldwind.geom.LookAt;

/**
* This abstract Activity class implements a Navigation Drawer menu shared by all the World Wind Example activities.
Expand Down Expand Up @@ -213,6 +209,12 @@ public boolean onNavigationItemSelected(MenuItem item) {
case R.id.nav_placemarks_milstd2525_stress_activity:
startActivity(new Intent(getApplicationContext(), PlacemarksMilStd2525StressActivity.class));
break;
case R.id.nav_placemarks_picking_activity:
startActivity(new Intent(getApplicationContext(), PlacemarksPickingActivity.class));
break;
case R.id.nav_placemarks_select_drag_activity:
startActivity(new Intent(getApplicationContext(), PlacemarksSelectDragActivity.class));
break;
case R.id.nav_placemarks_stress_activity:
startActivity(new Intent(getApplicationContext(), PlacemarksStressTestActivity.class));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.util.Pools;
import android.view.MotionEvent;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import gov.nasa.worldwind.WorldWind;
Expand Down Expand Up @@ -45,6 +47,11 @@ public WorldWindow getWorldWindow() {
@Override
public void setWorldWindow(WorldWindow wwd) {
}

@Override
public boolean onTouchEvent(MotionEvent event) {
return false;
}
}

public static class AnimateCameraCommand implements Runnable {
Expand Down Expand Up @@ -187,11 +194,12 @@ public void run() {

protected static final int FRAME_INTERVAL = 67; // 67 millis; 15 frames per second

protected static Executor commandExecutor = Executors.newSingleThreadExecutor();

protected static Handler activityHandler = new Handler(Looper.getMainLooper());

public static Executor getCommandExecutor() {
protected static ExecutorService commandExecutor;

public static ExecutorService getNewCommandExecutor() {
commandExecutor = Executors.newSingleThreadExecutor();
return commandExecutor;
}

Expand Down Expand Up @@ -222,14 +230,19 @@ protected void onCreate(Bundle savedInstanceState) {

// Add a layer containing a large number of placemarks.
this.getWorldWindow().getLayers().addLayer(this.createPlacemarksLayer());
}

@Override
protected void onStart() {
super.onStart();

// Create location objects for the places used in this test.
Location arc = new Location(37.415229, -122.06265);
Location gsfc = new Location(38.996944, -76.848333);
Location esrin = new Location(41.826947, 12.674122);

// After a 1 second initial delay, clear the frame statistics associated with this test.
Executor exec = getCommandExecutor();
Executor exec = getNewCommandExecutor(); // gets a new instance
exec.execute(new SleepCommand(1000));
exec.execute(new ClearFrameMetricsCommand(wwd));

Expand Down Expand Up @@ -276,6 +289,13 @@ protected void onCreate(Bundle savedInstanceState) {
exec.execute(new LogFrameMetricsCommand(wwd));
}

@Override
protected void onStop() {
super.onStop();
commandExecutor.shutdownNow();
}


protected Layer createPlacemarksLayer() {

RenderableLayer layer = new RenderableLayer("Placemarks");
Expand Down Expand Up @@ -306,4 +326,5 @@ protected Layer createPlacemarksLayer() {

return layer;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
package gov.nasa.worldwindx;

import android.os.Bundle;
import android.os.Handler;
import android.view.Choreographer;

import gov.nasa.worldwind.Navigator;

public class BasicStressTestActivity extends BasicGlobeActivity implements Runnable {
public class BasicStressTestActivity extends BasicGlobeActivity implements Choreographer.FrameCallback {

protected Handler animationHandler = new Handler();
protected double cameraDegreesPerSecond = 0.1;

protected boolean pauseHandler;
protected boolean activityPaused;

protected long lastFrameTimeNanos;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -28,36 +30,46 @@ protected void onCreate(Bundle savedInstanceState) {
navigator.setHeading(90); // looking east
navigator.setTilt(75); // looking at the horizon

// Set up an Android Handler to animate the navigator.
this.animationHandler.postDelayed(this, 500);
// Use this Activity's Choreographer to animate the Navigator.
Choreographer.getInstance().postFrameCallback(this);
}

@Override
public void run() {
// Move the navigator to continuously bring new tiles into view.
Navigator navigator = getWorldWindow().getNavigator();
navigator.setLongitude(navigator.getLongitude() + 1.0e-4);
public void doFrame(long frameTimeNanos) {
if (this.lastFrameTimeNanos != 0) {
// Compute the frame duration in seconds.
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);

// Move the navigator to continuously bring new tiles into view.
Navigator navigator = getWorldWindow().getNavigator();
navigator.setLongitude(navigator.getLongitude() + cameraDegrees);

// Redraw the World Window to display the above changes.
this.getWorldWindow().requestRedraw();
// Redraw the World Window to display the above changes.
this.getWorldWindow().requestRedraw();
}

if (!this.pauseHandler) { // stop running when this activity is paused; the Handler is resumed in onResume
this.animationHandler.postDelayed(this, 30);
if (!this.activityPaused) { // stop animating when this Activity is paused
Choreographer.getInstance().postFrameCallback(this);
}

this.lastFrameTimeNanos = frameTimeNanos;
}

@Override
protected void onPause() {
super.onPause();
// Stop running the Handler when this activity is paused.
this.pauseHandler = true;
// Stop running the animation when this activity is paused.
this.activityPaused = true;
this.lastFrameTimeNanos = 0;
}

@Override
protected void onResume() {
super.onResume();
// Resume the Handler that animates the navigator.
this.pauseHandler = false;
this.animationHandler.postDelayed(this, 500);
// Resume the Navigator animation.
this.activityPaused = false;
this.lastFrameTimeNanos = 0;
Choreographer.getInstance().postFrameCallback(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class DayNightCycleActivity extends BasicGlobeActivity implements Choreog

protected double lightDegreesPerSecond = 6.0;

protected boolean paused;
protected boolean activityPaused;

protected long lastFrameTimeNanos;

Expand Down Expand Up @@ -69,7 +69,7 @@ public void doFrame(long frameTimeNanos) {
this.getWorldWindow().requestRedraw();
}

if (!this.paused) { // stop animating when this Activity is paused
if (!this.activityPaused) { // stop animating when this Activity is paused
Choreographer.getInstance().postFrameCallback(this);
}

Expand All @@ -80,15 +80,15 @@ public void doFrame(long frameTimeNanos) {
protected void onPause() {
super.onPause();
// Stop running the animation when this activity is paused.
this.paused = true;
this.activityPaused = true;
this.lastFrameTimeNanos = 0;
}

@Override
protected void onResume() {
super.onResume();
// Resume the day-night cycle animation.
this.paused = false;
this.activityPaused = false;
this.lastFrameTimeNanos = 0;
Choreographer.getInstance().postFrameCallback(this);
}
Expand Down
Loading

0 comments on commit 7014367

Please sign in to comment.