Skip to content

Commit ca0caec

Browse files
committed
refactor(Geo): Comprehensive geo format system with unified registry
1 parent e92105b commit ca0caec

File tree

148 files changed

+24662
-3423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+24662
-3423
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ BraceWrapping:
3030
IndentBraces: false
3131
SplitEmptyFunction: true
3232
SplitEmptyRecord: true
33-
AllowShortFunctionsOnASingleLine: None
34-
AllowShortIfStatementsOnASingleLine: Never
33+
AllowShortFunctionsOnASingleLine: InlineOnly
34+
AllowShortIfStatementsOnASingleLine: WithoutElse
3535
AllowShortLoopsOnASingleLine: false
3636
AllowShortBlocksOnASingleLine: Never
3737
AllowShortCaseLabelsOnASingleLine: false
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/gdal.cmake b/gdal.cmake
2+
index b5e5e4f..d8484cd 100644
3+
--- a/gdal.cmake
4+
+++ b/gdal.cmake
5+
@@ -611,9 +611,11 @@ install(
6+
FRAMEWORK DESTINATION "${FRAMEWORK_DESTINATION}")
7+
8+
# Generate targets file for importing directly from GDAL build tree
9+
-export(TARGETS ${GDAL_LIB_TARGET_NAME}
10+
- NAMESPACE GDAL::
11+
- FILE "GDAL-targets.cmake")
12+
+if(NOT CMAKE_SKIP_INSTALL_RULES)
13+
+ export(TARGETS ${GDAL_LIB_TARGET_NAME}
14+
+ NAMESPACE GDAL::
15+
+ FILE "GDAL-targets.cmake")
16+
+endif()
17+
18+
if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK)
19+
# Generate GdalConfig.cmake and GdalConfigVersion.cmake
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- a/CMakeLists.txt
2+
+++ b/CMakeLists.txt
3+
@@ -522,6 +522,8 @@ if(NOT _is_multi_config_generator)
4+
endif()
5+
6+
configure_file(cmake/uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/proj_uninstall.cmake @ONLY)
7+
-add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/proj_uninstall.cmake)
8+
+if(NOT TARGET uninstall)
9+
+ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/proj_uninstall.cmake)
10+
+endif()
11+
12+
message(STATUS "EMBED_RESOURCE_FILES=${EMBED_RESOURCE_FILES}")

src/FlightMap/MapItems/QGCMapPolygonVisuals.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ Item {
207207

208208
QGCPalette { id: qgcPal }
209209

210-
KMLOrSHPFileDialog {
211-
id: kmlOrSHPLoadDialog
210+
ShapeFileDialog {
211+
id: shapeFileLoadDialog
212212
title: qsTr("Select Polygon File")
213213

214214
onAcceptedForLoad: (file) => {
215-
mapPolygon.loadKMLOrSHPFile(file)
215+
mapPolygon.loadShapeFile(file)
216216
mapFitFunctions.fitMapViewportToMissionItems()
217217
close()
218218
}
@@ -622,8 +622,8 @@ Item {
622622

623623
QGCButton {
624624
_horizontalPadding: 0
625-
text: qsTr("Load KML/SHP...")
626-
onClicked: kmlOrSHPLoadDialog.openForLoad()
625+
text: qsTr("Load Shape File...")
626+
onClicked: shapeFileLoadDialog.openForLoad()
627627
visible: !mapPolygon.traceMode
628628
}
629629
}

src/FlightMap/MapItems/QGCMapPolylineVisuals.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ Item {
110110

111111
QGCPalette { id: qgcPal }
112112

113-
KMLOrSHPFileDialog {
114-
id: kmlOrSHPLoadDialog
113+
ShapeFileDialog {
114+
id: shapeFileLoadDialog
115115
title: qsTr("Select Polyline File")
116116

117117
onAcceptedForLoad: (file) => {
118-
mapPolyline.loadKMLOrSHPFile(file)
118+
mapPolyline.loadShapeFile(file)
119119
mapFitFunctions.fitMapViewportToMissionItems()
120120
close()
121121
}
@@ -347,8 +347,8 @@ Item {
347347

348348
QGCButton {
349349
_horizontalPadding: 0
350-
text: qsTr("Load KML/SHP...")
351-
onClicked: kmlOrSHPLoadDialog.openForLoad()
350+
text: qsTr("Load Shape File...")
351+
onClicked: shapeFileLoadDialog.openForLoad()
352352
visible: !mapPolyline.traceMode
353353
}
354354
}

src/MissionManager/CMakeLists.txt

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ target_sources(${CMAKE_PROJECT_NAME}
2525
GeoFenceController.h
2626
GeoFenceManager.cc
2727
GeoFenceManager.h
28-
KMLPlanDomDocument.cc
29-
KMLPlanDomDocument.h
3028
LandingComplexItem.cc
3129
LandingComplexItem.h
3230
MissionCommandList.cc
@@ -51,6 +49,73 @@ target_sources(${CMAKE_PROJECT_NAME}
5149
PlanManager.h
5250
PlanMasterController.cc
5351
PlanMasterController.h
52+
53+
# PlanShapes - Core
54+
PlanShapes/GeoFormatPlanImporter.cc
55+
PlanShapes/GeoFormatPlanImporter.h
56+
PlanShapes/PlanDocument.cc
57+
PlanShapes/PlanDocument.h
58+
PlanShapes/PlanExporter.cc
59+
PlanShapes/PlanExporter.h
60+
PlanShapes/PlanImporter.cc
61+
PlanShapes/PlanImporter.h
62+
63+
# PlanShapes - CSV format
64+
PlanShapes/CSV/CsvPlanDocument.cc
65+
PlanShapes/CSV/CsvPlanDocument.h
66+
PlanShapes/CSV/CsvPlanExporter.cc
67+
PlanShapes/CSV/CsvPlanExporter.h
68+
PlanShapes/CSV/CsvPlanImporter.cc
69+
PlanShapes/CSV/CsvPlanImporter.h
70+
71+
# PlanShapes - GeoJSON format
72+
PlanShapes/GeoJSON/GeoJsonPlanDocument.cc
73+
PlanShapes/GeoJSON/GeoJsonPlanDocument.h
74+
PlanShapes/GeoJSON/GeoJsonPlanExporter.cc
75+
PlanShapes/GeoJSON/GeoJsonPlanExporter.h
76+
PlanShapes/GeoJSON/GeoJsonPlanImporter.cc
77+
PlanShapes/GeoJSON/GeoJsonPlanImporter.h
78+
79+
# PlanShapes - GPX format
80+
PlanShapes/GPX/GpxPlanDocument.cc
81+
PlanShapes/GPX/GpxPlanDocument.h
82+
PlanShapes/GPX/GpxPlanExporter.cc
83+
PlanShapes/GPX/GpxPlanExporter.h
84+
PlanShapes/GPX/GpxPlanImporter.cc
85+
PlanShapes/GPX/GpxPlanImporter.h
86+
87+
# PlanShapes - KML format
88+
PlanShapes/KML/KMLPlanDomDocument.cc
89+
PlanShapes/KML/KMLPlanDomDocument.h
90+
PlanShapes/KML/KmlPlanExporter.cc
91+
PlanShapes/KML/KmlPlanExporter.h
92+
PlanShapes/KML/KmlPlanImporter.cc
93+
PlanShapes/KML/KmlPlanImporter.h
94+
PlanShapes/KML/KmzPlanExporter.cc
95+
PlanShapes/KML/KmzPlanExporter.h
96+
PlanShapes/KML/KmzPlanImporter.cc
97+
PlanShapes/KML/KmzPlanImporter.h
98+
99+
# PlanShapes - OpenAir format
100+
PlanShapes/OpenAir/OpenAirPlanImporter.cc
101+
PlanShapes/OpenAir/OpenAirPlanImporter.h
102+
103+
# PlanShapes - SHP format
104+
PlanShapes/SHP/ShpPlanDocument.cc
105+
PlanShapes/SHP/ShpPlanDocument.h
106+
PlanShapes/SHP/ShpPlanExporter.cc
107+
PlanShapes/SHP/ShpPlanExporter.h
108+
PlanShapes/SHP/ShpPlanImporter.cc
109+
PlanShapes/SHP/ShpPlanImporter.h
110+
111+
# PlanShapes - WKT format
112+
PlanShapes/WKT/WktPlanDocument.cc
113+
PlanShapes/WKT/WktPlanDocument.h
114+
PlanShapes/WKT/WktPlanExporter.cc
115+
PlanShapes/WKT/WktPlanExporter.h
116+
PlanShapes/WKT/WktPlanImporter.cc
117+
PlanShapes/WKT/WktPlanImporter.h
118+
54119
RallyPoint.cc
55120
RallyPointController.cc
56121
RallyPointController.h
@@ -89,7 +154,17 @@ qt_add_resources(${CMAKE_PROJECT_NAME} json_mission_manager
89154
FILES ${JSON_FILES}
90155
)
91156

92-
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
157+
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
158+
${CMAKE_CURRENT_SOURCE_DIR}
159+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes
160+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/CSV
161+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/GeoJSON
162+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/GPX
163+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/KML
164+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/OpenAir
165+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/SHP
166+
${CMAKE_CURRENT_SOURCE_DIR}/PlanShapes/WKT
167+
)
93168

94169
# qt_add_qml_module(QGC
95170
# URI QGroundControl.MissionManager

src/MissionManager/ComplexMissionItem.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "PlanMasterController.h"
66
#include "FlightPathSegment.h"
77
#include "MissionController.h"
8-
#include "KMLPlanDomDocument.h"
98
#include "SettingsManager.h"
109

1110
#include <QtCore/QCborMap>
@@ -101,11 +100,6 @@ QJsonObject ComplexMissionItem::_loadPresetJson(const QString& name)
101100
return QCborValue::fromVariant(settings.value(name)).toMap().toJsonObject();
102101
}
103102

104-
void ComplexMissionItem::addKMLVisuals(KMLPlanDomDocument& /* domDocument */)
105-
{
106-
// Default implementation has no visuals
107-
}
108-
109103
void ComplexMissionItem::_appendFlightPathSegment(FlightPathSegment::SegmentType segmentType, const QGeoCoordinate& coord1, double coord1AMSLAlt, const QGeoCoordinate& coord2, double coord2AMSLAlt)
110104
{
111105
FlightPathSegment* segment = new FlightPathSegment(segmentType, coord1, coord1AMSLAlt, coord2, coord2AMSLAlt, true /* queryTerrainData */, this /* parent */);

src/MissionManager/ComplexMissionItem.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class PlanMasterController;
88
class MissionController;
9-
class KMLPlanDomDocument;
109

1110
class ComplexMissionItem : public VisualMissionItem
1211
{
@@ -80,8 +79,6 @@ class ComplexMissionItem : public VisualMissionItem
8079
/// Empty string signals no support for presets.
8180
virtual QString presetsSettingsGroup(void) { return QString(); }
8281

83-
virtual void addKMLVisuals(KMLPlanDomDocument& domDocument);
84-
8582
bool presetsSupported (void) { return !presetsSettingsGroup().isEmpty(); }
8683
bool isIncomplete (void) const { return _isIncomplete; }
8784

src/MissionManager/CorridorScanComplexItem.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ QGC_LOGGING_CATEGORY(CorridorScanComplexItemLog, "Plan.CorridorScanComplexItemL"
1212

1313
const QString CorridorScanComplexItem::name(CorridorScanComplexItem::tr("Corridor Scan"));
1414

15-
CorridorScanComplexItem::CorridorScanComplexItem(PlanMasterController* masterController, bool flyView, const QString& kmlOrShpFile)
15+
CorridorScanComplexItem::CorridorScanComplexItem(PlanMasterController* masterController, bool flyView, const QString& shapeFile)
1616
: TransectStyleComplexItem (masterController, flyView, settingsGroup)
1717
, _entryPointLocation (EntryPointDefaultOrder)
1818
, _metaDataMap (FactMetaData::createMapFromJsonFile(QStringLiteral(":/json/CorridorScan.SettingsGroup.json"), this))
@@ -36,8 +36,8 @@ CorridorScanComplexItem::CorridorScanComplexItem(PlanMasterController* masterCon
3636
connect(&_corridorPolyline, &QGCMapPolyline::isValidChanged, this, &CorridorScanComplexItem::_updateWizardMode);
3737
connect(&_corridorPolyline, &QGCMapPolyline::traceModeChanged, this, &CorridorScanComplexItem::_updateWizardMode);
3838

39-
if (!kmlOrShpFile.isEmpty()) {
40-
_corridorPolyline.loadKMLOrSHPFile(kmlOrShpFile);
39+
if (!shapeFile.isEmpty()) {
40+
_corridorPolyline.loadShapeFile(shapeFile);
4141
_corridorPolyline.setDirty(false);
4242
}
4343
setDirty(false);

src/MissionManager/CorridorScanComplexItem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class CorridorScanComplexItem : public TransectStyleComplexItem
1414

1515
public:
1616
/// @param flyView true: Created for use in the Fly View, false: Created for use in the Plan View
17-
/// @param kmlOrShpFile Polyline comes from this file, empty for default polyline
18-
CorridorScanComplexItem(PlanMasterController* masterController, bool flyView, const QString& kmlOrShpFile);
17+
/// @param shapeFile Polyline comes from this file, empty for default polyline
18+
CorridorScanComplexItem(PlanMasterController* masterController, bool flyView, const QString& shapeFile);
1919

2020
Q_PROPERTY(QGCMapPolyline* corridorPolyline READ corridorPolyline CONSTANT)
2121
Q_PROPERTY(Fact* corridorWidth READ corridorWidth CONSTANT)

0 commit comments

Comments
 (0)