QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
CorridorScanComplexItem.cc
Go to the documentation of this file.
2
3#include <QtCore/QJsonArray>
4
5#include "AppMessages.h"
6#include "AppSettings.h"
7#include "JsonParsing.h"
9#include "QGCApplication.h"
10#include "QGCGeo.h"
11#include "QGCLoggingCategory.h"
12#include "QGCPlanarGeometry.h"
13#include "SettingsManager.h"
14
15QGC_LOGGING_CATEGORY(CorridorScanComplexItemLog, "Plan.CorridorScanComplexItem")
16
19 , _entryPointLocation (EntryPointDefaultOrder)
20 , _metaDataMap (FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/CorridorScan.SettingsGroup.json"), this))
21 , _corridorWidthFact (settingsGroup, _metaDataMap[corridorWidthName])
22{
23 _editorQml = "qrc:/qml/QGroundControl/PlanView/CorridorScanEditor.qml";
24
25 // We override the altitude to the mission default
26 if (_cameraCalc.isManualCamera() || !_cameraCalc.valueSetIsDistance()->rawValue().toBool()) {
27 _cameraCalc.distanceToSurface()->setRawValue(SettingsManager::instance()->appSettings()->defaultMissionItemAltitude()->rawValue());
28 }
29
30 connect(&_corridorWidthFact, &Fact::rawValueChanged, this, &CorridorScanComplexItem::_setDirty);
31 connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_setDirty);
32
33 connect(&_corridorPolyline, &QGCMapPolyline::dirtyChanged, this, &CorridorScanComplexItem::_polylineDirtyChanged);
34
35 connect(&_corridorPolyline, &QGCMapPolyline::pathChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon);
36 connect(&_corridorWidthFact, &Fact::rawValueChanged, this, &CorridorScanComplexItem::_rebuildCorridorPolygon);
37
38 connect(&_corridorPolyline, &QGCMapPolyline::countChanged, this, &CorridorScanComplexItem::_updateSpecifiesCoordinate);
39
40 connect(&_corridorPolyline, &QGCMapPolyline::isValidChanged, this, &CorridorScanComplexItem::_updateWizardMode);
41 connect(&_corridorPolyline, &QGCMapPolyline::traceModeChanged, this, &CorridorScanComplexItem::_updateWizardMode);
42
43 // Anchor the cache to current state so correctness doesn't depend on constructor ordering
44 _updateSpecifiesCoordinate();
45
46 if (!kmlOrShpFile.isEmpty()) {
47 _corridorPolyline.loadKMLOrSHPFile(kmlOrShpFile);
48 _corridorPolyline.setDirty(false);
49 }
50 setDirty(false);
51}
52
53void CorridorScanComplexItem::save(QJsonArray& planItems)
54{
55 QJsonObject saveObject;
56
57 _saveCommon(saveObject);
58 planItems.append(saveObject);
59}
60
61void CorridorScanComplexItem::savePreset(const QString& presetName)
62{
63 QJsonObject saveObject;
64
65 _saveCommon(saveObject);
66 _savePresetJson(presetName, saveObject);
67}
68
69void CorridorScanComplexItem::_saveCommon(QJsonObject& saveObject)
70{
72
73 saveObject[JsonParsing::jsonVersionKey] = 2;
76 saveObject[corridorWidthName] = _corridorWidthFact.rawValue().toDouble();
77 saveObject[_jsonEntryPointKey] = static_cast<int>(_entryPointLocation);
78
79 _corridorPolyline.saveToJson(saveObject);
80}
81
82void CorridorScanComplexItem::loadPreset(const QString& presetName)
83{
84 QString errorString;
85
86 QJsonObject presetObject = _loadPresetJson(presetName);
87 if (!_loadWorker(presetObject, 0, errorString, true /* forPresets */)) {
88 QGC::showAppMessage(tr("Internal Error: Preset load failed. Name: %1 Error: %2").arg(presetName).arg(errorString));
89 }
91}
92
93bool CorridorScanComplexItem::_loadWorker(const QJsonObject& complexObject, int sequenceNumber, QString& errorString, bool forPresets)
94{
95 _ignoreRecalc = !forPresets;
96
97 QList<JsonParsing::KeyValidateInfo> keyInfoList = {
98 { JsonParsing::jsonVersionKey, QJsonValue::Double, true },
99 { VisualMissionItem::jsonTypeKey, QJsonValue::String, true },
100 { ComplexMissionItem::jsonComplexItemTypeKey, QJsonValue::String, true },
101 { corridorWidthName, QJsonValue::Double, true },
102 { _jsonEntryPointKey, QJsonValue::Double, true },
103 { QGCMapPolyline::jsonPolylineKey, QJsonValue::Array, true },
104 };
105 if (!JsonParsing::validateKeys(complexObject, keyInfoList, errorString)) {
106 _ignoreRecalc = false;
107 return false;
108 }
109
110 QString itemType = complexObject[VisualMissionItem::jsonTypeKey].toString();
111 QString complexType = complexObject[ComplexMissionItem::jsonComplexItemTypeKey].toString();
113 errorString = tr("%1 does not support loading this complex mission item type: %2:%3").arg(qgcApp()->applicationName()).arg(itemType).arg(complexType);
114 _ignoreRecalc = false;
115 return false;
116 }
117
118 int version = complexObject[JsonParsing::jsonVersionKey].toInt();
119 if (version != 2) {
120 errorString = tr("%1 complex item version %2 not supported").arg(jsonComplexItemTypeValue).arg(version);
121 _ignoreRecalc = false;
122 return false;
123 }
124
125 if (!forPresets) {
126 if (!_corridorPolyline.loadFromJson(complexObject, true, errorString)) {
127 _ignoreRecalc = false;
128 return false;
129 }
130 }
131
133
134 if (!_load(complexObject, forPresets, errorString)) {
135 _ignoreRecalc = false;
136 return false;
137 }
138
139 _corridorWidthFact.setRawValue(complexObject[corridorWidthName].toDouble());
140
141 _entryPointLocation = static_cast<EntryPointLocation>(complexObject[_jsonEntryPointKey].toInt());
142
143 _ignoreRecalc = false;
144
146 if (_cameraShots == 0) {
147 // Shot count was possibly not available from plan file
149 }
150
151 return true;
152}
153
154bool CorridorScanComplexItem::load(const QJsonObject& complexObject, int sequenceNumber, QString& errorString)
155{
156 return _loadWorker(complexObject, sequenceNumber, errorString, false /* forPresets */);
157}
158
160{
161 return _corridorPolyline.count() > 1;
162}
163
164// specifiesCoordinate() depends on polyline count, so the NOTIFY signal must be emitted when it flips
165void CorridorScanComplexItem::_updateSpecifiesCoordinate(void)
166{
167 const bool newSpecifiesCoordinate = specifiesCoordinate();
168 if (newSpecifiesCoordinate != _specifiesCoordinate) {
169 _specifiesCoordinate = newSpecifiesCoordinate;
171 }
172}
173
175{
176 if (!coordinate.isValid() || !_entryCoordinate.isValid() || _corridorPolyline.count() < 2) {
177 return;
178 }
179
180 const double distanceMeters = _entryCoordinate.distanceTo(coordinate);
181 const double azimuthDegrees = _entryCoordinate.azimuthTo(coordinate);
182 const QList<QGeoCoordinate> vertices = _corridorPolyline.coordinateList();
183
184 QList<QGeoCoordinate> translatedVertices;
185 translatedVertices.reserve(vertices.count());
186 for (const QGeoCoordinate& vertex: vertices) {
187 translatedVertices.append(vertex.atDistanceAndAzimuth(distanceMeters, azimuthDegrees));
188 }
189
190 _corridorPolyline.setPath(translatedVertices);
191}
192
193int CorridorScanComplexItem::_calcTransectCount(void) const
194{
195 double fullWidth = _corridorWidthFact.rawValue().toDouble();
196 if (fullWidth <= 0.0) {
197 return 1;
198 }
199 const double spacing = _calcTransectSpacing();
200 return spacing > 0.0 ? qMin(qCeil(fullWidth / spacing), maxTransectCount) : 1;
201}
202
203void CorridorScanComplexItem::_polylineDirtyChanged(bool dirty)
204{
205 if (dirty) {
206 setDirty(true);
207 }
208}
209
211{
212 int modeAsInt = static_cast<int>(_entryPointLocation);
213
214 if (_calcTransectCount() < 2) {
215 // A single transect has no "opposite side of center" so we need to bump by 2 to get to the opposite end of the scan
216 modeAsInt += 2;
217 } else {
218 modeAsInt++;
219 }
220
222 modeAsInt = 0;
223 }
224
225 _entryPointLocation = static_cast<EntryPointLocation>(modeAsInt);
226
228}
229
230void CorridorScanComplexItem::_rebuildCorridorPolygon(void)
231{
233 _corridorBoundaryRings.clear();
234 _corridorBoundaryPaths.clear();
235 _buildCorridorArea();
237}
238
239void CorridorScanComplexItem::_buildCorridorArea(void)
240{
241 if (_corridorPolyline.count() < 2) {
242 return;
243 }
244
245 const double halfWidth = _corridorWidthFact.rawValue().toDouble() / 2.0;
246 if (halfWidth < 0.0) {
247 return;
248 }
249 if (qFuzzyIsNull(halfWidth)) {
250 // Single pass corridor: the area is the path out and back, which keeps the polygon valid for save
251 QList<QGeoCoordinate> coordinates = _corridorPolyline.coordinateList();
252 QVariantList path;
253 for (const QGeoCoordinate& coordinate : coordinates) {
254 path.append(QVariant::fromValue(coordinate));
255 }
256 _corridorBoundaryPaths.append(QVariant(path));
257
258 const QList<QGeoCoordinate> returnPath(coordinates.crbegin(), coordinates.crend());
259 coordinates.append(returnPath);
260 _surveyAreaPolygon.appendVertices(coordinates);
261 return;
262 }
263
264 const QList<QPolygonF> contours = QGCPlanarGeometry::bufferPolyline(_corridorPolyline.nedPolyline(), halfWidth);
265 if (contours.isEmpty()) {
266 qCWarning(CorridorScanComplexItemLog) << "Unable to build corridor buffer";
267 return;
268 }
269
270 const QGeoCoordinate tangentOrigin = _corridorPolyline.vertexCoordinate(0);
271 const auto toGeo = [&tangentOrigin](const QPolygonF& planar) {
272 QList<QGeoCoordinate> coordinates;
273 coordinates.reserve(planar.size());
274 for (const QPointF& point : planar) {
275 QGeoCoordinate coordinate;
276 QGCGeo::convertNedToGeo(point.y(), point.x(), 0.0, tangentOrigin, coordinate);
277 coordinates.append(coordinate);
278 }
279 return coordinates;
280 };
281
282 for (const QPolygonF& contour : contours) {
283 const QList<QGeoCoordinate> ring = toGeo(contour);
284 _corridorBoundaryRings.append(ring);
285
286 QVariantList path;
287 for (const QGeoCoordinate& coordinate : ring) {
288 path.append(QVariant::fromValue(coordinate));
289 }
290 path.append(QVariant::fromValue(ring.first()));
291 _corridorBoundaryPaths.append(QVariant(path));
292 }
293
294 // Holes are joined into the outer boundary with zero-width bridges so the area polygon fills correctly
295 _surveyAreaPolygon.appendVertices(toGeo(QGCPlanarGeometry::joinContours(contours)));
296}
297
298QList<QList<QGeoCoordinate>> CorridorScanComplexItem::_surveyAreaBoundaries(void) const
299{
300 return _corridorBoundaryRings.isEmpty() ? TransectStyleComplexItem::_surveyAreaBoundaries()
301 : _corridorBoundaryRings;
302}
303
305{
306 if (_ignoreRecalc) {
307 return;
308 }
309
310 // If the transects are getting rebuilt then any previsouly loaded mission items are now invalid
312 _loadedMissionItems.clear();
313 _loadedMissionItemsParent->deleteLater();
315 }
316
317 double transectSpacing = _calcTransectSpacing();
318 double fullWidth = _corridorWidthFact.rawValue().toDouble();
319 double halfWidth = fullWidth / 2.0;
320 int transectCount = _calcTransectCount();
321 double normalizedTransectPosition = transectSpacing / 2.0;
322
323 if (_corridorPolyline.count() >= 2) {
324 // First build up the transects all going the same direction
325 //qDebug() << "_rebuildTransectsPhase1";
326 for (int i=0; i<transectCount; i++) {
327 //qDebug() << "start transect";
328 double offsetDistance;
329 if (transectCount == 1) {
330 // Single transect is flown over scan line
331 offsetDistance = 0;
332 } else {
333 // Convert from normalized to absolute transect offset distance
334 offsetDistance = halfWidth - normalizedTransectPosition;
335 }
336
337 // Turn transect into CoordInfo transect
338 QList<TransectStyleComplexItem::CoordInfo_t> transect;
339 QList<QGeoCoordinate> transectCoords = _corridorPolyline.offsetPolyline(offsetDistance);
340 if (transectCoords.count() < 2) {
341 qCWarning(CorridorScanComplexItemLog) << "Unable to offset corridor transect";
342 normalizedTransectPosition += transectSpacing;
343 continue;
344 }
345 for (int j=1; j<transectCoords.count() - 1; j++) {
346 TransectStyleComplexItem::CoordInfo_t coordInfo = { transectCoords[j], CoordTypeInterior };
347 transect.append(coordInfo);
348 }
349 TransectStyleComplexItem::CoordInfo_t coordInfo = { transectCoords.first(), CoordTypeSurveyEntry };
350 transect.prepend(coordInfo);
351 coordInfo = { transectCoords.last(), CoordTypeSurveyExit };
352 transect.append(coordInfo);
353
354 // Extend the transect ends for turnaround
355 if (_hasTurnaround()) {
356 QGeoCoordinate turnaroundCoord;
357 double turnAroundDistance = _turnAroundDistanceFact.rawValue().toDouble();
358
359 double azimuth = transectCoords[0].azimuthTo(transectCoords[1]);
360 turnaroundCoord = transectCoords[0].atDistanceAndAzimuth(-turnAroundDistance, azimuth);
361 turnaroundCoord.setAltitude(qQNaN());
362 TransectStyleComplexItem::CoordInfo_t turnaroundCoordInfo = { turnaroundCoord, CoordTypeTurnaround };
363 transect.prepend(turnaroundCoordInfo);
364
365 azimuth = transectCoords.last().azimuthTo(transectCoords[transectCoords.count() - 2]);
366 turnaroundCoord = transectCoords.last().atDistanceAndAzimuth(-turnAroundDistance, azimuth);
367 turnaroundCoord.setAltitude(qQNaN());
368 coordInfo = { turnaroundCoord, CoordTypeTurnaround };
369 transect.append(coordInfo);
370 }
371
372#if 0
373 qDebug() << "transect debug";
374 for (const TransectStyleComplexItem::CoordInfo_t& coordInfo: transect) {
375 qDebug() << coordInfo.coordType;
376 }
377#endif
378
379 _transects.append(transect);
380 normalizedTransectPosition += transectSpacing;
381 }
382
383 // Now deal with fixing up the entry point:
384 // 0: Leave alone
385 // 1: Start at same end, opposite side of center
386 // 2: Start at opposite end, same side
387 // 3: Start at opposite end, opposite side
388
389 bool reverseTransects = false;
390 bool reverseVertices = false;
391 switch (_entryPointLocation) {
393 reverseTransects = false;
394 reverseVertices = false;
395 break;
397 reverseTransects = true;
398 reverseVertices = false;
399 break;
401 reverseTransects = false;
402 reverseVertices = true;
403 break;
405 reverseTransects = true;
406 reverseVertices = true;
407 break;
408 }
409 if (reverseTransects) {
410 QList<QList<TransectStyleComplexItem::CoordInfo_t>> reversedTransects;
411 for (const QList<TransectStyleComplexItem::CoordInfo_t>& transect: _transects) {
412 reversedTransects.prepend(transect);
413 }
414 _transects = reversedTransects;
415 }
416 if (reverseVertices) {
417 for (int i=0; i<_transects.count(); i++) {
418 QList<TransectStyleComplexItem::CoordInfo_t> reversedVertices;
419 for (TransectStyleComplexItem::CoordInfo_t vertex : _transects[i]) {
420 // Entry and exit follow the direction of travel, which camera triggering relies on
421 if (vertex.coordType == CoordTypeSurveyEntry) {
422 vertex.coordType = CoordTypeSurveyExit;
423 } else if (vertex.coordType == CoordTypeSurveyExit) {
424 vertex.coordType = CoordTypeSurveyEntry;
425 }
426 reversedVertices.prepend(vertex);
427 }
428 _transects[i] = reversedVertices;
429 }
430 }
431
432 // Adjust to lawnmower pattern
433 reverseVertices = false;
434 for (int i=0; i<_transects.count(); i++) {
435 // We must reverse the vertices for every other transect in order to make a lawnmower pattern
436 QList<TransectStyleComplexItem::CoordInfo_t> transectVertices = _transects[i];
437 if (reverseVertices) {
438 reverseVertices = false;
439 QList<TransectStyleComplexItem::CoordInfo_t> reversedVertices;
440 for (int j=transectVertices.count()-1; j>=0; j--) {
441 reversedVertices.append(transectVertices[j]);
442
443 // as we are flying the transect reversed, we also need to swap entry and exit coordinate types
444 if (reversedVertices.last().coordType == CoordTypeSurveyEntry) {
445 reversedVertices.last().coordType = CoordTypeSurveyExit;
446 } else if (reversedVertices.last().coordType == CoordTypeSurveyExit) {
447 reversedVertices.last().coordType = CoordTypeSurveyEntry;
448 }
449 }
450
451 transectVertices = reversedVertices;
452 } else {
453 reverseVertices = true;
454 }
455 _transects[i] = transectVertices;
456 }
457 }
458
459 // A corridor whose transects all fail to generate would otherwise save and upload without any scan
460 const bool noTransects = (_corridorPolyline.count() >= 2) && _transects.isEmpty();
461 if (noTransects != _noTransects) {
462 _noTransects = noTransects;
463 if (_noTransects) {
464 QGC::showAppMessage(tr("Corridor Scan: Unable to calculate transects for the corridor path."));
465 }
467 }
468}
469
471{
472 double triggerDistance = _cameraCalc.adjustedFootprintFrontal()->rawValue().toDouble();
473 if (triggerDistance == 0) {
474 _cameraShots = 0;
475 } else {
476 if (_cameraTriggerInTurnAroundFact.rawValue().toBool()) {
478 } else if (_loadedMissionItemsParent) {
479 // Loaded mission items have no transects until rebuilt, so estimate from the corridor path
480 int singleTransectImageCount = _distanceTriggerImageCount(_corridorPolyline.length(), triggerDistance);
481 _cameraShots = singleTransectImageCount * _calcTransectCount();
482 } else {
483 // Images are taken along the path flown between the survey entry and exit
484 const auto cameraPathLength = [](const QList<CoordInfo_t>& transect) {
485 qsizetype entryIndex = -1;
486 qsizetype exitIndex = -1;
487 for (qsizetype i = 0; i < transect.count(); i++) {
488 if (transect[i].coordType == CoordTypeSurveyEntry) {
489 entryIndex = i;
490 } else if (transect[i].coordType == CoordTypeSurveyExit) {
491 exitIndex = i;
492 }
493 }
494 double length = 0;
495 if (entryIndex >= 0 && exitIndex >= 0) {
496 for (qsizetype i = qMin(entryIndex, exitIndex) + 1; i <= qMax(entryIndex, exitIndex); i++) {
497 length += transect[i - 1].coord.distanceTo(transect[i].coord);
498 }
499 }
500 return length;
501 };
502
503 // Passes which could not be offset are not flown, and offset passes differ in length from the path
504 _cameraShots = 0;
505 for (const QList<CoordInfo_t>& transect : _transects) {
506 _cameraShots += _distanceTriggerImageCount(cameraPathLength(transect), triggerDistance);
507 }
508 }
509 }
510 emit cameraShotsChanged();
511}
512
517
519{
520 return _vehicleSpeed == 0 ? 0 : _cameraCalc.adjustedFootprintFrontal()->rawValue().toDouble() / _vehicleSpeed;
521}
522
523double CorridorScanComplexItem::_calcTransectSpacing(void) const
524{
525 double transectSpacing = _cameraCalc.adjustedFootprintSide()->rawValue().toDouble();
526 if (transectSpacing <= 0) {
527 return 0;
528 }
529
530 // Cap spacing so the corridor never generates more than maxTransectCount transects.
531 // The relevant extent is the corridor width (transects run perpendicular to the path).
532 const double corridorWidth = _corridorWidthFact.rawValue().toDouble();
533 if (corridorWidth <= 0.0) {
534 qCWarning(CorridorScanComplexItemLog) << "Corridor width" << corridorWidth << "is invalid, skipping transect count cap";
535 return transectSpacing;
536 }
537 if (transectSpacing < corridorWidth / maxTransectCount) {
538 qCWarning(CorridorScanComplexItemLog) << "Transect spacing" << transectSpacing << "raised to" << corridorWidth / maxTransectCount << "to limit transect count to" << maxTransectCount;
539 transectSpacing = corridorWidth / maxTransectCount;
540 }
541
542 return transectSpacing;
543}
544
545void CorridorScanComplexItem::_updateWizardMode(void)
546{
547 if (_corridorPolyline.isValid() && !_corridorPolyline.traceMode()) {
548 setWizardMode(false);
549 }
550}
#define qgcApp()
Geographic coordinate conversion utilities using GeographicLib.
#define QGC_LOGGING_CATEGORY(name, categoryStr)
Fact * adjustedFootprintSide(void)
Definition CameraCalc.h:57
void _savePresetJson(const QString &name, QJsonObject &presetObject)
static constexpr const char * jsonComplexItemTypeKey
This mission item attribute specifies the type of the complex item.
QJsonObject _loadPresetJson(const QString &name)
bool load(const QJsonObject &complexObject, int sequenceNumber, QString &errorString) final
void corridorBoundariesChanged(void)
void savePreset(const QString &name)
void setCoordinate(const QGeoCoordinate &coordinate) final
void save(QJsonArray &planItems) final
static constexpr const char * corridorWidthName
QList< QList< QGeoCoordinate > > _surveyAreaBoundaries(void) const final
Survey area boundaries for export, outer boundary first followed by any holes.
CorridorScanComplexItem(PlanMasterController *masterController, bool flyView, const QString &kmlOrShpFile)
bool specifiesCoordinate(void) const final
void loadPreset(const QString &name)
Q_INVOKABLE void rotateEntryPoint(void)
EntryPointLocation
Corridor area outlines to draw on the map: each closed boundary ring, or the path itself for a single...
static constexpr const char * jsonComplexItemTypeValue
ReadyForSaveState readyForSaveState(void) const final
static constexpr const char * settingsGroup
Holds the meta data associated with a Fact.
void rawValueChanged(const QVariant &value)
QVariant rawValue() const
Definition Fact.h:87
Master controller for mission, fence, rally.
Q_INVOKABLE void clear(void)
void dirtyChanged(bool dirty)
static constexpr const char * jsonPolylineKey
void pathChanged(void)
void traceModeChanged(bool traceMode)
void saveToJson(QJsonObject &json)
void isValidChanged(void)
void countChanged(int count)
virtual void _rebuildTransectsPhase1(void)=0
Rebuilds the _transects array.
QObject * _loadedMissionItemsParent
Parent for all items in _loadedMissionItems for simpler delete.
QList< QList< CoordInfo_t > > _transects
QList< MissionItem * > _loadedMissionItems
Mission items loaded from plan file.
void setSequenceNumber(int sequenceNumber) final
QGeoCoordinate coordinate(void) const final
int sequenceNumber(void) const final
TransectStyleComplexItem(PlanMasterController *masterController, bool flyView, QString settignsGroup)
static constexpr int maxTransectCount
Maximum number of transects allowed; spacing is raised to enforce this limit.
ReadyForSaveState readyForSaveState(void) const override
bool _load(const QJsonObject &complexObject, bool forPresets, QString &errorString)
static int _distanceTriggerImageCount(double transectLength, double triggerDistance)
void _save(QJsonObject &saveObject)
virtual QList< QList< QGeoCoordinate > > _surveyAreaBoundaries(void) const
Survey area boundaries for export, outer boundary first followed by any holes.
virtual void _recalcCameraShots(void)=0
@ CoordTypeTurnaround
Turnaround extension waypoint.
@ CoordTypeSurveyExit
Waypoint at exit edge of survey polygon.
@ CoordTypeInterior
Interior waypoint for flight path only (example: interior corridor point).
@ CoordTypeSurveyEntry
Waypoint at entry edge of survey polygon.
bool flyView(void) const
static constexpr const char * jsonTypeComplexItemValue
Item type is Complex Item.
QString _editorQml
Qml resource for editing item.
void setWizardMode(bool wizardMode)
void specifiesCoordinateChanged(void)
void readyForSaveStateChanged(void)
static constexpr const char * jsonTypeKey
Json file attribute which specifies the item type.
PlanMasterController * masterController(void)
double azimuth(void) const
bool validateKeys(const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
Validates that all required keys are present and that listed keys have the expected type.
constexpr const char * jsonVersionKey
Definition JsonParsing.h:14
void convertNedToGeo(double x, double y, double z, const QGeoCoordinate &origin, QGeoCoordinate &coord)
Definition QGCGeo.cc:58
QPolygonF joinContours(const QList< QPolygonF > &contours)
Joins contours into a single ring using zero-width bridges, for use with odd-even polygon filling.
QList< QPolygonF > bufferPolyline(const QList< QPointF > &polyline, double distance)
void showAppMessage(const QString &message, const QString &title)
Modal application message. Queued if the UI isn't ready yet.
Definition AppMessages.cc:9