![]() |
VR-Forces Developer's Guide
|
This class will display a terrain profile graph, which is the graph of a distance over a line and the altitudes of the terrain along sample points along that line. The Qwt toolkit is used for the actual rendering of the graph. This widget will calculate the points on the graph to display as well as manage helper classes to show tracked symbols and the provider of point data for this graph. It listens to signals sent by the DtTerrainProfileSettingsManager to indicate when graph settings have changed and apply them to this graph.
If you wish to use this object and supply your own (or existing) data, you must create a DtTerrainProfileDataProvider object to provide data that this class needs in order to render the graph

Public Types | |
| enum | ReplotFlag { FullReplot = 0x00000001, ReplotPoints = 0x00000002, UpdateGraphOnly = 0x00000004 } |
| enum | LineSampleStyle { DisplayAllSamplesStraight, DisplayAllSamplesFollowCurvature, DisplayVerticesOnly } |
Public Member Functions | |
| DtTerrainProfileWidget (makVrv::DtDe &de, QWidget *parent=NULL, const Qt::WindowFlags &flags=0) | |
| virtual | ~DtTerrainProfileWidget () override |
| virtual void | init () |
| virtual void | setDataProvider (DtTerrainProfileDataProvider *) |
| virtual void | replot () |
| virtual void | setSamplingRate (double) |
| double | samplingRate () const |
| virtual void | setMaximumSamplingPoints (int) |
| int | maximumSamplingPoints () const |
| virtual void | setUseBackendForProfile (bool) |
| bool | useBackendForProfile () const |
| bool | replotting () const |
| virtual void | clearGraph () |
| virtual bool | backendCanBeUsedForProfileData () const |
| virtual bool | allDataFromFrontEnd () const |
| virtual bool | allDataFromBackEnd () const |
| virtual void | labelDataForTerrainProfilePosition (const QPointF &pos, const DtVector &geoc, double distanceOnLine, double height, int soilType=0) |
| bool | hasVertices () const |
| virtual void | setReplotTime (int) |
| int | replotTime () const |
| virtual void | setScaleFactor (double) |
| double | scaleFactor () const |
| virtual void | suspend () |
| virtual void | resume () |
| virtual bool | isSuspended () const |
| virtual void | setShowVertices (bool) |
| bool | showVertices () const |
| virtual void | setShowVertexNumbers (bool) |
| bool | showVertexNumbers () const |
| virtual void | setSuspendForMovement (bool) |
| virtual bool | suspendForMovement () const |
| virtual void | setDistanceMoveTolerance (double) |
| virtual double | distanceMoveTolerance () const |
| virtual QString | dataStatus () const |
| virtual void | requestPlotPointsIfNeeded (bool force=false) |
| virtual void | setLineStyle (LineSampleStyle sampleDisplay, Qt::PenStyle style, unsigned size) |
| virtual void | setDisplayOnBehalfOf (const std::set< makVrv::DtUniqueID > &) |
| const std::set < makVrv::DtUniqueID > & | displayOnBehalfOf () const |
Public Attributes | |
| boost::signals2::signal< void()> | signal_ready |
| boost::signals2::signal< void()> | signal_dataStatusChanged |
| boost::signals2::signal< void(int)> | signal_replotted |
| QwtPlot * | myTerrainProfileGraph |
| QVBoxLayout * | myMainLayout |
| QwtPlotCurve * | myTerrainLine |
| QwtPlotCurve * | myTerrainProfile |
| QwtPlotPicker * | myPlotPicker |
| QLabel * | mySelectedPointLabel |
| QLabel * | mySelectedPoint |
Static Public Attributes | |
| static QColor | theTerrainProfileLineColor |
Protected Types | |
| typedef std::map < makVrv::DtElementID, QwtPlotMarker * > | TrackedEntities |
| typedef std::map < makVrv::DtUniqueID, DtVector > | WaitingForPlot |
Protected Slots | |
| virtual void | plotMouseReleased (const QPointF &) |
Protected Member Functions | |
| virtual void | createProfileGraph () |
| virtual void | initConnections () |
| virtual bool | updateProfileData () |
| virtual void | slot_dataUpdated () |
| virtual void | slot_dataRemoved () |
| virtual void | calculateReplotRanges (std::vector< QPoint > &) const |
| virtual double | calculateLineLength (const std::vector< DtVector > &) const |
| virtual double | calculateSegment (const QPoint &segment, double lineLength) |
| virtual double | segmentLength (const QPoint &) const |
| virtual double | segmentLength (int start, int end) const |
| virtual double | terrainHeight (const DtVector &, int position=-1) const |
| virtual double | lineHeight (int pos) const |
| virtual void | setupLabels () |
| virtual void | slot_onUnitChanged (const makVrv::DtUnicode &category, const makVrv::DtUnicode &type, int to, int from) |
| virtual double | altitudeValueFor (double) const |
| virtual double | distanceValueFor (double) const |
| virtual double | altitudeFromDisplayValue (double) const |
| virtual double | distanceFromDisplayValue (double) const |
| virtual void | convertAltitudeAndDistance (int newAltitudeUnits, int newDistanceUnits, bool replot=true) |
| virtual void | convertAltitudeAndDistance (QVector< QPointF > &, int newAltitudeUnits, int newDistanceUnits) const |
| virtual void | convertAltitudeAndDistance (QwtPlotMarker *, int newAltitudeUnits, int newDistanceUnits) const |
| virtual void | deferredReplot (int flag=FullReplot) |
| virtual QwtPlotMarker * | addMarker (double x, double y) |
| virtual void | setupPointMarkerLabel () |
| virtual void | onTerrainProfileSettingsChanged (const DtTerrainProfileSettingsRecord &) |
| virtual void | createSymbolTracker () |
| virtual void | trackEntity (const DtVector &geocentricPosition, DtSimObjectReference) |
| virtual void | stopTrackingEntity (makVrv::DtElementID) |
| virtual void | clearTrackingSymbols (bool suspended=false) |
| virtual QwtSymbol * | symbolFor (DtSimObjectReference) const |
| virtual int | linePositionFromLocation (const DtVector &geocentricLocation, QPointF &result, bool trackedItem=false) const |
| virtual int | locationFromPlotPosition (const QPointF &result, DtVector &geocentricLocation) const |
| virtual int | closestPoint (const DtVector &v, double &range, double &totalRange, bool trackedItem=false) const |
| virtual void | timedReplot () |
| virtual void | replotIfTime () |
| virtual void | updateLineVertices (bool replot=true) |
| virtual void | resetAltitudeScale (bool replot=true) |
| virtual double | elevationAngle (const DtVector &geocentricFrom, const DtVector &geocentricTo) const |
| virtual void | slot_defaultIconListChanged () |
| virtual void | slot_dataFrozenStateChanged (bool) |
| virtual void | processIntersectionResponse (DtSimMessage *msg) |
| virtual void | processPointMarkerResponse (DtSimMessage *msg) |
| virtual void | cancelTerrainInformationRequest () |
| virtual void | requestPointMarkerInformation (const DtVector &) |
|
protected |
Map of plot markers for entities being tracked.
|
protected |
| makVrf::DtTerrainProfileWidget::DtTerrainProfileWidget | ( | makVrv::DtDe & | de, |
| QWidget * | parent = NULL, |
||
| const Qt::WindowFlags & | flags = 0 |
||
| ) |
Constructor.
|
overridevirtual |
Destructor.
|
virtual |
Initializes the widget by creating GUI (plot) elements and initializing member variables. To use this to start a profile line for a particular item, call the setDataProvider() method with the provider of the object you wish to profile.
|
virtual |
Sets the data provider for this graph. Does not take ownership of the pointer, so, it is up to the developer to free the data provided.
|
virtual |
Redraws the graph given the existing profile data and settings.
|
virtual |
Sets the frequency in distance to check along the line for terrain points.
| double makVrf::DtTerrainProfileWidget::samplingRate | ( | ) | const |
|
virtual |
Sets the maximum number of points to check.
| int makVrf::DtTerrainProfileWidget::maximumSamplingPoints | ( | ) | const |
|
virtual |
|
inline |
|
inline |
|
virtual |
Clears the graph of all data.
|
virtual |
Whether or not the back-end can be used for profile data.
|
virtual |
Whether or not all the data is from the front-end.
|
virtual |
Whether or not all the data is from the back-end.
|
virtual |
Sets the label information for the geocentric position, height and soil type.
|
inline |
|
virtual |
Sets the time (in milliseconds) to wait before doing a replot. This will be used when replotting from paging in terrain as to not continually replot as many pages might page in at once. Default is 5 seconds.
| int makVrf::DtTerrainProfileWidget::replotTime | ( | ) | const |
|
virtual |
Value to scale difference between max and min height of terrain. will provide a buffer above the maximum height Default is 1.0. Factor will not be allowed to go below 1.0.
| double makVrf::DtTerrainProfileWidget::scaleFactor | ( | ) | const |
|
virtual |
Suspends this graph. This means that there shall be no updates made to this graph.
|
virtual |
Resumes graph updates. Will do a full replot.
|
virtual |
Returns true if this graph has been suspended.
|
virtual |
If true will put a vertex marker at each point on the line.
| bool makVrf::DtTerrainProfileWidget::showVertices | ( | ) | const |
|
virtual |
If true will put a number label next to each vertex marker.
| bool makVrf::DtTerrainProfileWidget::showVertexNumbers | ( | ) | const |
|
virtual |
Sets whether or not the symbol tracker will suspend if the line points are changing. Default is true.
|
virtual |
|
virtual |
Distance a tracked entity must move to signal an update. Default is 10 meters.
|
virtual |
|
virtual |
Text which represents the current source of data (Front-End, Back-End or # points received from Back-End)
|
virtual |
Requests data from server. Set force to true to force even if data is not frozen.
|
virtual |
|
virtual |
If the route is displayed on behalf of something in the system (i.e. a rotary wing or fixed wing like in the move along route with action dialog) set that here so the correct units can be displayed.
|
inline |
|
protectedvirtual |
Create the graph object that will be used to show the terrain profile.
|
protectedvirtual |
Initializes any connections (boost or Qt) needed to support this graph.
|
protectedvirtual |
Updates local data represented by the profile id to watch. If data has changed will return true, else false.
|
protectedvirtual |
Called when the state view is updated, if profile data is updated will redraw the graph.
|
protectedvirtual |
Called when an object is about to be removed, will clear the graph.
|
protectedvirtual |
Figures out the range to recalculate points for in line plot. The points are pairs, so, if more than one range needs to be recalculated, it will contain multiple entries.
|
protectedvirtual |
Returns the length of the line given the number of points. Only calculates on X/Y plane. Does not take Z coordinate into account. Points must be in geocentric.
|
protectedvirtual |
Calculates the points for the curve along the given segment of the line. Returns the length of the segment.
|
protectedvirtual |
Convenience routines to calculate the length of a segment of a line.
|
protectedvirtual |
|
protectedvirtual |
Returns terrain height at geocentric position.
Returns the height of the line at the given position.
|
protectedvirtual |
Sets labels for the graph based on current display unit settings.
|
protectedvirtual |
Called when unit display settings change, see if any graph data needs to change.
Reimplemented in makVrf::DtRouteProfileWidget.
Given current display units settings, return altitude or distance for those settings based on meters.
|
protectedvirtual |
Given current display units settings, return altitude or distance in meters from the given display value.
|
protectedvirtual |
|
protectedvirtual |
Given the current altitude and distance settings, convert to the new settings and redisplay graph.
|
protectedvirtual |
Converts x (distance) and y (altitude) in place in the vectors.
|
protectedvirtual |
|
protectedvirtual |
Connect to DE pre-tick to replot graph. If full does a full redraw of graph, else just a simple replot.
|
protectedvirtual |
Adds a point marker to the x, y coordinate.
|
protectedvirtual |
Sets the label on the point marker to the current point location.
|
protectedvirtual |
Called when terrain profile settings change, modify graph to match.
|
protectedvirtual |
Creates a symbol tracker to track symbols within a certain range near the line. The symbol tracker will emit signals for symbols coming near the line, moving away from the line and moving if they are tracked. This class will show the plot symbols for those tracked symbols.
|
protectedvirtual |
Start tracking or continue tracking the given entity.
|
protectedvirtual |
Stop tracking entity.
|
protectedvirtual |
Clears out all symbols being tracked and deletes the symbol tracker.
|
protectedvirtual |
Returns a symbol for the given sim state view to be placed on the plot graph.
|
protectedvirtual |
Given a geocentric point, convert point to a position on the line of distance along the line and height. Returns the segment hit.
|
protectedvirtual |
Given a position on the line of distance along the line and height, return a geocentric point. Returns the segment hit.
|
protectedvirtual |
Given a geocentric coordinate, find the closest point to that on the line being plotted. The range variable will contain the current distance to get to the segment for the closest point, the totalRange along the line left, and the method will return the segment hit. If the method returns -1, no segment is valid.
|
protectedvirtual |
Method called when a page tile is loaded. If timer is not started, restarts, else, checks elapsed time. If
than replotTime, replots and removes current timer
|
protectedvirtual |
|
protectedvirtual |
Updates the vertices on the line.
|
protectedvirtual |
|
protectedvirtual |
Returns elevation angle from point to point.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtualslot |
Called when the mouse is released on the plot area, will show a mark on the terrain line and information about that point.
| boost::signals2::signal<void ()> makVrf::DtTerrainProfileWidget::signal_ready |
Signal only once when graph is ready to show (at least two points)
| boost::signals2::signal<void ()> makVrf::DtTerrainProfileWidget::signal_dataStatusChanged |
Signal sent when the status of the data has changed.
| boost::signals2::signal<void (int)> makVrf::DtTerrainProfileWidget::signal_replotted |
Signal when the graph has been replotted.
|
protected |
|
protected |
|
protected |
|
protected |
Points are in geocentric.
|
protected |
The points that were last used to plot the graph. These will be used with the current line points to try and more efficiently replot only parts of the graph that need replotting.
|
protected |
Test the length of the line every N meters along the line.
|
protected |
Maximum number of points to check.
|
protected |
For each segment, the number of plot points on the terrain represented by that segment.
|
protected |
The points used to plot the terrain profile.
|
protected |
The points used for terrain intersection.
|
protected |
The points used for the line that is being used to sample the terrain segment.
|
protected |
|
protected |
|
protected |
Current units for distance and altitude. Used to check to see if units need to be changed.
|
protected |
|
protected |
Geocentric location of point marker. Used for labels.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Set to true when the graph is ready to display.
|
protected |
Class that will be used to track symbols within a particular distance to the given line. The tracker will emit signals as symbols come to or move away from the line.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| QwtPlot* makVrf::DtTerrainProfileWidget::myTerrainProfileGraph |
| QVBoxLayout* makVrf::DtTerrainProfileWidget::myMainLayout |
| QwtPlotCurve* makVrf::DtTerrainProfileWidget::myTerrainLine |
| QwtPlotCurve* makVrf::DtTerrainProfileWidget::myTerrainProfile |
| QwtPlotPicker* makVrf::DtTerrainProfileWidget::myPlotPicker |
| QLabel* makVrf::DtTerrainProfileWidget::mySelectedPointLabel |
| QLabel* makVrf::DtTerrainProfileWidget::mySelectedPoint |
|
static |