![]() |
VR-Forces 4.1.1 Class Documentation
|
This widget is a convenience class that will allow the loading and display of terrain and map files. More...

Public Member Functions | |
| DtTerrainDisplayWidget (QWidget *parent, Qt::WindowFlags flags=0) | |
| virtual | ~DtTerrainDisplayWidget () |
| virtual bool | load (const DtFilename &f) |
| Terrain related methods. | |
| virtual void | setTerrainDatabase (const DtTerrainDatabase *, bool redisplay=true) |
| When set, will cause the display to be updated with new terrain contents if redisplay flag is true. | |
| const DtTerrainDatabase * | terrainDatabase () const |
| virtual void | setPaperMapDatabase (const DtPaperMapDatabase *, bool redisplay=true) |
| When set, will cause the display to be updated with new paper map contents if redisplay flag is true. | |
| const DtPaperMapDatabase * | paperMapDatabase () const |
| void | setEnableKeyboardSupport (bool) |
| If set to true, will map keyboard to movement of terrain map. | |
| bool | enableKeyboardSupport () const |
| virtual void | resetToGlobalView () |
| Terrain movement calls. | |
| virtual void | zoomIn () |
| virtual void | zoomOut () |
| virtual void | panNorthwest () |
| virtual void | panNorth () |
| virtual void | panNortheast () |
| virtual void | panEast () |
| virtual void | panSoutheast () |
| virtual void | panSouth () |
| virtual void | panSouthwest () |
| virtual void | panWest () |
| virtual const double & | panStep () const |
| virtual void | setPanStep (const double &step) |
| virtual const double & | zoomStep () const |
| virtual void | setZoomStep (const double &step) |
| virtual void | setDisplayExtent (const DtExtent &) |
| Sets the extent to display for the map area. | |
Protected Member Functions | |
| virtual void | resizeEvent (QResizeEvent *r) |
| Overridden to resize internal pixmap that is used to draw terrain onto. | |
| virtual void | keyPressEvent (QKeyEvent *) |
| Overridden to see if keyboard support is enabled. | |
| virtual bool | processMovementKey (QKeyEvent *) |
| Return true if key is handled. Also calls appropriate movement/zoom method for mapped key. | |
| virtual void | paintTerrain () |
| Uses myTerrainDrawer to draw terrain onto the myBackground variable. | |
| virtual void | paintEvent (QPaintEvent *) |
| Overridden to paint terrain pixmap onto widget. | |
| virtual DtQtDrawer * | createTerrainPainter () const |
| Override to supply a different terrain painter. | |
This widget is a convenience class that will allow the loading and display of terrain and map files.
A terrain can be displayed in this widget by either calling the load() method to load a terrain or by calling the setTerrainDatabase method. If papermaps are to be displayed, and the load() method is not used, the setPapermapDatabase call can be made to display papermaps.
While this widget does not support the automatic panning and zooming of the display, the pan and zoom routines can be used to adjust the map area display. If you wish to enable panning and zooming by the keypad, call setEnableKeyboardSupport(true). This will map the keyboard (including arrow and +/- keys) to pan and zoom of the map area. You can change the pan or zoom step size by calling the various set routines.
| DtTerrainDisplayWidget::DtTerrainDisplayWidget | ( | QWidget * | parent, |
| Qt::WindowFlags | flags = 0 |
||
| ) |
|
virtual |
|
virtual |
Terrain related methods.
Loads and displays the supplied database or map file. If successful, the internal myTerrainDatabase and myPaperMapDatabase are set and the screen is redrawn. If the terrain is not successfully loaded, the variables will be cleared out and the terrain will be redrawn with the erase color
|
virtual |
When set, will cause the display to be updated with new terrain contents if redisplay flag is true.
|
inline |
References myTerrainDatabase.
|
virtual |
When set, will cause the display to be updated with new paper map contents if redisplay flag is true.
|
inline |
References myPaperMapDatabase.
|
inline |
If set to true, will map keyboard to movement of terrain map.
References myKeyboardSupport.
|
inline |
References myKeyboardSupport.
|
protectedvirtual |
Overridden to resize internal pixmap that is used to draw terrain onto.
Also will cause a redraw of the terrain to the new widget size by calling paintTerrain()
|
protectedvirtual |
Overridden to see if keyboard support is enabled.
If it is, process key for map movement, else call parent event. Calls processMovementKey to see if the event is handled.
|
protectedvirtual |
Return true if key is handled. Also calls appropriate movement/zoom method for mapped key.
|
protectedvirtual |
Uses myTerrainDrawer to draw terrain onto the myBackground variable.
Uses a DtQtDrawer to display terrain as default. To use a different drawer, override the createTerrainPainter() method to create a different type of drawer. The drawer will be created the first time the terrain is painted
|
protectedvirtual |
Overridden to paint terrain pixmap onto widget.
|
protectedvirtual |
Override to supply a different terrain painter.
|
virtual |
Terrain movement calls.
Passes down to viewport extents based on existing pan/zoom ratios Call set routines to change those default ratios
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Sets the extent to display for the map area.
Will square it up with screen size before setting
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by terrainDatabase().
|
protected |
Referenced by paperMapDatabase().
|
protected |
Referenced by enableKeyboardSupport(), and setEnableKeyboardSupport().