Skip to content

Commit

Permalink
Update line of site wording (NASAWorldWind#157)
Browse files Browse the repository at this point in the history
* Clarify the nature of OmnidirectionalSightline
- Add comments reflecting this is an area visual representation of line of sight
- Update the corresponding Examples and Tutorials

* Rename menu items from OmnidirectionalSightline to Line of Sight

* Update menu organization and icons
- Reorder Line of Sight
- Update Line of Sight icon
  • Loading branch information
zglueck authored and pdavidc committed Aug 23, 2017
1 parent b0c3e42 commit 2488c78
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion worldwind-examples/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<activity
android:name=".OmnidirectionalSightlineActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_movable_omni_sightline"
android:label="@string/title_movable_line_of_sight"
android:launchMode="singleInstance"
android:noHistory="true"
android:theme="@style/AppTheme.NoActionBar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@
import gov.nasa.worldwind.shape.ShapeAttributes;

/**
* This Activity demonstrates the OmnidirectionalSightline object and allows the position of the sightline to be moved
* via a drag action.
* This Activity demonstrates the OmnidirectionalSightline object which provides a visual representation of line of
* sight from a specified origin. Terrain visible from the origin is colored differently than areas not visible from
* the OmnidirectionalSightline origin. Line of sight is calculated as a straight line from the origin to the available
* terrain.
*/
public class OmnidirectionalSightlineActivity extends BasicGlobeActivity {

/**
* The OmnidirectionalSightline displaying visibility on the terrain
* The OmnidirectionalSightline object which will display areas visible using a line of sight from the origin
*/
protected OmnidirectionalSightline sightline;

/**
* A Placemark representing the position of the sightline
* A Placemark representing the origin of the sightline
*/
protected Placemark sightlinePlacemark;

Expand All @@ -50,18 +52,19 @@ public class OmnidirectionalSightlineActivity extends BasicGlobeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_movable_omni_sightline));
setAboutBoxTitle("About the " + this.getResources().getText(R.string.title_movable_line_of_sight));
setAboutBoxText("Demonstrates a draggable WorldWind Omnidirectional sightline. Drag the placemark icon around the " +
"screen to move the sightline position.");

// Initialize attributes for the OmnidirectionalSightline
ShapeAttributes viewableRegions = new ShapeAttributes();
viewableRegions.setInteriorColor(new Color(0f, 1f, 0f, 0.25f));
viewableRegions.setInteriorColor(new Color(0f, 1f, 0f, 0.5f));

ShapeAttributes blockedRegions = new ShapeAttributes();
blockedRegions.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.5f));
blockedRegions.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.8f));

// Initialize the OmnidirectionalSightline and Corresponding Placemark
// The position is the line of sight origin for determining visible terrain
Position pos = new Position(46.202, -122.190, 500.0);
this.sightline = new OmnidirectionalSightline(pos, 10000.0);
this.sightline.setAttributes(viewableRegions);
Expand Down
4 changes: 2 additions & 2 deletions worldwind-examples/src/main/res/menu/activity_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
android:title="@string/title_placemarks_milstd2525_demo"/>
<item
android:id="@+id/nav_omnidirectional_sightline_activity"
android:icon="@android:drawable/ic_menu_myplaces"
android:title="@string/title_movable_omni_sightline"/>
android:icon="@android:drawable/ic_menu_gallery"
android:title="@string/title_movable_line_of_sight"/>
<item
android:id="@+id/nav_paths_example"
android:icon="@android:drawable/ic_menu_directions"
Expand Down
2 changes: 1 addition & 1 deletion worldwind-examples/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<string name="title_day_night_cycle">Day and Night Cycle</string>
<string name="title_general_globe">General Purpose Globe</string>
<string name="title_multi_globe">Multi-Globe Demonstration</string>
<string name="title_movable_omni_sightline">Movable OmnidirectionalSightline</string>
<string name="title_movable_line_of_sight">Movable Line of Sight</string>
<string name="title_paths_example">Paths Example</string>
<string name="title_paths_and_polygons">Paths, Polygons &amp; Labels Demonstration</string>
<string name="title_placemarks_demo">Placemarks Demonstration</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@
<link rel="stylesheet" type="text/css" href="file:///android_asset/override.css"/>
</head>
<body>
<h1>OmnidirectionalSightline Tutorial</h1>
<h1>Line Of Sight Tutorial</h1>
<p>
Demonstrates how to create an OmnidirectionalSightline and add it to the globe. An OmnidirectionalSightline provides
a visual area representation of line of sight from a provided position. Areas occluded by terrain will appear in a
different color than areas visible to the provided point.
Demonstrates how to create an OmnidirectionalSightline and add it to the globe to visualize line of sight. An
OmnidirectionalSightline provides a visual area representation of line of sight from a provided origin. Areas
occluded by terrain from line of sight will appear in a different color than areas visible to the provided point.
</p>
<p>
This tutorial demonstrates the creation of an OmnidirectionSightline. In addition to the OmnidirectionalSightline, a
Placemark indicating the position of the sightline origin is added to provide visual context.
</p>
<p>
The regions colored green indicate they are visible from the position provided to the OmnidirectionSightline.
Regions colored gray are occluded by terrain from the provided position. This tutorial uses a sightline range of
10,000 meters.
Regions colored gray are occluded by terrain. This tutorial uses a sightline range of 10,000 meters.
</p>
<h2>Example</h2>
<h3>OmnidirectionalSightlineFragment.java</h3>
Expand All @@ -44,7 +43,7 @@ <h3>OmnidirectionalSightlineFragment.java</h3>
// Let the super class (BasicGlobeFragment) do the creation
WorldWindow wwd = super.createWorldWindow();

// Specify the sightline origin position
// Specify the sightline position, which is the origin of the line of sight calculation
Position position = new Position(46.230, -122.190, 2500.0);
// Specify the range of the sightline (meters)
double range = 10000.0;
Expand All @@ -57,7 +56,7 @@ <h3>OmnidirectionalSightlineFragment.java</h3>

// Create the sightline
OmnidirectionalSightline sightline = new OmnidirectionalSightline(position, range);
// Add the attributes
// Set the attributes
sightline.setAttributes(visibleAttributes);
sightline.setOccludeAttributes(occludedAttributes);

Expand All @@ -66,7 +65,7 @@ <h3>OmnidirectionalSightlineFragment.java</h3>
sightlineLayer.addRenderable(sightline);
wwd.getLayers().addLayer(sightlineLayer);

// Create a Placemark to help visualize the position of the sightline
// Create a Placemark to visualize the position of the sightline
this.createPlacemark(position, sightlineLayer);

// Position the camera to look at the line of site terrain coverage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public WorldWindow createWorldWindow() {
// Let the super class (BasicGlobeFragment) do the creation
WorldWindow wwd = super.createWorldWindow();

// Specify the sightline position
// Specify the sightline position, which is the origin of the line of sight calculation
Position position = new Position(46.230, -122.190, 2500.0);
// Specify the range of the sightline (meters)
double range = 10000.0;
Expand All @@ -37,11 +37,11 @@ public WorldWindow createWorldWindow() {
visibleAttributes.setInteriorColor(new Color(0f, 1f, 0f, 0.5f));
// Create attributes for the occluded terrain
ShapeAttributes occludedAttributes = new ShapeAttributes();
occludedAttributes.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.5f));
occludedAttributes.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.8f));

// Create the sightline
OmnidirectionalSightline sightline = new OmnidirectionalSightline(position, range);
// Add the attributes
// Set the attributes
sightline.setAttributes(visibleAttributes);
sightline.setOccludeAttributes(occludedAttributes);

Expand Down
8 changes: 4 additions & 4 deletions worldwind-tutorials/src/main/res/menu/activity_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
android:id="@+id/nav_surface_image_activity"
android:icon="@android:drawable/ic_menu_mapmode"
android:title="@string/title_surface_image"/>
<item
android:id="@+id/nav_omnidirectional_sightline_activity"
android:icon="@android:drawable/ic_menu_gallery"
android:title="@string/title_omni_sightline"/>
<item
android:id="@+id/nav_camera_view_activity"
android:icon="@android:drawable/ic_menu_compass"
Expand All @@ -43,10 +47,6 @@
android:id="@+id/nav_navigator_event_activity"
android:icon="@android:drawable/ic_menu_compass"
android:title="@string/title_navigator_event"/>
<item
android:id="@+id/nav_omnidirectional_sightline_activity"
android:icon="@android:drawable/ic_menu_compass"
android:title="@string/title_omni_sightline"/>
<item
android:id="@+id/nav_placemarks_activity"
android:icon="@android:drawable/ic_menu_myplaces"
Expand Down
2 changes: 1 addition & 1 deletion worldwind-tutorials/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<string name="title_labels">Labels</string>
<string name="title_look_at_view">Look At View</string>
<string name="title_navigator_event">Navigator Events</string>
<string name="title_omni_sightline">Omnidirectional Sightline</string>
<string name="title_omni_sightline">Line Of Sight</string>
<string name="title_paths">Paths</string>
<string name="title_placemarks">Placemarks</string>
<string name="title_placemarks_picking">Placemark Picking</string>
Expand Down

0 comments on commit 2488c78

Please sign in to comment.