![]() |
VR-Forces 4.8 Class Documentation
|
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. More...

Public Types | |
| enum | ReplotFlag { FullReplot = 0x00000001, ReplotPoints = 0x00000002, UpdateGraphOnly = 0x00000004 } |
Public Member Functions | |
| DtTerrainProfileWidget (makVrv::DtDe &de, QWidget *parent=NULL, const Qt::WindowFlags &flags=0) | |
| Constructor. More... | |
| virtual | ~DtTerrainProfileWidget () |
| Destructor. More... | |
| virtual void | init () |
| Initializes the widget by creating GUI (plot) elements and initializing member variables. More... | |
| virtual void | setDataProvider (DtTerrainProfileDataProvider *) |
| Sets the data provider for this graph. More... | |
| virtual void | replot () |
| Redraws the graph given the existing profile data and settings. More... | |
| virtual void | setSamplingRate (double) |
| Sets the frequency in distance to check along the line for terrain points. More... | |
| double | samplingRate () const |
| virtual void | setMaximumSamplingPoints (int) |
| Sets the maximum number of points to check. More... | |
| int | maximumSamplingPoints () const |
| virtual void | setUseBackendForProfile (bool) |
| bool | useBackendForProfile () const |
| bool | replotting () const |
| virtual void | clearGraph () |
| Clears the graph of all data. More... | |
| virtual bool | backendCanBeUsedForProfileData () const |
| Whether or not the back-end can be used for profile data. More... | |
| virtual bool | allDataFromFrontEnd () const |
| Whether or not all the data is from the front-end. More... | |
| virtual bool | allDataFromBackEnd () const |
| Whether or not all the data is from the back-end. More... | |
| virtual void | labelDataForTerrainProfilePosition (const QPointF &pos, const DtVector &geoc, double distanceOnLine, double height, int soilType=0) |
| Sets the label information for the geocentric position, height and soil type. More... | |
| virtual void | setReplotTime (int) |
| Sets the time (in milliseconds) to wait before doing a replot. More... | |
| int | replotTime () const |
| virtual void | setScaleFactor (double) |
| Value to scale difference between max and min height of terrain. More... | |
| double | scaleFactor () const |
| virtual void | suspend () |
| Suspends this graph. This means that there shall be no updates made to this graph. More... | |
| virtual void | resume () |
| Resumes graph updates. Will do a full replot. More... | |
| virtual bool | isSuspended () const |
| Returns true if this graph has been suspended. More... | |
| virtual void | setShowVertices (bool) |
| If true will put a vertex marker at each point on the line. More... | |
| bool | showVertices () const |
| virtual void | setShowVertexNumbers (bool) |
| If true will put a number label next to each vertex marker. More... | |
| bool | showVertexNumbers () const |
| virtual void | setSuspendForMovement (bool) |
| Sets whether or not the symbol tracker will suspend if the line points are changing. Default is true. More... | |
| virtual bool | suspendForMovement () const |
| virtual void | setDistanceMoveTolerance (double) |
| Distance a tracked entity must move to signal an update. Default is 10 meters. More... | |
| virtual double | distanceMoveTolerance () const |
| virtual QString | dataStatus () const |
| Text which represents the current source of data (Front-End, Back-End or # points received from Back-End) More... | |
| virtual void | requestPlotPointsIfNeeded (bool force=false) |
| Requests data from server. Set force to true to force even if data is not frozen. More... | |
Public Attributes | |
| boost::signals2::signal< void()> | signal_ready |
| Signal only once when graph is ready to show (at least two points) More... | |
| boost::signals2::signal< void()> | signal_dataStatusChanged |
| Signal sent when the status of the data has changed. More... | |
| boost::signals2::signal< void(int)> | signal_replotted |
| Signal when the graph has been replotted. More... | |
| 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 |
| Map of plot markers for entities being tracked. More... | |
| typedef std::map < makVrv::DtUniqueID, DtVector > | WaitingForPlot |
Protected Slots | |
| virtual void | plotMouseReleased (const QPointF &) |
| Called when the mouse is released on the plot area, will show a mark on the terrain line and information about that point. More... | |
Protected Member Functions | |
| virtual void | createProfileGraph () |
| Create the graph object that will be used to show the terrain profile. More... | |
| virtual void | initConnections () |
| Initializes any connections (boost or Qt) needed to support this graph. More... | |
| virtual bool | updateProfileData () |
| Updates local data represented by the profile id to watch. If data has changed will return true, else false. More... | |
| virtual void | slot_dataUpdated () |
| Called when the state view is updated, if profile data is updated will redraw the graph. More... | |
| virtual void | slot_dataRemoved () |
| Called when an object is about to be removed, will clear the graph. More... | |
| virtual void | calculateReplotRanges (std::vector< QPoint > &) const |
| Figures out the range to recalculate points for in line plot. More... | |
| virtual double | calculateLineLength (const std::vector< DtVector > &) const |
| Returns the length of the line given the number of points. More... | |
| virtual double | calculateSegment (const QPoint &segment, double lineLength) |
| Calculates the points for the curve along the given segment of the line. Returns the length of the segment. More... | |
| virtual double | segmentLength (const QPoint &) const |
| Convenience routines to calculate the length of a segment of a line. More... | |
| virtual double | segmentLength (int start, int end) const |
| virtual double | terrainHeight (const DtVector &, int position=-1) const |
| Returns terrain height at geocentric position. More... | |
| virtual double | lineHeight (int pos) const |
| Returns the height of the line at the given position. More... | |
| virtual void | setupLabels () |
| Sets labels for the graph based on current display unit settings. More... | |
| void | slot_onUnitChanged (int attribute, int from) |
| Called when unit display settings change, see if any graph data needs to change. More... | |
| virtual double | altitudeValueFor (double) const |
| Given current display units settings, return altitude or distance for those settings based on meters. More... | |
| virtual double | distanceValueFor (double) const |
| virtual double | altitudeFromDisplayValue (double) const |
| Given current display units settings, return altitude or distance in meters from the given display value. More... | |
| virtual double | distanceFromDisplayValue (double) const |
| virtual void | convertAltitudeAndDistance (int newAltitudeUnits, int newDistanceUnits, bool replot=true) |
| Given the current altitude and distance settings, convert to the new settings and redisplay graph. More... | |
| virtual void | convertAltitudeAndDistance (QVector< QPointF > &, int newAltitudeUnits, int newDistanceUnits) const |
| Converts x (distance) and y (altitude) in place in the vectors. More... | |
| virtual void | convertAltitudeAndDistance (QwtPlotMarker *, int newAltitudeUnits, int newDistanceUnits) const |
| virtual void | deferredReplot (int flag=FullReplot) |
| Connect to DE pre-tick to replot graph. If full does a full redraw of graph, else just a simple replot. More... | |
| virtual QwtPlotMarker * | addMarker (double x, double y) |
| Adds a point marker to the x, y coordinate. More... | |
| virtual void | setupPointMarkerLabel () |
| Sets the label on the point marker to the current point location. More... | |
| virtual void | onTerrainProfileSettingsChanged (const DtTerrainProfileSettingsRecord &) |
| Called when terrain profile settings change, modify graph to match. More... | |
| virtual void | createSymbolTracker () |
| Creates a symbol tracker to track symbols within a certain range near the line. More... | |
| virtual void | trackEntity (const DtVector &geocentricPosition, const makVrv::DtStateView< makVrv::DtVrlinkSimulatedEntityState > *) |
| Start tracking or continue tracking the given entity. More... | |
| virtual void | stopTrackingEntity (makVrv::DtElementID) |
| Stop tracking entity. More... | |
| virtual void | clearTrackingSymbols (bool suspended=false) |
| Clears out all symbols being tracked and deletes the symbol tracker. More... | |
| virtual QwtSymbol * | symbolFor (const makVrv::DtStateView< makVrv::DtVrlinkSimulatedEntityState > *) const |
| Returns a symbol for the given sim state view to be placed on the plot graph. More... | |
| virtual int | linePositionFromLocation (const DtVector &geocentricLocation, QPointF &result, bool trackedItem=false) const |
| Given a geocentric point, convert point to a position on the line of distance along the line and height. More... | |
| virtual int | locationFromPlotPosition (const QPointF &result, DtVector &geocentricLocation) const |
| Given a position on the line of distance along the line and height, return a geocentric point. Returns the segment hit. More... | |
| virtual int | closestPoint (const DtVector &v, double &range, double &totalRange, bool trackedItem=false) const |
| Given a geocentric coordinate, find the closest point to that on the line being plotted. More... | |
| virtual void | timedReplot () |
| Method called when a page tile is loaded. More... | |
| virtual void | replotIfTime () |
| virtual void | updateLineVertices (bool replot=true) |
| Updates the vertices on the line. More... | |
| virtual void | resetAltitudeScale (bool replot=true) |
| virtual double | elevationAngle (const DtVector &geocentricFrom, const DtVector &geocentricTo) const |
| Returns elevation angle from point to point. More... | |
| 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 &) |
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
|
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.
|
virtual |
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.
|
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.
|
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.
Called when unit display settings change, see if any graph data needs to change.
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 |
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 |
| 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 |