skip to main content
Defense > Programmer's documentation > Programming with JViews Maps for Defense > Map Defense GUI interactors > Terrain Cut interactor
 
Terrain Cut interactor
Describes the Terrain Cut interactor.
*Overview
*Explains the use of the IlvMakeTerrainCutInteractor class to draw a polyline representing an irregular cut through a terrain.
*Creating and installing the Terrain Cut interactor
*Provides code for creating the Terrain Cut interactor.
*Using the Terrain Cut interactor
*Describes the functioning of the Terrain Cut interactor and the possible style customization.
*Altitude Chart bean
*Describes the Altitude Chart bean produced with the Terrain Cut interactor.
Overview
The IlvMakeTerrainCutInteractor allows the user to draw a polyline in a manager view representing an irregular cut through the terrain. Each point on the polyline is shown in the line of sight. This enables you to study more complex ways of approaching a given target or to set up a particular defense strategy. If specified, the interactor can also create an Altitude Chart, which displays a vertical view of the terrain altitudes along the polyline in a tabbed pane, see Altitude Chart bean.
The following example shows a Terrain Cut.
Terrain Cut
The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir> /jviews-maps/samples/mapbuilder/index.html
Creating and installing the Terrain Cut interactor
To create the Terrain Cut interactor and Altitude Chart, use the following line of code:
 
IlvMakeTerrainCutInteractor interactor=new
  IlvMakeTerrainCutInteractor(tabbedpane);
The tabbedPane parameter can be null if you do not want the interactor to create a vertical view of the terrain, see Altitude Chart bean.
You can then install this interactor as described in the Using the GUI beans section in Programming with JViews Maps.
Using the Terrain Cut interactor
When the interactor is used, it creates an IlvGraphicLayerDataSource and inserts it into the data source model of the manager. This data source manages a single graphic object, an IlvTerrainCut. This object is a standard polyline that allows control of a bean (the Altitude Chart) whenever its points are moved.
At the same time, the interactor creates an IlvPolylineStyle to display this new graphic object and adds it to the map layer tree under a Terrain Analysis group. The user can use the style of that layer, an IlvPolylineStyle, to customize the appearance of that particular polyline in the map layer tree. A listener is also added to the terrain cut, so that the altitude chart is updated whenever the terrain cut points are moved.
Altitude Chart bean
If specified, the interactor also creates an IlvAltitudeChart in a tabbed pane as soon as the line of visibility is added on the map, see Creating and installing the Terrain Cut interactor. This chart displays a terrain cut along the polyline, identifying the observation point and showing the intermediary points of the polyline.
If the user changes the Terrain Cut polyline, either by using the select tool and moving the polyline points, or by modifying the style parameters, JViews Maps for Defense updates the Altitude Chart.
For further information, see The Altitude Chart bean.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.