-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Viewer3DSettingsMenu is changed to Viewer3DSettingsDialog
- Loading branch information
1 parent
5d1421f
commit 421464a
Showing
5 changed files
with
43 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ Node { | |
PerspectiveCamera { | ||
|
||
id: cameraPerspectiveOne | ||
clipFar: 100000 | ||
|
||
eulerRotation{ | ||
x: -90 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,16 @@ import QGroundControl.Palette | |
import QGroundControl.ScreenTools | ||
import QGroundControl.Controls | ||
|
||
// 3D Viewer modules | ||
import QGroundControl.Viewer3D | ||
import Viewer3D.Models3D | ||
|
||
|
||
/// @author Omid Esrafilian <[email protected]> | ||
|
||
Item{ | ||
id: viewer3DBody | ||
property bool viewer3DOpen: false | ||
property bool settingMenuOpen: false | ||
property bool settingsDialogOpen: false | ||
|
||
Component{ | ||
id: viewer3DManagerComponent | ||
|
@@ -58,36 +59,22 @@ Item{ | |
} | ||
} | ||
|
||
onSettingMenuOpenChanged:{ | ||
if(settingMenuOpen === true){ | ||
settingMenuComponent.createObject(mainWindow).open() | ||
onSettingsDialogOpenChanged:{ | ||
if(settingsDialogOpen === true){ | ||
settingsDialogComponent.createObject(mainWindow).open() | ||
} | ||
} | ||
|
||
Component { | ||
id: settingMenuComponent | ||
|
||
QGCPopupDialog{ | ||
id: settingMenuDialog | ||
title: qsTr("3D view settings") | ||
buttons: Dialog.Ok | Dialog.Cancel | ||
id: settingsDialogComponent | ||
|
||
Viewer3DSettingMenu{ | ||
id: viewer3DSettingMenu | ||
viewer3DManager: view3DManagerLoader.item | ||
visible: true | ||
} | ||
|
||
onRejected: { | ||
settingMenuOpen = false | ||
viewer3DSettingMenu.menuClosed(false) | ||
settingMenuDialog.close() | ||
} | ||
Viewer3DSettingsDialog{ | ||
id: view3DSettingsDialog | ||
viewer3DManager: view3DManagerLoader.item | ||
visible: true | ||
|
||
onAccepted: { | ||
settingMenuOpen = false | ||
viewer3DSettingMenu.menuClosed(true) | ||
settingMenuDialog.close() | ||
onClosed:{ | ||
settingsDialogOpen = false | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,41 +7,24 @@ import QGroundControl.Palette | |
import QGroundControl.ScreenTools | ||
import QGroundControl.Controls | ||
|
||
import QGroundControl.Viewer3D | ||
|
||
/// @author Omid Esrafilian <[email protected]> | ||
|
||
Flickable { | ||
QGCPopupDialog{ | ||
property var viewer3DManager: null | ||
|
||
signal menuClosed(bool accept) | ||
title: qsTr("3D view settings") | ||
buttons: Dialog.Ok | Dialog.Cancel | ||
|
||
property var viewer3DManager: null | ||
property int leftMarginSpace: ScreenTools.defaultFontPixelWidth | ||
|
||
id: window_body | ||
clip: true | ||
visible: true | ||
width: Screen.width * 0.25 | ||
height: Screen.height * 0.2 | ||
contentWidth: width; | ||
contentHeight: main_column.height | ||
boundsBehavior: Flickable.StopAtBounds | ||
ScrollBar.vertical: ScrollBar {} | ||
|
||
Column { | ||
id: main_column | ||
anchors{ | ||
right: parent.right | ||
left: parent.left | ||
margins: ScreenTools.defaultFontPixelWidth | ||
} | ||
spacing: ScreenTools.defaultFontPixelHeight * 0.5 | ||
ColumnLayout { | ||
property int leftMarginSpace: ScreenTools.defaultFontPixelWidth | ||
|
||
id: window_body | ||
clip: true | ||
visible: true | ||
spacing: ScreenTools.defaultFontPixelHeight / 2 | ||
RowLayout{ | ||
anchors{ | ||
right: parent.right | ||
left: parent.left | ||
} | ||
Layout.fillWidth: true | ||
QGCLabel { | ||
wrapMode: Text.WordWrap | ||
visible: true | ||
|
@@ -55,19 +38,19 @@ Flickable { | |
showUnits: false | ||
visible: true | ||
Layout.fillWidth: true | ||
implicitWidth: ScreenTools.defaultFontPixelWidth * 50 | ||
|
||
|
||
readOnly: true | ||
|
||
text: (viewer3DManager)?(viewer3DManager.viewer3DSetting.osmFilePath.rawValue):("nan") | ||
} | ||
} | ||
RowLayout{ | ||
anchors{ | ||
right: parent.right | ||
left: parent.left | ||
} | ||
Layout.alignment: Qt.AlignRight | ||
|
||
QGCButton { | ||
id: map_file_btn | ||
Layout.alignment: Qt.AlignRight | ||
|
||
visible: true | ||
text: qsTr("Select File") | ||
|
@@ -89,15 +72,14 @@ Flickable { | |
} | ||
|
||
GridLayout{ | ||
anchors{ | ||
left: parent.left | ||
} | ||
columns: 2 | ||
columnSpacing: ScreenTools.defaultFontPixelHeight | ||
rowSpacing: ScreenTools.defaultFontPixelWidth | ||
Layout.fillWidth: true | ||
|
||
QGCLabel { | ||
wrapMode: Text.WordWrap | ||
Layout.fillWidth: true | ||
text: qsTr("Average Building Level Height:") | ||
} | ||
|
||
|
@@ -124,6 +106,7 @@ Flickable { | |
QGCLabel { | ||
wrapMode: Text.WordWrap | ||
visible: true | ||
Layout.fillWidth: true | ||
text: qsTr("Vehicles Altitude Bias:") | ||
} | ||
|
||
|
@@ -149,16 +132,14 @@ Flickable { | |
} | ||
} | ||
|
||
onMenuClosed: function (accept){ | ||
if(accept === true){ | ||
viewer3DManager.qmlBackend.osmFilePath = map_file_text_feild.text | ||
viewer3DManager.qmlBackend.altitudeBias = parseFloat(height_bias_textfeild.text) | ||
onAccepted: { | ||
viewer3DManager.qmlBackend.osmFilePath = map_file_text_feild.text | ||
viewer3DManager.qmlBackend.altitudeBias = parseFloat(height_bias_textfeild.text) | ||
|
||
viewer3DManager.viewer3DSetting.osmFilePath.rawValue = map_file_text_feild.text | ||
viewer3DManager.viewer3DSetting.buildingLevelHeight.rawValue = parseFloat(bld_level_height_textfeild.text) | ||
viewer3DManager.viewer3DSetting.altitudeBias.rawValue = parseFloat(height_bias_textfeild.text) | ||
viewer3DManager.viewer3DSetting.osmFilePath.rawValue = map_file_text_feild.text | ||
viewer3DManager.viewer3DSetting.buildingLevelHeight.rawValue = parseFloat(bld_level_height_textfeild.text) | ||
viewer3DManager.viewer3DSetting.altitudeBias.rawValue = parseFloat(height_bias_textfeild.text) | ||
|
||
viewer3DManager.osmParser.buildingLevelHeight = parseFloat(bld_level_height_textfeild.text) | ||
} | ||
viewer3DManager.osmParser.buildingLevelHeight = parseFloat(bld_level_height_textfeild.text) | ||
} | ||
} |