Skip to content

Commit 2488c78

Browse files
zglueckpdavidc
authored andcommitted
Update line of site wording (#157)
* 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
1 parent b0c3e42 commit 2488c78

File tree

8 files changed

+30
-28
lines changed

8 files changed

+30
-28
lines changed

worldwind-examples/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<activity
5252
android:name=".OmnidirectionalSightlineActivity"
5353
android:configChanges="orientation|screenSize"
54-
android:label="@string/title_movable_omni_sightline"
54+
android:label="@string/title_movable_line_of_sight"
5555
android:launchMode="singleInstance"
5656
android:noHistory="true"
5757
android:theme="@style/AppTheme.NoActionBar">

worldwind-examples/src/main/java/gov/nasa/worldwindx/OmnidirectionalSightlineActivity.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@
2727
import gov.nasa.worldwind.shape.ShapeAttributes;
2828

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

3537
/**
36-
* The OmnidirectionalSightline displaying visibility on the terrain
38+
* The OmnidirectionalSightline object which will display areas visible using a line of sight from the origin
3739
*/
3840
protected OmnidirectionalSightline sightline;
3941

4042
/**
41-
* A Placemark representing the position of the sightline
43+
* A Placemark representing the origin of the sightline
4244
*/
4345
protected Placemark sightlinePlacemark;
4446

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

5759
// Initialize attributes for the OmnidirectionalSightline
5860
ShapeAttributes viewableRegions = new ShapeAttributes();
59-
viewableRegions.setInteriorColor(new Color(0f, 1f, 0f, 0.25f));
61+
viewableRegions.setInteriorColor(new Color(0f, 1f, 0f, 0.5f));
6062

6163
ShapeAttributes blockedRegions = new ShapeAttributes();
62-
blockedRegions.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.5f));
64+
blockedRegions.setInteriorColor(new Color(0.1f, 0.1f, 0.1f, 0.8f));
6365

6466
// Initialize the OmnidirectionalSightline and Corresponding Placemark
67+
// The position is the line of sight origin for determining visible terrain
6568
Position pos = new Position(46.202, -122.190, 500.0);
6669
this.sightline = new OmnidirectionalSightline(pos, 10000.0);
6770
this.sightline.setAttributes(viewableRegions);

worldwind-examples/src/main/res/menu/activity_drawer.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
android:title="@string/title_placemarks_milstd2525_demo"/>
3434
<item
3535
android:id="@+id/nav_omnidirectional_sightline_activity"
36-
android:icon="@android:drawable/ic_menu_myplaces"
37-
android:title="@string/title_movable_omni_sightline"/>
36+
android:icon="@android:drawable/ic_menu_gallery"
37+
android:title="@string/title_movable_line_of_sight"/>
3838
<item
3939
android:id="@+id/nav_paths_example"
4040
android:icon="@android:drawable/ic_menu_directions"

worldwind-examples/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<string name="title_day_night_cycle">Day and Night Cycle</string>
1414
<string name="title_general_globe">General Purpose Globe</string>
1515
<string name="title_multi_globe">Multi-Globe Demonstration</string>
16-
<string name="title_movable_omni_sightline">Movable OmnidirectionalSightline</string>
16+
<string name="title_movable_line_of_sight">Movable Line of Sight</string>
1717
<string name="title_paths_example">Paths Example</string>
1818
<string name="title_paths_and_polygons">Paths, Polygons &amp; Labels Demonstration</string>
1919
<string name="title_placemarks_demo">Placemarks Demonstration</string>

worldwind-tutorials/src/main/assets/omnidirectional_sightline_tutorial.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@
1414
<link rel="stylesheet" type="text/css" href="file:///android_asset/override.css"/>
1515
</head>
1616
<body>
17-
<h1>OmnidirectionalSightline Tutorial</h1>
17+
<h1>Line Of Sight Tutorial</h1>
1818
<p>
19-
Demonstrates how to create an OmnidirectionalSightline and add it to the globe. An OmnidirectionalSightline provides
20-
a visual area representation of line of sight from a provided position. Areas occluded by terrain will appear in a
21-
different color than areas visible to the provided point.
19+
Demonstrates how to create an OmnidirectionalSightline and add it to the globe to visualize line of sight. An
20+
OmnidirectionalSightline provides a visual area representation of line of sight from a provided origin. Areas
21+
occluded by terrain from line of sight will appear in a different color than areas visible to the provided point.
2222
</p>
2323
<p>
2424
This tutorial demonstrates the creation of an OmnidirectionSightline. In addition to the OmnidirectionalSightline, a
2525
Placemark indicating the position of the sightline origin is added to provide visual context.
2626
</p>
2727
<p>
2828
The regions colored green indicate they are visible from the position provided to the OmnidirectionSightline.
29-
Regions colored gray are occluded by terrain from the provided position. This tutorial uses a sightline range of
30-
10,000 meters.
29+
Regions colored gray are occluded by terrain. This tutorial uses a sightline range of 10,000 meters.
3130
</p>
3231
<h2>Example</h2>
3332
<h3>OmnidirectionalSightlineFragment.java</h3>
@@ -44,7 +43,7 @@ <h3>OmnidirectionalSightlineFragment.java</h3>
4443
// Let the super class (BasicGlobeFragment) do the creation
4544
WorldWindow wwd = super.createWorldWindow();
4645

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

5857
// Create the sightline
5958
OmnidirectionalSightline sightline = new OmnidirectionalSightline(position, range);
60-
// Add the attributes
59+
// Set the attributes
6160
sightline.setAttributes(visibleAttributes);
6261
sightline.setOccludeAttributes(occludedAttributes);
6362

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

69-
// Create a Placemark to help visualize the position of the sightline
68+
// Create a Placemark to visualize the position of the sightline
7069
this.createPlacemark(position, sightlineLayer);
7170

7271
// Position the camera to look at the line of site terrain coverage

worldwind-tutorials/src/main/java/gov/nasa/worldwindx/OmnidirectionalSightlineFragment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public WorldWindow createWorldWindow() {
2828
// Let the super class (BasicGlobeFragment) do the creation
2929
WorldWindow wwd = super.createWorldWindow();
3030

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

4242
// Create the sightline
4343
OmnidirectionalSightline sightline = new OmnidirectionalSightline(position, range);
44-
// Add the attributes
44+
// Set the attributes
4545
sightline.setAttributes(visibleAttributes);
4646
sightline.setOccludeAttributes(occludedAttributes);
4747

worldwind-tutorials/src/main/res/menu/activity_drawer.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
android:id="@+id/nav_surface_image_activity"
3232
android:icon="@android:drawable/ic_menu_mapmode"
3333
android:title="@string/title_surface_image"/>
34+
<item
35+
android:id="@+id/nav_omnidirectional_sightline_activity"
36+
android:icon="@android:drawable/ic_menu_gallery"
37+
android:title="@string/title_omni_sightline"/>
3438
<item
3539
android:id="@+id/nav_camera_view_activity"
3640
android:icon="@android:drawable/ic_menu_compass"
@@ -43,10 +47,6 @@
4347
android:id="@+id/nav_navigator_event_activity"
4448
android:icon="@android:drawable/ic_menu_compass"
4549
android:title="@string/title_navigator_event"/>
46-
<item
47-
android:id="@+id/nav_omnidirectional_sightline_activity"
48-
android:icon="@android:drawable/ic_menu_compass"
49-
android:title="@string/title_omni_sightline"/>
5050
<item
5151
android:id="@+id/nav_placemarks_activity"
5252
android:icon="@android:drawable/ic_menu_myplaces"

worldwind-tutorials/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<string name="title_labels">Labels</string>
2020
<string name="title_look_at_view">Look At View</string>
2121
<string name="title_navigator_event">Navigator Events</string>
22-
<string name="title_omni_sightline">Omnidirectional Sightline</string>
22+
<string name="title_omni_sightline">Line Of Sight</string>
2323
<string name="title_paths">Paths</string>
2424
<string name="title_placemarks">Placemarks</string>
2525
<string name="title_placemarks_picking">Placemark Picking</string>

0 commit comments

Comments
 (0)