Commit e02648a3 authored by Valentin Platzgummer's avatar Valentin Platzgummer

circular survey works fine with split slow and fast rebuild

parent da286265
This diff is collapsed.
This diff is collapsed.
...@@ -28,6 +28,7 @@ public: ...@@ -28,6 +28,7 @@ public:
Q_PROPERTY(bool isInitialized READ isInitialized WRITE setIsInitialized NOTIFY isInitializedChanged) Q_PROPERTY(bool isInitialized READ isInitialized WRITE setIsInitialized NOTIFY isInitializedChanged)
Q_INVOKABLE void resetReference(void); Q_INVOKABLE void resetReference(void);
Q_INVOKABLE void comprehensiveUpdate(void); // triggers a slow recalculation of the transects
// Property setters // Property setters
void setRefPoint(const QGeoCoordinate &refPt); void setRefPoint(const QGeoCoordinate &refPt);
...@@ -88,12 +89,18 @@ signals: ...@@ -88,12 +89,18 @@ signals:
private slots: private slots:
// Overrides from TransectStyleComplexItem // Overrides from TransectStyleComplexItem
void _rebuildTransectsPhase1 (void) final; // do not call this function, it is called by TransectStyleComplexItem::_rebuildTransects() void _rebuildTransectsPhase1 (void) final; // calls _rebuildTransectsFast or _rebuildTransectsSlow depending on _fastRecalc
void _rebuildTransectsSlow (void); // the slow version of _rebuildTransectsPhase1 which properly connects the _transects void _rebuildTransectsFast (void);
void _rebuildTransectsSlow (void); // the slow version of _rebuildTransectsFast which properly connects the _transects
void _triggerSlowRecalc (void);
bool _generateTransectPath (QVector<QVector<QPointF>> &transectPath, const QPolygonF &surveyPolygon);
bool _rebuildTransectsInputCheck(QPolygonF &poly);
void _rebuildTransectsToGeo (const QVector<QPointF> &path, const QGeoCoordinate &reference);
void _recalcComplexDistance (void) final; void _recalcComplexDistance (void) final;
void _recalcCameraShots (void) final; void _recalcCameraShots (void) final;
void _reverseTransects (void); void _reverseTransects (void);
bool _shortestPath (const QGeoCoordinate &start, const QGeoCoordinate &destination, QVector<QGeoCoordinate> shortestPath); bool _shortestPath (const QGeoCoordinate &start, const QGeoCoordinate &destination, QVector<QGeoCoordinate> &shortestPath);
signals: signals:
...@@ -120,6 +127,7 @@ private: ...@@ -120,6 +127,7 @@ private:
bool _isInitialized; // indicates if the polygon and refpoint etc. are initialized, prevents reinitialisation from gui and execution of _rebuildTransectsPhase1 during init from gui bool _isInitialized; // indicates if the polygon and refpoint etc. are initialized, prevents reinitialisation from gui and execution of _rebuildTransectsPhase1 during init from gui
bool _reverseOnly; // if this is true _rebuildTransectsPhase1() will reverse the path only, _rebuildTransectsPhase1() resets _reverseOnly bool _reverseOnly; // if this is true _rebuildTransectsPhase1() will reverse the path only, _rebuildTransectsPhase1() resets _reverseOnly
bool _referencePointBeingChanged; // is set to true by gui, if user is changeing the reference point bool _referencePointBeingChanged; // is set to true by gui, if user is changeing the reference point
bool _fastRecalc; // see _rebuildTransectsPhase1 for explanation
int _updateCounter; int _updateCounter;
int _transectsDiry; int _transectsDiry;
...@@ -127,3 +135,5 @@ private: ...@@ -127,3 +135,5 @@ private:
...@@ -113,6 +113,10 @@ Item { ...@@ -113,6 +113,10 @@ Item {
borderColor: "black" borderColor: "black"
interiorColor: "green" interiorColor: "green"
interiorOpacity: 0.5 interiorOpacity: 0.5
onDragStop: {
_missionItem.comprehensiveUpdate()
}
} }
// Transect lines // Transect lines
......
...@@ -47,6 +47,8 @@ Item { ...@@ -47,6 +47,8 @@ Item {
property real _zorderSplitHandle: QGroundControl.zOrderMapItems + 2 property real _zorderSplitHandle: QGroundControl.zOrderMapItems + 2
property real _zorderCenterHandle: QGroundControl.zOrderMapItems + 1 // Lowest such that drag or split takes precedence property real _zorderCenterHandle: QGroundControl.zOrderMapItems + 1 // Lowest such that drag or split takes precedence
signal dragStop // triggered if node or center handle was stopped dragging
function addVisuals() { function addVisuals() {
_polygonComponent = polygonComponent.createObject(mapControl) _polygonComponent = polygonComponent.createObject(mapControl)
mapControl.addMapItem(_polygonComponent) mapControl.addMapItem(_polygonComponent)
...@@ -350,7 +352,10 @@ Item { ...@@ -350,7 +352,10 @@ Item {
mapControl: _root.mapControl mapControl: _root.mapControl
z: _zorderDragHandle z: _zorderDragHandle
visible: !_circle visible: !_circle
onDragStop: mapPolygon.verifyClockwiseWinding() onDragStop: {
mapPolygon.verifyClockwiseWinding()
_root.dragStop()
}
property int polygonVertex property int polygonVertex
...@@ -495,7 +500,10 @@ Item { ...@@ -495,7 +500,10 @@ Item {
z: _zorderCenterHandle z: _zorderCenterHandle
onItemCoordinateChanged: mapPolygon.center = itemCoordinate onItemCoordinateChanged: mapPolygon.center = itemCoordinate
onDragStart: mapPolygon.centerDrag = true onDragStart: mapPolygon.centerDrag = true
onDragStop: mapPolygon.centerDrag = false onDragStop: {
mapPolygon.centerDrag = false
_root.dragStop()
}
onClicked: menu.popupCenter() onClicked: menu.popupCenter()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment