Fly Through interactor
Describes the Fly Through interactor.
Explains the use of the
IlvMake3DFlyThroughInteractor class to display a trajectory in a 3D View and simulate an approach to a target.
Provides code for creating the Fly Through interactor.
Describes the functioning of the Fly Through interactor, the possible style customization and the available GUI interactor.
Overview
The
IlvMake3DFlyThroughInteractor allows the user to display a trajectory in a 3D View and simulate an approach to a target for ground vehicles, foot soldiers, or for fighter planes that fly close to the ground. With the Fly Through interactor, you have all the functionality and operations of the 3D View available.
The following figure shows an example of a Fly Through.
Fly Through
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-defense/samples/3dview/index.htmlCreating and installing the Fly Through interactor
To create the Fly Through interactor and Fly Through menu, use the following line of code:
IlvMake3DFlyThroughInteractor interactor=new IlvMake3DFlyThroughInteractor();
You can then install this interactor as described in the
Using the GUI beans section in
Programming with JViews Maps.
Using the Fly Through 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
IlvMapTerrainFlyThrough. This object is a standard polyline that allows control of a bean (the Fly Through) whenever its points are moved.
At the same time, the interactor creates an
IlvFlyThroughStyle to display this new graphic object and adds it to the map layer tree under a Fly Through group. The user can use the style of that layer, an
IlvFlyThroughStyle, to customize the appearance of that particular polyline in the map layer tree. A listener is also added to the polyline, so that the Fly Through action is updated whenever its points are moved.
Graphical User Interface Interactor
If one or more 3D Views are available, the Fly Through interactor also adds an action to them on the toolbar and shortcut menu. This is in the form of a IlvFlyThroughAction, which is carried out by a call to:
Ilv3DView.registerFlyThrough(flyThoughLayer,flyThroughAction);
The IlvFlyThroughAction bean enables the user to start and stop the Fly Through. When started, it registers a thread (through Ilv3DView.setCameraMovingThread ) that regularly changes the camera position and orientation.
If the user changes the Fly Through trajectory using the select tool or by modifying the style parameters, JViews Maps for Defense updates the trajectory and Action button to reflect these changes.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.