Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D View changes and fixes #11048

Merged
merged 5 commits into from
Feb 25, 2024
Merged

3D View changes and fixes #11048

merged 5 commits into from
Feb 25, 2024

Conversation

omid-esrafilian
Copy link
Contributor

@omid-esrafilian omid-esrafilian commented Feb 11, 2024

The following changes have been made regarding the 3D viewer:

  • Touchscreen is supported now
  • Uploading an OSM file is not mandatory anymore to use the 3D View
  • docs is updated with more details on how to use the 3D View and also the build instructions
  • Viewer3DManager is also initialized when the 3D view is opened
  • Using Flickable in the 3D view Setting menu
  • The camera is initialized facing downward when the 3D view is opened for the first time.

@omid-esrafilian omid-esrafilian changed the title 3D View new changes: OSM file is not mondatory, docs updated, using f… 3D View new changes Feb 11, 2024
@omid-esrafilian omid-esrafilian changed the title 3D View new changes 3D View changes and fixes Feb 11, 2024
…lickable for 3D Settings, using Loader for Viewer3DManager, touchscreen added
@DonLakeFlyer
Copy link
Contributor

  • Using Flickable in the 3D view Setting menu

This is shown in a QGCPopupDialog. QGCPopupDialog automatically sizes itself to fit what you put in it never growing larger than what will fit within the screen. It already has a Flickable in it so if your content needs to scroll to fit the screen it will happen automatically. No need to do it yourself. Was that not working for you?

@DonLakeFlyer
Copy link
Contributor

In reality the Viewer3DSettingsMenu should just use QGCPopupDialog as its base class. And name it not with the word Menu. Then you just put that into a Component when you need to use it.

@DonLakeFlyer
Copy link
Contributor

And then for dialogs the best structure tends to be:
QGCPopupDialog {
ColumnLayout {
....
}
}

This way the layout automatically sizes to as much as put into it. Which will in turn correctly size the dialog. Tons of example usage in the codebase.

@omid-esrafilian
Copy link
Contributor Author

@DonLakeFlyer
Thanks for the information.
I didn't know that QGCPopupDialog has a Flickable. So, as you suggested I changed the Viewer3DSettingsMenu.
I also renamed it to Viewer3DSettingsDialog.
Please let me know if it makes sense now.

@@ -66,7 +66,7 @@ ToolStripActionList {
enabled: false
visible: enabled
onTriggered:{
viewer3DWindow.settingMenuOpen = !viewer3DWindow.settingMenuOpen
viewer3DWindow.settingsDialogOpen = !viewer3DWindow.settingsDialogOpen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triggering things other than visibility to happen on boolean state changes is pretty odd. This sort of thing is much better handled by a function in Viewer3DWindow like showSettingsDialog() which then creates the settings dialog component. Much clearer as to what it does.

@DonLakeFlyer
Copy link
Contributor

I'd like to also clean up the fact that the 3D View button is always visible even though the majority of users will not use this. I think the way to do this is as follows:

  • Make the 3d view settings available as a separate group in Fly View settings
  • Add ability to clear the OSM file if not already possible
  • Only show the 3D View button in fly view if there is an OSM file specified
  • They I wonder what you think about still leaving the Settings button in the Fly View as well when the 3d map is displayed? Is that needed/useful? Or just make them go back to the regular settings place.

@omid-esrafilian
Copy link
Contributor Author

omid-esrafilian commented Feb 22, 2024

@DonLakeFlyer
Thanks for the feedback. Sure, I will replace all the boolean states with functions to make them more readable.

I will also move the 3D View settings to the Fly View settings in a separate group with the changes you suggested.
Regarding your question, for the moment most of the settings are quite general, so we can remove the setting icon in this case and move them back to the regular settings place. I'd like also to add more settings such as the camera movement/rotation/zoom speed.

about how to enable the 3D view, what about adding a Toggle Switch in the Fly View settings to enable the 3D view? This way, it will not be mandatory to upload an OSM file to use the 3D view. Just in case, if someone only wants to show the 3D vehicle and the waypoints. So, what do you think?

@DonLakeFlyer
Copy link
Contributor

Just in case, if someone only wants to show the 3D vehicle and the waypoints.

Ah, yeah. That makes sense from a good use case.

@omid-esrafilian
Copy link
Contributor Author

omid-esrafilian commented Feb 24, 2024

@DonLakeFlyer
I have moved the 3D View settings as a separate group to the Fly View settings as you suggested. There is now an enabled switch to enable the 3D view as well as a clear button for the OSM map file. I removed the Settings button/icon in the 3D View too.
Please let me know if that looks good to you, then I will update the docs accordingly.

@DonLakeFlyer
Copy link
Contributor

Looks fantastic, thanks

@DonLakeFlyer DonLakeFlyer merged commit fb32624 into mavlink:master Feb 25, 2024
9 checks passed
@omid-esrafilian
Copy link
Contributor Author

@DonLakeFlyer
Thanks. So, I will update the docs for the 3D View in a separate pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants