VR-Forces 4.1 Class Documentation
List of all members | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtTerrainMapArea Class Reference

DtTerrainMapArea is a class used for drawing and navigation of terrain. More...

Inheritance diagram for DtTerrainMapArea:
Inheritance graph
[legend]

Public Slots

virtual void updateUnits (const QString &u, const QString &, const QString &)
virtual void setTerrainDatabase (const DtTerrainDatabase *t)
 Sets the current database and updates.
virtual void setPaperMapDatabase (const DtPaperMapDatabase *db)
virtual void setDrawerOptions (const DtTdbDrawerOptions &o)
 Sets the current tdb drawer options and updates.
virtual void featuresChanged (DtList *list)
 Called when a feature list has changed, if the DtList is not NULL, then the drawing order has also changed.
virtual void terrainDatabaseModified (DtTerrainDatabase *db, const DtExtent &extent)
 Call when the terrain database has been modified and the background needs to be redrawn.
- Public Slots inherited from DtTMMapArea
virtual void zoomIn ()
 Zooms in tdb view, emits tdbViewChanged, and updates.
virtual void zoomOut ()
 Zooms out tdb view, emits tdbViewChanged, and updates.
virtual void drawRubberBands (QPainter *p)
virtual void clearSelection (bool signal=true)
virtual void changeSelection (const QVector< DtModelKey > &d)
virtual bool addSelection (const QVector< DtModelKey > &d)
 Adds these keys to the selection list if they are not there already.
virtual bool removeSelection (const QVector< DtModelKey > &d)
 Removes these keys from the selection list if they are in it.
virtual void setRightClickMaintainSelection (bool b)
virtual bool rightClickMaintainSelection ()
virtual void forcePersistentSymbol (DtSymbol *s)
virtual void stopForcePersistentSymbol (DtSymbol *s)
virtual void catchViewportChange (const DtTMViewportExtents *v)
virtual bool dragStart ()
 Called when a drag/drop operation is about to start.
virtual void dragComplete ()
 Called when a drag/drop operation is complete, regardless of the success of the operation.
virtual void setFreezeSelection (bool)
 Sets whether or not to freeze current selection regardless of any type of change made.
bool freezeSelection () const
- Public Slots inherited from DtTMArea
virtual void loadDatabaseFile (const QString &)
virtual bool updateAllSymbols ()
 Go through the list of symbols that we have marked for update and update them.
virtual void updateBackground ()
virtual void resizeMapArea ()
virtual DtSymboladdSymbol (const DtModelData &data, bool force=false)
virtual void removeSymbol (const DtModelKey &data, bool force=false)
virtual void setDrawOrderSymbols (bool b)
 Set to true to draw order symbols on the next tick.
virtual void signalDrawOrderSymbols ()
 Signals to draw order the symbols on the next tick.
virtual void drawOrderSymbols ()
 Draw order symbols if at least one first/last draw by having lens area draw order symbols.

Signals

void changedTerrainDatabase (const DtTerrainDatabase *t)
void drawerOptionsChanged (const DtTdbDrawerOptions &)
- Signals inherited from DtTMMapArea
void leftDoubleClick ()
void symbolsSelected (DtSymbolList *)
void selectionChanged (const QVector< DtModelKey > &)
void selectionUpdated (const QVector< DtModelKey > &)
void databasePointSelected (const DtPoint &)
void nullSelected ()
void rightMouseContext (DtSymbolList *, QPoint)
void middleMouseContext (DtSymbolList *, QPoint)
void mouseSignal (QMouseEvent *, const DtPoint &)
 Sent whenever a mouse event happens.
void keyboardSignal (QKeyEvent *)
 Sent whenever a key event happens.
void focusEventSignal (QEvent *)
 Sent whenever a you leave the focus area.
void enterEventSignal (QEvent *)
void leaveEventSignal (QEvent *)
void activateMap (DtTMMapArea *)
void dropEventSignal (QDropEvent *)
void dragEnterEventSignal (QDragEnterEvent *)
void dragLeaveEventSignal (QDragLeaveEvent *)
void dragMoveEventSignal (QDragMoveEvent *)
void selectionInProgress (DtSymbolSelector &symbolSelector)
 Sent whenever a selection is in process (i.e. before mouse is released)
void selectedModelDataUpdated ()
 Sent whenever the selected model data is updated.
void aboutToDraw (QPainter *map)
 Sent when the lens area is about to draw.
void selectionModeChanged (int iNewMode)
 Sent when the selection mode has changed.
void frozenChanged (bool)
 Emitted when frozen selection changes.
- Signals inherited from DtTMArea
void viewportExtentsSet (const DtTMViewportExtents *v)
 Called after setTdbView.
void viewportExtentsChanged (const DtTMViewportExtents *v)
 Called after internally changing tdb view.
void newDatabaseFile (const QString &)
void removingSymbol (const DtModelKey &data)
 Called when removing, adding or modifying a symbol.
void addingSymbol (const DtModelKey &data)
void modifyingSymbol (const DtModelKey &data)
void resized ()
 Sent when this area has resized.
void modelDataMarkedForUpdated (const DtModelData &d)
void modelDataRemovedFromUpdate (const DtModelData &)

Public Member Functions

 DtTerrainMapArea (QWidget *parent=NULL, const Qt::WindowFlags &flags=0)
 Constructor.
virtual ~DtTerrainMapArea ()
 Destructor.
virtual const DtTdbDrawerOptionsdrawerOptions () const
 Get tdb drawer options.
virtual double getDatabaseHeight (double x, double y) const
virtual void setTerrainSelectionMode (DtTerrainSelector::DtTerrainSelectionMode mode)
 Selection modes.
virtual bool terrainSelectionMode () const
virtual DtPoint databasePoint (int x, int y) const
 Given the windows coordinate, return the database point (local)
virtual bool terrainLoaded () const
virtual DtTacticalGdbDrawertdbDrawer () const
 Returns the background's tacticalGdbDrawer.
virtual void markForUpdate (const DtModelData &d, bool emitSignal=true)
- Public Member Functions inherited from DtTMMapArea
 DtTMMapArea (QWidget *parent=0, const Qt::WindowFlags &flags=0)
virtual ~DtTMMapArea ()
virtual void setSelectorType (DtSymbolSelector::DtSelectorType type)
virtual DtSymbolSelectorsymbolSelector ()
virtual DtSymbolListselectedSymbols ()
virtual const QVector
< DtModelKey > & 
selectedModelKeys () const
 Returns mySelectedModelKeys.
virtual QVector< DtModelKey > & selectedModelKeys ()
virtual bool leftButtonClicked ()
virtual bool tick ()
 Check to see if need to draw order.
virtual void setActivateMap ()
 Activate the map.
virtual void updateSelectedModelData ()
virtual void setResetLabelPositions (bool b)
 Signal to tell the symbol updater to reset label positions (or not) on next tick.
virtual void clear ()
 Clears out selected symbols and drawn symbols.
virtual void removeFromPersistentData (const QString &key)
virtual void applyOptions (DtSymbol *s)
 This routine will ask the symbol updater to apply the options for the supplied symbol.
DtObjectSelectorobjectSelector ()
virtual bool startNullSelectionMode (bool showHandCursor=false)
 Routines that will allow certain valid selections on the map area Start null selection mode.
virtual bool startNormalSelectionMode ()
 Start normal selection mode.
virtual bool startSymbolPointSelectionMode (int selectionMode, bool showHandCursor=false, bool reset=false, bool backup=true, bool force=false)
virtual bool startSymbolRectangleSelectionMode (int selectionMode, bool showHandCursor=false, bool reset=false, bool backup=true, bool force=false)
virtual bool startSelectionMode (int selectionMode, DtSymbolSelector::DtSelectorType type, bool showHandCursor=false, bool reset=false, bool backup=true, bool force=false)
 General selection function.
virtual void swapModelKeys (QVector< DtModelKey > &orig, QVector< DtModelKey > &save, QVector< DtModelKey > &display)
virtual int symbolSelectionMode () const
const DtPointlastSelectedPoint () const
virtual void removeSymbol (const DtModelData &data, bool force)
 Removes the symbol from the map area and from any internal selected lists.
virtual DtSymbolSelectorsetCurrentSelector (DtSymbolSelector *s)
 Returns the current symbol selector after setting to new selector.
virtual DtSymbolSelectorcurrentSelector ()
virtual void setObjectSelectionMode (const DtFilter *f=NULL, bool swapKeys=false)
 Selection modes.
virtual bool inObjectSelectionMode () const
 Returns true if this area is in object selection mode.
virtual DtSymbolsymbolAtLocation (const DtPoint &pnt) const
 Asks the object selector (if it exists) to return the symbol at the specified database location.
virtual bool event (QEvent *)
 Only exposed for public access.
- Public Member Functions inherited from DtTMArea
 DtTMArea (QWidget *parent=0, const Qt::WindowFlags &flags=0)
virtual ~DtTMArea ()
virtual void setSymbolMapper (DtBaseSymbolMapper *mapper)
virtual DtBaseSymbolMappergetSymbolMapper ()
virtual DtTMSymbolUpdatersymbolUpdater ()
virtual DtTMViewportExtentsviewportExtents () const
 Gets the current viewport extents.
virtual DtViewDriverviewDriver () const
 Gets the current view driver.
virtual void setViewDriver (DtViewDriver *v)
 Sets the current view driver.
virtual DtTMBackgroundbackground () const
 Gets the current background.
virtual void setBackground (DtTMBackground *v)
 Sets the current background.
virtual void setSymbolLensArea (DtSymbolLensArea *area)
virtual DtSymbolLensAreasymbolLensArea ()
virtual bool isInitialized ()
virtual DtModelDataDictModelDataDict ()
 Returns the local list of Symbol Datas.
virtual DtModelDataIterModelDataIter () const
 Returns the local list of Symbol Datas.
virtual DtModelDataIterCombinedModelDataIter () const
 Returns the combined list of global application and local model data.
virtual void setUpdateOnTick (bool b)
 Set the fact that this area will also refresh its display on a tick.
virtual void markForUpdate (const QVector< DtModelKey > &, bool emitSignal=true)
 Copy the model data from the supplied list to our internal update list that will be updated on the next call to updateAllSymbols.
virtual void markForUpdate (DtModelDataIter *iter, bool emitSignal=true)
virtual void removeFromUpdate (DtModelDataIter *iter)
 Call these to remove model datas for update.
virtual void removeFromUpdate (const DtModelData &data)
virtual void removeDictionaryEntry (const DtModelKey &key)
 Removes this entry from the local dictionary.
virtual void setUpdateBackgroundOnTick (bool b)
 Set to true to call updateBackground on next tick.
void setNextTickIsRepaint (bool b)
 Set to have the next update (if the area is updated in a tick) to be a repaint rather than an update.
bool nextTickIsRepaint () const
virtual bool needsTick () const
 Return true if this area needs to be ticked.
virtual bool needsUpdate () const
 Return true if this area needs update because myUpdateData.count() is not zero.
virtual DtSymboladdSymbol (const DtModelData &data, DtSymbol *symbol)
 Adds a new symbol with the associated model data to the map area.
virtual void read (QTextStream &ts)
 Archival operators.
virtual void write (QTextStream &ts)
virtual void clearSymbols ()
virtual void setForceTickOnViewportChange (bool b)
 Set this to true to force a tick when the viewport has changed (to speed drawing on map areas).
virtual bool forceTickOnViewportChange () const
virtual void paint (QPainter *painter, bool paintBackground=true)
 Draw to the supplied device. Draws the background (if specified) and the lens area.
virtual void redrawBackground ()
virtual DtSymbolgetSymbol (const DtModelKey &) const
 Returns a symbol from the view driver for the given model key (if exists)
void setAlwaysResizeToGlobalView (bool)
 If true, when map area is resized, always go back to global view.
bool alwaysResizeToGlobalView () const
void setWindow (DtBaseWindow *)
DtBaseWindowwindow () const
virtual bool needsDrawOrder () const
 Return true/false depending on whether or not the area cares about draw ordering symbols.
virtual void insertIntoDrawOrder (DtSymbol *)
 Insert symbol into lens area draw order.

Static Public Member Functions

static DtTMMapAreacreate (QWidget *parent, const Qt::WindowFlags &f)
 Returns a newly created instance of a DtTerrainMapArea.

Protected Member Functions

virtual bool initViewportExtents (const DtTMFactory *f)
virtual bool initTerrainSelector (const DtTMFactory *f)
virtual bool init (const DtTMFactory *f)
 Initializer. MUST BE CALLED.
- Protected Member Functions inherited from DtTMMapArea
virtual void setViewportExtents (const DtTMViewportExtents *v)
virtual void modifySymbol (const DtModelData &data)
virtual bool initViewDriver (const DtTMFactory *f)
virtual bool initObjectSelector (const DtTMFactory *f)
virtual void updateSymbolSelection (Qt::KeyboardModifiers keyState, Qt::MouseButtons mouseState, bool updateInternalSelection=true)
virtual void updateSelectedSymbols (const QVector< DtModelKey > &selectedKeys)
virtual void updatePersistentModelData ()
virtual void highlightNoSymbols ()
virtual void highlightSymbols (QVector< DtModelKey > *display=NULL)
virtual void mousePressEvent (QMouseEvent *e)
 Event overloads.
virtual void mouseReleaseEvent (QMouseEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)
virtual void mouseDoubleClickEvent (QMouseEvent *e)
virtual void keyPressEvent (QKeyEvent *e)
virtual void keyReleaseEvent (QKeyEvent *e)
virtual void wheelEvent (QWheelEvent *e)
virtual void focusOutEvent (QFocusEvent *e)
virtual void leaveEvent (QEvent *e)
virtual void enterEvent (QEvent *e)
virtual void mouseSelect (QMouseEvent *e)
virtual void mousePressSelect (QMouseEvent *e)
virtual void dragEnterEvent (QDragEnterEvent *e)
 Drag/Drop code.
virtual void dragLeaveEvent (QDragLeaveEvent *e)
virtual void dragMoveEvent (QDragMoveEvent *e)
virtual void dropEvent (QDropEvent *e)
- Protected Member Functions inherited from DtTMArea
 DtTMArea (const DtTMArea &orig)
 Not implemented.
DtTMAreaoperator= (const DtTMArea &rhs)
 Not implemented.
virtual bool initLensArea (const DtTMFactory *f, bool useGL=false)
virtual bool initBackground (const DtTMFactory *f)
virtual void resizeEvent (QResizeEvent *e)
 Resize event.
virtual void showEvent (QShowEvent *e)

Protected Attributes

DtArchivableDrawerOptions myDrawerOptions
DtTerrainSelectormyTerrainSelector
- Protected Attributes inherited from DtTMMapArea
DtObjectSelectormyObjectSelector
DtSymbolSelectormyCurrentSelector
QVector< DtModelKeymyTemporarySelectedModelData
QVector< DtModelKeymySelectedModelKeys
QStringList myPersistentModelData
DtSymbolList myForcedPersistentModelData
DtSymbolList mySelectedSymbols
QPoint myMouseBegin
QPoint myMouseLast
DtPointmyLastSelectedPoint
bool myIsActivated
bool myRightClickMaintainSelection
Qt::MouseButtons myButtonState
Qt::KeyboardModifiers myKeyState
bool mySingleSelection
bool myFreezeSelection
int myKeyPressed
- Protected Attributes inherited from DtTMArea
DtViewDrivermyViewDriver
DtTMViewportExtentsmyViewportExtents
bool myDelayGlobalResize
DtSymbolLensAreamyLensArea
bool myDeleteLensArea
QPixmap * myBackground
QTimer myResizeTimer
DtTMBackgroundmyTMBackground
bool myDeleteBackground
DtModelDataDict myModelDataDict
DtModelDataItermyModelDataIter
DtModelDataItermyCombinedModelDataIter
bool myFirstTick
bool myUpdateOnTick
QHash< DtModelKey, DtModelData * > myUpdateData
bool myUpdateOnlyModified
bool myIsInitialized
bool myUpdateBackgroundOnTick
bool myForceTickOnViewportChange
bool myNextTickIsRepaint
DtArchiver myArchiver
 Used to write out any variables that want to be saved.
bool myAlwaysResizeToGlobalView
DtBaseWindowmyWindow
bool myNeedsDrawOrder
bool myInTick

Private Member Functions

 DtTerrainMapArea (const DtTerrainMapArea &orig)
 Not implemented.
DtTerrainMapAreaoperator= (const DtTerrainMapArea &rhs)
 Not implemented.

Additional Inherited Members

- Protected Slots inherited from DtTMArea
virtual void catchViewportChange (const DtTMViewportExtents *v)
virtual void symbolAdded (const DtModelKey &data)
 Called when the view driver adds or removes a symbol.
virtual void symbolAdded (const DtSymbol *)
virtual void symbolRemoved (const DtModelKey &data)
virtual void symbolRemoved (const DtSymbol *)

Detailed Description

DtTerrainMapArea is a class used for drawing and navigation of terrain.

Slots are provided for navigation calls, and all of them currently result in a redraw of the terrain. This class must be initialized with the proper drawers. DtPixmapTerrain provides the drawing functionality, while DtTdbView provides the navigation.

Constructor & Destructor Documentation

DtTerrainMapArea::DtTerrainMapArea ( QWidget parent = NULL,
const Qt::WindowFlags &  flags = 0 
)

Constructor.

virtual DtTerrainMapArea::~DtTerrainMapArea ( )
virtual

Destructor.

DtTerrainMapArea::DtTerrainMapArea ( const DtTerrainMapArea orig)
private

Not implemented.

Member Function Documentation

virtual const DtTdbDrawerOptions& DtTerrainMapArea::drawerOptions ( ) const
virtual

Get tdb drawer options.

virtual double DtTerrainMapArea::getDatabaseHeight ( double  x,
double  y 
) const
virtual

Reimplemented from DtTMMapArea.

virtual void DtTerrainMapArea::setTerrainSelectionMode ( DtTerrainSelector::DtTerrainSelectionMode  mode)
virtual

Selection modes.

virtual bool DtTerrainMapArea::terrainSelectionMode ( ) const
virtual
virtual DtPoint DtTerrainMapArea::databasePoint ( int  x,
int  y 
) const
virtual

Given the windows coordinate, return the database point (local)

virtual bool DtTerrainMapArea::terrainLoaded ( ) const
virtual

Reimplemented from DtTMArea.

virtual DtTacticalGdbDrawer* DtTerrainMapArea::tdbDrawer ( ) const
virtual

Returns the background's tacticalGdbDrawer.

virtual void DtTerrainMapArea::markForUpdate ( const DtModelData d,
bool  emitSignal = true 
)
virtual

Reimplemented from DtTMArea.

static DtTMMapArea* DtTerrainMapArea::create ( QWidget parent,
const Qt::WindowFlags &  f 
)
static

Returns a newly created instance of a DtTerrainMapArea.

Reimplemented from DtTMMapArea.

virtual void DtTerrainMapArea::updateUnits ( const QString &  u,
const QString &  ,
const QString &   
)
virtualslot
virtual void DtTerrainMapArea::setTerrainDatabase ( const DtTerrainDatabase t)
virtualslot

Sets the current database and updates.

virtual void DtTerrainMapArea::setPaperMapDatabase ( const DtPaperMapDatabase db)
virtualslot
virtual void DtTerrainMapArea::setDrawerOptions ( const DtTdbDrawerOptions o)
virtualslot

Sets the current tdb drawer options and updates.

virtual void DtTerrainMapArea::featuresChanged ( DtList *  list)
virtualslot

Called when a feature list has changed, if the DtList is not NULL, then the drawing order has also changed.

virtual void DtTerrainMapArea::terrainDatabaseModified ( DtTerrainDatabase db,
const DtExtent extent 
)
virtualslot

Call when the terrain database has been modified and the background needs to be redrawn.

void DtTerrainMapArea::changedTerrainDatabase ( const DtTerrainDatabase t)
signal
void DtTerrainMapArea::drawerOptionsChanged ( const DtTdbDrawerOptions )
signal
virtual bool DtTerrainMapArea::initViewportExtents ( const DtTMFactory f)
protectedvirtual

Reimplemented from DtTMArea.

virtual bool DtTerrainMapArea::initTerrainSelector ( const DtTMFactory f)
protectedvirtual
virtual bool DtTerrainMapArea::init ( const DtTMFactory f)
protectedvirtual

Initializer. MUST BE CALLED.

Reimplemented from DtTMMapArea.

DtTerrainMapArea& DtTerrainMapArea::operator= ( const DtTerrainMapArea rhs)
private

Not implemented.

Member Data Documentation

DtArchivableDrawerOptions DtTerrainMapArea::myDrawerOptions
protected
DtTerrainSelector* DtTerrainMapArea::myTerrainSelector
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)