diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dd418888..0b89b4e41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,9 @@ find_package(ignition-cmake2 2.14 REQUIRED) #============================================================================ # Configure the project #============================================================================ -ign_configure_project() +ign_configure_project( + REPLACE_IGNITION_INCLUDE_PATH gz/gui +) #============================================================================ # Set project-specific options diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 147239ce5..a1c121ea4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1 @@ -See the [Ignition Robotics contributing guide](https://ignitionrobotics.org/docs/all/contributing). +See the [Gazebo contributing guide](https://gazebosim.org/docs/all/contributing). diff --git a/Changelog.md b/Changelog.md index c1069f0a2..b90db2f71 100644 --- a/Changelog.md +++ b/Changelog.md @@ -43,7 +43,7 @@ 1. Ignition -> Gazebo * [Pull request #435](https://github.com/gazebosim/gz-gui/pull/435) -### Ignition Gui 3.10.0 (2022-07-13) +### Gazebo Gui 3.10.0 (2022-07-13) 1. Add common widget for vector3 * [Pull request #427](https://github.com/gazebosim/gz-gui/pull/427) @@ -61,7 +61,7 @@ 1. Common widget GzColor * [Pull request #410](https://github.com/gazebosim/gz-gui/pull/410) -1. Fix ign_TEST +1. Fix gz_TEST * [Pull request #420](https://github.com/gazebosim/gz-gui/pull/420) 1. Make display tests more robust @@ -101,227 +101,227 @@ 1. Backport GridConfig improvements to Citadel's Grid3D * [Pull request #363](https://github.com/gazebosim/gz-gui/pull/363) -### Ignition Gui 3.9.0 (2022-01-14) +### Gazebo Gui 3.9.0 (2022-01-14) 1. Added a button that allows shutting down both the client and server. - * [Pull request #335](https://github.com/ignitionrobotics/ign-gui/pull/335) + * [Pull request #335](https://github.com/gazebosim/gz-gui/pull/335) 1. Prevent Scene3D 💥 if another scene is already loaded - * [Pull request #347](https://github.com/ignitionrobotics/ign-gui/pull/347) + * [Pull request #347](https://github.com/gazebosim/gz-gui/pull/347) 1. Add project() to examples and remove hard-dependency on Ogre1 - * [Pull request #345](https://github.com/ignitionrobotics/ign-gui/pull/345) + * [Pull request #345](https://github.com/gazebosim/gz-gui/pull/345) 1. Fix codecheck - * [Pull request #329](https://github.com/ignitionrobotics/ign-gui/pull/329) + * [Pull request #329](https://github.com/gazebosim/gz-gui/pull/329) 1. Use `qmldir` to define QML module with `IgnSpinBox` - * [Pull request #319](https://github.com/ignitionrobotics/ign-gui/pull/319) + * [Pull request #319](https://github.com/gazebosim/gz-gui/pull/319) 1. Fix `TopicEcho` plugin message display - * [Pull request #322](https://github.com/ignitionrobotics/ign-gui/pull/322) + * [Pull request #322](https://github.com/gazebosim/gz-gui/pull/322) 1. Don't crash if a plugin has invalid QML - * [Pull request #315](https://github.com/ignitionrobotics/ign-gui/pull/315) + * [Pull request #315](https://github.com/gazebosim/gz-gui/pull/315) 1. Added log storing for `ign gui` CLI - * [Pull request #272](https://github.com/ignitionrobotics/ign-gui/pull/272) + * [Pull request #272](https://github.com/gazebosim/gz-gui/pull/272) -### Ignition Gui 3.8.0 (2021-10-12) +### Gazebo Gui 3.8.0 (2021-10-12) 1. Improved doxygen - * [Pull request #275](https://github.com/ignitionrobotics/ign-gui/pull/275) + * [Pull request #275](https://github.com/gazebosim/gz-gui/pull/275) 1. Add a filter to the plugin menu - * [Pull request #277](https://github.com/ignitionrobotics/ign-gui/pull/277) + * [Pull request #277](https://github.com/gazebosim/gz-gui/pull/277) 1. 👩‍🌾 Remove bitbucket-pipelines.yml - * [Pull request #274](https://github.com/ignitionrobotics/ign-gui/pull/274) + * [Pull request #274](https://github.com/gazebosim/gz-gui/pull/274) 1. Require ign-rendering 3.5 - * [Pull request #264](https://github.com/ignitionrobotics/ign-gui/pull/264) + * [Pull request #264](https://github.com/gazebosim/gz-gui/pull/264) 1. New teleop plugin implementation. - * [Pull request #245](https://github.com/ignitionrobotics/ign-gui/pull/245) + * [Pull request #245](https://github.com/gazebosim/gz-gui/pull/245) -### Ignition Gui 3.7.0 (2021-07-14) +### Gazebo Gui 3.7.0 (2021-07-14) 1. Fix codeowners - * [Pull request #251](https://github.com/ignitionrobotics/ign-gui/pull/251) + * [Pull request #251](https://github.com/gazebosim/gz-gui/pull/251) 1. Fix plugin added signal, add PluginByName - * [Pull request #249](https://github.com/ignitionrobotics/ign-gui/pull/249) + * [Pull request #249](https://github.com/gazebosim/gz-gui/pull/249) 1. Fixed tests by passing valid argv - * [Pull request #244](https://github.com/ignitionrobotics/ign-gui/pull/244) + * [Pull request #244](https://github.com/gazebosim/gz-gui/pull/244) 1. Screenshot plugin fixed dbg message - * [Pull request #246](https://github.com/ignitionrobotics/ign-gui/pull/246) + * [Pull request #246](https://github.com/gazebosim/gz-gui/pull/246) 1. Detect ign instead of using cmake module to check for ignition-tools - * [Pull request #240](https://github.com/ignitionrobotics/ign-gui/pull/240) + * [Pull request #240](https://github.com/gazebosim/gz-gui/pull/240) -### Ignition Gui 3.6.0 (2021-06-17) +### Gazebo Gui 3.6.0 (2021-06-17) 1. Update codeowners - * [Pull request #232](https://github.com/ignitionrobotics/ign-gui/pull/232) + * [Pull request #232](https://github.com/gazebosim/gz-gui/pull/232) 1. Confirmation dialog when closing main window - * [Pull request #225](https://github.com/ignitionrobotics/ign-gui/pull/225) + * [Pull request #225](https://github.com/gazebosim/gz-gui/pull/225) 1. Avoid grid3D crash - * [Pull request #227](https://github.com/ignitionrobotics/ign-gui/pull/227) + * [Pull request #227](https://github.com/gazebosim/gz-gui/pull/227) 1. Emit more events from Scene3D - * [Pull request #213](https://github.com/ignitionrobotics/ign-gui/pull/213) + * [Pull request #213](https://github.com/gazebosim/gz-gui/pull/213) 1. Removed duplicated code with rendering::sceneFromFirstRenderEngine - * [Pull request #223](https://github.com/ignitionrobotics/ign-gui/pull/223) + * [Pull request #223](https://github.com/gazebosim/gz-gui/pull/223) 1. Remove `tools/code_check` and update codecov - * [Pull request #222](https://github.com/ignitionrobotics/ign-gui/pull/222) + * [Pull request #222](https://github.com/gazebosim/gz-gui/pull/222) 1. Fixed material specular in `Scene3D` - * [Pull request #218](https://github.com/ignitionrobotics/ign-gui/pull/218) + * [Pull request #218](https://github.com/gazebosim/gz-gui/pull/218) 1. `check_test_ran.py`: remove grep/xsltproc - * [Pull request #203](https://github.com/ignitionrobotics/ign-gui/pull/203) + * [Pull request #203](https://github.com/gazebosim/gz-gui/pull/203) -### Ignition Gui 3.5.1 (2021-03-18) +### Gazebo Gui 3.5.1 (2021-03-18) 1. Scene3D: port mesh material fixes from ign-gazebo - * [Pull request #191](https://github.com/ignitionrobotics/ign-gui/pull/191) + * [Pull request #191](https://github.com/gazebosim/gz-gui/pull/191) 1. Improve the height of plugins in the right split - * [Pull request #194](https://github.com/ignitionrobotics/ign-gui/pull/194) + * [Pull request #194](https://github.com/gazebosim/gz-gui/pull/194) -### Ignition Gui 3.5.0 (2021-03-10) +### Gazebo Gui 3.5.0 (2021-03-10) 1. Screenshot plugin - * [Pull request #170](https://github.com/ignitionrobotics/ign-gui/pull/170) + * [Pull request #170](https://github.com/gazebosim/gz-gui/pull/170) 1. Master branch updates - * [Pull request #187](https://github.com/ignitionrobotics/ign-gui/pull/187) + * [Pull request #187](https://github.com/gazebosim/gz-gui/pull/187) 1. Backport Publisher test from v4 - * [Pull request #173](https://github.com/ignitionrobotics/ign-gui/pull/173) + * [Pull request #173](https://github.com/gazebosim/gz-gui/pull/173) 1. Better error messages when component can't be loaded - * [Pull request #175](https://github.com/ignitionrobotics/ign-gui/pull/175) + * [Pull request #175](https://github.com/gazebosim/gz-gui/pull/175) 1. Make Grid3D plugin more flexible - * [Pull request #172](https://github.com/ignitionrobotics/ign-gui/pull/172) + * [Pull request #172](https://github.com/gazebosim/gz-gui/pull/172) 1. Add Windows Installation - * [Pull request #168](https://github.com/ignitionrobotics/ign-gui/pull/168) + * [Pull request #168](https://github.com/gazebosim/gz-gui/pull/168) 1. Fix codecheck - * [Pull request #157](https://github.com/ignitionrobotics/ign-gui/pull/157) + * [Pull request #157](https://github.com/gazebosim/gz-gui/pull/157) -### Ignition Gui 3.4.0 (2020-12-10) +### Gazebo Gui 3.4.0 (2020-12-10) 1. Publish plugin API docs - * [Pull request 128](https://github.com/ignitionrobotics/ign-gui/pull/128) + * [Pull request 128](https://github.com/gazebosim/gz-gui/pull/128) 1. Tutorial tweaks - * [Pull request 132](https://github.com/ignitionrobotics/ign-gui/pull/132) + * [Pull request 132](https://github.com/gazebosim/gz-gui/pull/132) 1. Floating and standalone plugins respect minimum dimensions - * [Pull request 135](https://github.com/ignitionrobotics/ign-gui/pull/135) + * [Pull request 135](https://github.com/gazebosim/gz-gui/pull/135) 1. Add scrollable indicator for plugin menu - * [Pull request 134](https://github.com/ignitionrobotics/ign-gui/pull/134) + * [Pull request 134](https://github.com/gazebosim/gz-gui/pull/134) 1. Re-enable image.config test - * [Pull request 148](https://github.com/ignitionrobotics/ign-gui/pull/148) + * [Pull request 148](https://github.com/gazebosim/gz-gui/pull/148) 1. Improve fork experience - * [Pull request 139](https://github.com/ignitionrobotics/ign-gui/pull/139) + * [Pull request 139](https://github.com/gazebosim/gz-gui/pull/139) 1. Resolve updated codecheck issues - * [Pull request 144](https://github.com/ignitionrobotics/ign-gui/pull/144) + * [Pull request 144](https://github.com/gazebosim/gz-gui/pull/144) 1. Port Gazebo GUI events to Ignition GUI - * [Pull request 148](https://github.com/ignitionrobotics/ign-gui/pull/148) + * [Pull request 148](https://github.com/gazebosim/gz-gui/pull/148) 1. Change deprecated Qt::MidButton - * [Pull request 153](https://github.com/ignitionrobotics/ign-gui/pull/153) + * [Pull request 153](https://github.com/gazebosim/gz-gui/pull/153) 1. Add right mouse events and tests - * [Pull request 154](https://github.com/ignitionrobotics/ign-gui/pull/154) + * [Pull request 154](https://github.com/gazebosim/gz-gui/pull/154) -### Ignition Gui 3.3.0 (2020-08-31) +### Gazebo Gui 3.3.0 (2020-08-31) 1. rename key publisher plugin - * [Pull request 93](https://github.com/ignitionrobotics/ign-gui/pull/93) + * [Pull request 93](https://github.com/gazebosim/gz-gui/pull/93) 1. Add shift + drag to rotate camera - * [Pull request 96](https://github.com/ignitionrobotics/ign-gui/pull/96) + * [Pull request 96](https://github.com/gazebosim/gz-gui/pull/96) 1. Scroll bar adjustment - * [Pull request 97](https://github.com/ignitionrobotics/ign-gui/pull/97) + * [Pull request 97](https://github.com/gazebosim/gz-gui/pull/97) 1. Minimize GUI plugin - * [Pull request 84](https://github.com/ignitionrobotics/ign-gui/pull/84) - * [Pull request 99](https://github.com/ignitionrobotics/ign-gui/pull/99) - * [Pull request 102](https://github.com/ignitionrobotics/ign-gui/pull/102) + * [Pull request 84](https://github.com/gazebosim/gz-gui/pull/84) + * [Pull request 99](https://github.com/gazebosim/gz-gui/pull/99) + * [Pull request 102](https://github.com/gazebosim/gz-gui/pull/102) 1. Fix tests on actions - * [Pull request 98](https://github.com/ignitionrobotics/ign-gui/pull/98) + * [Pull request 98](https://github.com/gazebosim/gz-gui/pull/98) 1. Disable failing tests - * [Pull request 76](https://github.com/ignitionrobotics/ign-gui/pull/76) + * [Pull request 76](https://github.com/gazebosim/gz-gui/pull/76) 1. Use world name in default topics - * [Pull request 104](https://github.com/ignitionrobotics/ign-gui/pull/104) + * [Pull request 104](https://github.com/gazebosim/gz-gui/pull/104) 1. Fix running plugins with bad world name - * [Pull request 107](https://github.com/ignitionrobotics/ign-gui/pull/107) - * [Pull request 110](https://github.com/ignitionrobotics/ign-gui/pull/110) - * [Pull request 111](https://github.com/ignitionrobotics/ign-gui/pull/111) + * [Pull request 107](https://github.com/gazebosim/gz-gui/pull/107) + * [Pull request 110](https://github.com/gazebosim/gz-gui/pull/110) + * [Pull request 111](https://github.com/gazebosim/gz-gui/pull/111) 1. Disable more tests known to fail on macOS and Windows - * [Pull request 112](https://github.com/ignitionrobotics/ign-gui/pull/112) + * [Pull request 112](https://github.com/gazebosim/gz-gui/pull/112) 1. Add render event - * [Pull request 70](https://github.com/ignitionrobotics/ign-gui/pull/70) + * [Pull request 70](https://github.com/gazebosim/gz-gui/pull/70) 1. Fixed left menu events - * [Pull request 85](https://github.com/ignitionrobotics/ign-gui/pull/85) + * [Pull request 85](https://github.com/gazebosim/gz-gui/pull/85) 1. Added Topic Viewer plugin, list all transport topics - * [Pull request 69](https://github.com/ignitionrobotics/ign-gui/pull/69) + * [Pull request 69](https://github.com/gazebosim/gz-gui/pull/69) 1. Fix ImageDisplay in Ubuntu 20.04 - * [Pull request 96](https://github.com/ignitionrobotics/ign-gui/pull/96) + * [Pull request 96](https://github.com/gazebosim/gz-gui/pull/96) -### Ignition Gui 3.2.0 (2020-06-22) +### Gazebo Gui 3.2.0 (2020-06-22) 1. Sort GUI plugins alphabetically - * [Pull request 71](https://github.com/ignitionrobotics/ign-gui/pull/71) + * [Pull request 71](https://github.com/gazebosim/gz-gui/pull/71) 1. Add color palette to plugin settings to change background color - * [Pull request 62](https://github.com/ignitionrobotics/ign-gui/pull/62) + * [Pull request 62](https://github.com/gazebosim/gz-gui/pull/62) 1. Close plugin menu after a plugin has been added - * [Pull request 60](https://github.com/ignitionrobotics/ign-gui/pull/60) + * [Pull request 60](https://github.com/gazebosim/gz-gui/pull/60) 1. Resize undocked plugins by dragging corners - * [Pull request 78](https://github.com/ignitionrobotics/ign-gui/pull/78) + * [Pull request 78](https://github.com/gazebosim/gz-gui/pull/78) 1. Move each plugin to its own directory - * [Pull request 64](https://github.com/ignitionrobotics/ign-gui/pull/64) + * [Pull request 64](https://github.com/gazebosim/gz-gui/pull/64) 1. Add Key Publisher plugin - * [Pull request 81](https://github.com/ignitionrobotics/ign-gui/pull/81) + * [Pull request 81](https://github.com/gazebosim/gz-gui/pull/81) 1. GitHub migration - * [Pull request 46](https://github.com/ignitionrobotics/ign-gui/pull/46) - * [Pull request 47](https://github.com/ignitionrobotics/ign-gui/pull/47) - * [Pull request 56](https://github.com/ignitionrobotics/ign-gui/pull/56) - * [Pull request 57](https://github.com/ignitionrobotics/ign-gui/pull/57) + * [Pull request 46](https://github.com/gazebosim/gz-gui/pull/46) + * [Pull request 47](https://github.com/gazebosim/gz-gui/pull/47) + * [Pull request 56](https://github.com/gazebosim/gz-gui/pull/56) + * [Pull request 57](https://github.com/gazebosim/gz-gui/pull/57) -### Ignition Gui 3.1.0 (2020-03-27) +### Gazebo Gui 3.1.0 (2020-03-27) 1. Remove old ign-gui0 stuff * [BitBucket pull request 248](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/248) @@ -373,7 +373,7 @@ * [BitBucket pull request 228](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/228) * [BitBucket pull request 230](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/230) -### Ignition Gui 3.0.0 (2019-12-10) +### Gazebo Gui 3.0.0 (2019-12-10) 1. Depend on ign-transport8 and ign-msgs5 * [BitBucket pull request 225](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/225) @@ -381,73 +381,73 @@ 1. Depend on ign-rendering3 * [BitBucket pull request 221](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/221) -## Ignition Gui 2 +## Gazebo Gui 2 -### Ignition Gui 2.3.3 (2020-08-31) +### Gazebo Gui 2.3.3 (2020-08-31) 1. Fix running plugins with bad world names. - * [Pull request 111](https://github.com/ignitionrobotics/ign-gui/pull/111) + * [Pull request 111](https://github.com/gazebosim/gz-gui/pull/111) 1. Disable more tests known to fail on macOS and Windows. - * [Pull request 112](https://github.com/ignitionrobotics/ign-gui/pull/112) + * [Pull request 112](https://github.com/gazebosim/gz-gui/pull/112) -### Ignition Gui 2.3.2 (2020-08-19) +### Gazebo Gui 2.3.2 (2020-08-19) 1. Revert pull request #107 - * [Pull request 110](https://github.com/ignitionrobotics/ign-gui/pull/110) + * [Pull request 110](https://github.com/gazebosim/gz-gui/pull/110) -### Ignition Gui 2.3.1 (2020-08-17) +### Gazebo Gui 2.3.1 (2020-08-17) 1. Fix running plugins with bad world name - * [Pull request 107](https://github.com/ignitionrobotics/ign-gui/pull/107) + * [Pull request 107](https://github.com/gazebosim/gz-gui/pull/107) -### Ignition Gui 2.3.0 (2020-08-11) +### Gazebo Gui 2.3.0 (2020-08-11) 1. Add shift + drag to rotate camera - * [Pull request 96](https://github.com/ignitionrobotics/ign-gui/pull/96) + * [Pull request 96](https://github.com/gazebosim/gz-gui/pull/96) 1. Scroll bar adjustment - * [Pull request 97](https://github.com/ignitionrobotics/ign-gui/pull/97) + * [Pull request 97](https://github.com/gazebosim/gz-gui/pull/97) 1. Minimize GUI plugin - * [Pull request 84](https://github.com/ignitionrobotics/ign-gui/pull/84) - * [Pull request 99](https://github.com/ignitionrobotics/ign-gui/pull/99) + * [Pull request 84](https://github.com/gazebosim/gz-gui/pull/84) + * [Pull request 99](https://github.com/gazebosim/gz-gui/pull/99) 1. Fix tests on actions - * [Pull request 98](https://github.com/ignitionrobotics/ign-gui/pull/98) + * [Pull request 98](https://github.com/gazebosim/gz-gui/pull/98) 1. Disable failing tests - * [Pull request 76](https://github.com/ignitionrobotics/ign-gui/pull/76) + * [Pull request 76](https://github.com/gazebosim/gz-gui/pull/76) 1. Use world name in default topics - * [Pull request 104](https://github.com/ignitionrobotics/ign-gui/pull/104) + * [Pull request 104](https://github.com/gazebosim/gz-gui/pull/104) -### Ignition Gui 2.2.0 (2020-06-17) +### Gazebo Gui 2.2.0 (2020-06-17) 1. Sort GUI plugins alphabetically - * [Pull request 71](https://github.com/ignitionrobotics/ign-gui/pull/71) + * [Pull request 71](https://github.com/gazebosim/gz-gui/pull/71) 1. Add color palette to plugin settings to change background color - * [Pull request 62](https://github.com/ignitionrobotics/ign-gui/pull/62) + * [Pull request 62](https://github.com/gazebosim/gz-gui/pull/62) 1. Close plugin menu after a plugin has been added - * [Pull request 60](https://github.com/ignitionrobotics/ign-gui/pull/60) + * [Pull request 60](https://github.com/gazebosim/gz-gui/pull/60) 1. Resize undocked plugins by dragging corners - * [Pull request 78](https://github.com/ignitionrobotics/ign-gui/pull/78) + * [Pull request 78](https://github.com/gazebosim/gz-gui/pull/78) 1. Move each plugin to its own directory - * [Pull request 64](https://github.com/ignitionrobotics/ign-gui/pull/64) + * [Pull request 64](https://github.com/gazebosim/gz-gui/pull/64) 1. GitHub migration - * [Pull request 46](https://github.com/ignitionrobotics/ign-gui/pull/46) - * [Pull request 56](https://github.com/ignitionrobotics/ign-gui/pull/56) + * [Pull request 46](https://github.com/gazebosim/gz-gui/pull/46) + * [Pull request 56](https://github.com/gazebosim/gz-gui/pull/56) 1. Fix homebrew warnings * [BitBucket pull request 249](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/249) -### Ignition Gui 2.1.0 (2020-03-04) +### Gazebo Gui 2.1.0 (2020-03-04) 1. Add space for pausing sim * [BitBucket pull request 245](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/245) @@ -476,7 +476,7 @@ 1. Fix changing topics in ImageDisplay * [BitBucket pull request 224](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/224) -### Ignition Gui 2.0.1 +### Gazebo Gui 2.0.1 1. Made image display responsive. * [BitBucket pull request 223](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/223) @@ -484,7 +484,7 @@ 1. Downstream applications can override this using MainWindow::setIcon once they get the window. * [BitBucket pull request 222](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/222) -### Ignition Gui 2.0.0 +### Gazebo Gui 2.0.0 1. Delete QmlApplicationEngine later. * [BitBucket pull request 209](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/209) @@ -513,9 +513,9 @@ 1. Fix topic echo test and make msgs visible. * [BitBucket pull request 201](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/201) -## Ignition Gui 1 +## Gazebo Gui 1 -### Ignition Gui 1.X.X +### Gazebo Gui 1.X.X 1. Move files not ported to v1 to a separate dir for clarity. * [BitBucket pull request 196](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/196) @@ -523,4 +523,4 @@ 1. Get ign-gui plugin interface in case there are others. * [BitBucket pull request 186](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-gui/pull-requests/186) -### Ignition Gui 1.0.0 +### Gazebo Gui 1.0.0 diff --git a/Migration.md b/Migration.md index 4cfaf0201..754d83e64 100644 --- a/Migration.md +++ b/Migration.md @@ -5,26 +5,26 @@ Deprecated code produces compile-time warnings. These warning serve as notification to users that their code should be upgraded. The next major release will remove the deprecated code. -## Ignition GUI 3.10 to 3.11 +## Gazebo GUI 3.10 to 3.11 * `Dialog::ReadConfigAttribute` doesn't create a missing file anymore. -## Ignition GUI 3.6 to 3.7 +## Gazebo GUI 3.6 to 3.7 * The `Application::PluginAdded` signal used to send empty strings. Now it sends the plugin's unique name. -## Ignition GUI 2.x to 3.x +## Gazebo GUI 2.x to 3.x * Use rendering3, transport8 and msgs5. -## Ignition GUI 1.x to 2.x +## Gazebo GUI 1.x to 2.x * Plugin headers are no longer installed. * Use ignition msgs4, rendering2, and transport7. -## Ignition GUI 0.1.0 to 1.0.0 +## Gazebo GUI 0.1.0 to 1.0.0 -* Ignition GUI v1 uses QtQuick and it is not compatible with v0, which uses QWidgets. +* Gazebo GUI v1 uses QtQuick and it is not compatible with v0, which uses QWidgets. diff --git a/NEWS b/NEWS index 604eba665..a73d9b7c1 100644 --- a/NEWS +++ b/NEWS @@ -1 +1 @@ -http://ignitionrobotics.org +http://gazebosim.org diff --git a/api.md.in b/api.md.in index 31af86575..bb345ae15 100644 --- a/api.md.in +++ b/api.md.in @@ -1,6 +1,6 @@ -## Ignition @GZ_DESIGNATION_CAP@ +## Gazebo @GZ_DESIGNATION_CAP@ -Ignition @GZ_DESIGNATION_CAP@ is a component in Ignition Robotics, a set of libraries +Gazebo @GZ_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries designed to rapidly develop robot and simulation applications. ## License diff --git a/examples/README.md b/examples/README.md index 66d367799..3745b01b1 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,4 +1,4 @@ -This directory contains examples which are not shipped with Ignition GUI +This directory contains examples which are not shipped with Gazebo GUI # Standalone @@ -7,11 +7,11 @@ Ignition-GUI as a library # Plugin -Examples of how to build plugins which can then be used with Ignition GUI's +Examples of how to build plugins which can then be used with Gazebo GUI's command line tool, or used by standalone applications. # Config -Example configuration files which can be used with Ignition GUI's command +Example configuration files which can be used with Gazebo GUI's command line tool or with standalone applications diff --git a/examples/config/plugin_params.config b/examples/config/plugin_params.config index 8f6e60850..46fb98998 100644 --- a/examples/config/plugin_params.config +++ b/examples/config/plugin_params.config @@ -6,7 +6,7 @@ diff --git a/examples/plugin/custom_context_menu/CMakeLists.txt b/examples/plugin/custom_context_menu/CMakeLists.txt index d0d5a6afe..a11491d3a 100644 --- a/examples/plugin/custom_context_menu/CMakeLists.txt +++ b/examples/plugin/custom_context_menu/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) find_package(ignition-common3 REQUIRED) diff --git a/examples/plugin/custom_context_menu/CustomContext.cc b/examples/plugin/custom_context_menu/CustomContext.cc index 78419be8d..564ea5efd 100644 --- a/examples/plugin/custom_context_menu/CustomContext.cc +++ b/examples/plugin/custom_context_menu/CustomContext.cc @@ -16,11 +16,11 @@ */ #include -#include +#include #include "CustomContext.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/examples/plugin/custom_context_menu/CustomContext.hh b/examples/plugin/custom_context_menu/CustomContext.hh index 88ff67541..fa229eb57 100644 --- a/examples/plugin/custom_context_menu/CustomContext.hh +++ b/examples/plugin/custom_context_menu/CustomContext.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_CUSTOMCONTEXTPLUGIN_HH_ -#define IGNITION_GUI_CUSTOMCONTEXTPLUGIN_HH_ +#ifndef GZ_GUI_CUSTOMCONTEXTPLUGIN_HH_ +#define GZ_GUI_CUSTOMCONTEXTPLUGIN_HH_ #ifndef Q_MOC_RUN - #include - #include + #include + #include #endif namespace ignition diff --git a/examples/plugin/dialog_from_plugin/CMakeLists.txt b/examples/plugin/dialog_from_plugin/CMakeLists.txt index 067aeaf15..a4235b12b 100644 --- a/examples/plugin/dialog_from_plugin/CMakeLists.txt +++ b/examples/plugin/dialog_from_plugin/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) find_package(ignition-common3 REQUIRED) diff --git a/examples/plugin/dialog_from_plugin/DialogFromPlugin.cc b/examples/plugin/dialog_from_plugin/DialogFromPlugin.cc index 20f260ed1..e94266063 100644 --- a/examples/plugin/dialog_from_plugin/DialogFromPlugin.cc +++ b/examples/plugin/dialog_from_plugin/DialogFromPlugin.cc @@ -16,11 +16,11 @@ */ #include -#include +#include #include "DialogFromPlugin.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/examples/plugin/dialog_from_plugin/DialogFromPlugin.hh b/examples/plugin/dialog_from_plugin/DialogFromPlugin.hh index 35d048094..60d98120d 100644 --- a/examples/plugin/dialog_from_plugin/DialogFromPlugin.hh +++ b/examples/plugin/dialog_from_plugin/DialogFromPlugin.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_DIALOGFROMPLUGIN_HH_ -#define IGNITION_GUI_DIALOGFROMPLUGIN_HH_ +#ifndef GZ_GUI_DIALOGFROMPLUGIN_HH_ +#define GZ_GUI_DIALOGFROMPLUGIN_HH_ #ifndef Q_MOC_RUN - #include - #include + #include + #include #endif namespace ignition diff --git a/examples/plugin/hello_plugin/CMakeLists.txt b/examples/plugin/hello_plugin/CMakeLists.txt index db3cf7bc0..52fa65973 100644 --- a/examples/plugin/hello_plugin/CMakeLists.txt +++ b/examples/plugin/hello_plugin/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) find_package(ignition-common3 REQUIRED) diff --git a/examples/plugin/hello_plugin/HelloPlugin.cc b/examples/plugin/hello_plugin/HelloPlugin.cc index bdd7e21b8..b5c5ef93e 100644 --- a/examples/plugin/hello_plugin/HelloPlugin.cc +++ b/examples/plugin/hello_plugin/HelloPlugin.cc @@ -16,11 +16,11 @@ */ #include -#include +#include #include "HelloPlugin.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/examples/plugin/hello_plugin/HelloPlugin.hh b/examples/plugin/hello_plugin/HelloPlugin.hh index 588ec4fa5..5b4f105cb 100644 --- a/examples/plugin/hello_plugin/HelloPlugin.hh +++ b/examples/plugin/hello_plugin/HelloPlugin.hh @@ -15,13 +15,13 @@ * */ -#ifndef IGNITION_GUI_HELLOPLUGIN_HH_ -#define IGNITION_GUI_HELLOPLUGIN_HH_ +#ifndef GZ_GUI_HELLOPLUGIN_HH_ +#define GZ_GUI_HELLOPLUGIN_HH_ #include -#include -#include +#include +#include namespace ignition { @@ -37,7 +37,7 @@ namespace ignition /// \brief Destructor public: virtual ~HelloPlugin(); - /// \brief Called by Ignition GUI when plugin is instantiated. + /// \brief Called by Gazebo GUI when plugin is instantiated. /// \param[in] _pluginElem XML configuration for this plugin. public: virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override; diff --git a/examples/plugin/ign_components/IgnComponents.cc b/examples/plugin/ign_components/IgnComponents.cc index ea2a010ae..2de4e42e7 100644 --- a/examples/plugin/ign_components/IgnComponents.cc +++ b/examples/plugin/ign_components/IgnComponents.cc @@ -15,9 +15,9 @@ * */ -#include +#include #include "IgnComponents.hh" // Register this plugin -IGNITION_ADD_PLUGIN(ignition::gui::IgnComponents, - ignition::gui::Plugin); +IGNITION_ADD_PLUGIN(gz::gui::IgnComponents, + gz::gui::Plugin); diff --git a/examples/plugin/ign_components/IgnComponents.hh b/examples/plugin/ign_components/IgnComponents.hh index 9130a936e..b48a49fe4 100644 --- a/examples/plugin/ign_components/IgnComponents.hh +++ b/examples/plugin/ign_components/IgnComponents.hh @@ -15,10 +15,10 @@ * */ -#ifndef IGNITION_GUI_EXAMPLES_PLUGIN_IGNCOMPONENTS_HH_ -#define IGNITION_GUI_EXAMPLES_PLUGIN_IGNCOMPONENTS_HH_ +#ifndef GZ_GUI_EXAMPLES_PLUGIN_IGNCOMPONENTS_HH_ +#define GZ_GUI_EXAMPLES_PLUGIN_IGNCOMPONENTS_HH_ -#include +#include namespace ignition { diff --git a/examples/plugin/ign_components/README.md b/examples/plugin/ign_components/README.md index bee793933..66c9cd6d5 100644 --- a/examples/plugin/ign_components/README.md +++ b/examples/plugin/ign_components/README.md @@ -1,4 +1,4 @@ -Demo of QML components provided by Ignition GUI which can be +Demo of QML components provided by Gazebo GUI which can be useful for downstream developers. ## Build diff --git a/examples/plugin/multiple_qml/CMakeLists.txt b/examples/plugin/multiple_qml/CMakeLists.txt index 1860e5bd9..026fd5884 100644 --- a/examples/plugin/multiple_qml/CMakeLists.txt +++ b/examples/plugin/multiple_qml/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) find_package(ignition-common3 REQUIRED) diff --git a/examples/plugin/multiple_qml/MultipleQml.cc b/examples/plugin/multiple_qml/MultipleQml.cc index 6651f9773..460b6d7c1 100644 --- a/examples/plugin/multiple_qml/MultipleQml.cc +++ b/examples/plugin/multiple_qml/MultipleQml.cc @@ -16,11 +16,11 @@ */ #include -#include +#include #include "MultipleQml.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/examples/plugin/multiple_qml/MultipleQml.hh b/examples/plugin/multiple_qml/MultipleQml.hh index dad17e517..489b53b2f 100644 --- a/examples/plugin/multiple_qml/MultipleQml.hh +++ b/examples/plugin/multiple_qml/MultipleQml.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_EXAMPLES_PLUGINS_MULTIPLEQML_HH_ -#define IGNITION_GUI_EXAMPLES_PLUGINS_MULTIPLEQML_HH_ +#ifndef GZ_GUI_EXAMPLES_PLUGINS_MULTIPLEQML_HH_ +#define GZ_GUI_EXAMPLES_PLUGINS_MULTIPLEQML_HH_ #ifndef Q_MOC_RUN - #include - #include + #include + #include #endif namespace ignition diff --git a/examples/standalone/custom_drawer/CMakeLists.txt b/examples/standalone/custom_drawer/CMakeLists.txt index b341e6a81..724e1aa46 100644 --- a/examples/standalone/custom_drawer/CMakeLists.txt +++ b/examples/standalone/custom_drawer/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) QT5_ADD_RESOURCES(resources_RCC custom_drawer.qrc) diff --git a/examples/standalone/custom_drawer/CustomDrawer.qml b/examples/standalone/custom_drawer/CustomDrawer.qml index 6ac642687..dcbf089a5 100644 --- a/examples/standalone/custom_drawer/CustomDrawer.qml +++ b/examples/standalone/custom_drawer/CustomDrawer.qml @@ -50,7 +50,7 @@ Rectangle { actionElement: "cppActionFromQml" } - // Actions provided by Ignition GUI, with custom titles + // Actions provided by Gazebo GUI, with custom titles ListElement { title: "Call default action (Style)" actionElement: "styleSettings" diff --git a/examples/standalone/custom_drawer/custom_drawer.cc b/examples/standalone/custom_drawer/custom_drawer.cc index 0ac1f02fb..057b5d2b2 100644 --- a/examples/standalone/custom_drawer/custom_drawer.cc +++ b/examples/standalone/custom_drawer/custom_drawer.cc @@ -15,12 +15,12 @@ * */ -#include +#include #ifndef Q_MOC_RUN - #include - #include - #include + #include + #include + #include #include "custom_drawer.hh" #endif @@ -28,16 +28,16 @@ int main(int _argc, char **_argv) { // Increase verboosity so we see all messages - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); // Initialize app - ignition::gui::Application app(_argc, _argv); + gz::gui::Application app(_argc, _argv); // Hide original panel app.LoadConfig("../custom_drawer.config"); // Let QML files use CustomActions' functions and properties - ignition::gui::CustomActions actions; + gz::gui::CustomActions actions; auto context = new QQmlContext(app.Engine()->rootContext()); context->setContextProperty("CustomActions", &actions); @@ -54,7 +54,7 @@ int main(int _argc, char **_argv) QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership); // Add to main window - auto win = app.findChild()->QuickWindow(); + auto win = app.findChild()->QuickWindow(); auto drawerItem = win->findChild("sideDrawer"); item->setParentItem(drawerItem); diff --git a/examples/standalone/custom_drawer/custom_drawer.hh b/examples/standalone/custom_drawer/custom_drawer.hh index 5f4d678a7..64a7edd25 100644 --- a/examples/standalone/custom_drawer/custom_drawer.hh +++ b/examples/standalone/custom_drawer/custom_drawer.hh @@ -15,13 +15,13 @@ * */ -#ifndef IGNITION_GUI_EXAMPLES_STANDALONE_CUSTOMDRAWER_HH_ -#define IGNITION_GUI_EXAMPLES_STANDALONE_CUSTOMDRAWER_HH_ +#ifndef GZ_GUI_EXAMPLES_STANDALONE_CUSTOMDRAWER_HH_ +#define GZ_GUI_EXAMPLES_STANDALONE_CUSTOMDRAWER_HH_ #include #ifndef Q_MOC_RUN - #include + #include #endif namespace ignition diff --git a/examples/standalone/dialogs/CMakeLists.txt b/examples/standalone/dialogs/CMakeLists.txt index 3e0ffae75..6bf03a0a7 100644 --- a/examples/standalone/dialogs/CMakeLists.txt +++ b/examples/standalone/dialogs/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNITION-GUI_CXX_FLAGS}") diff --git a/examples/standalone/dialogs/dialogs.cc b/examples/standalone/dialogs/dialogs.cc index 1d7c665c3..fbe091d76 100644 --- a/examples/standalone/dialogs/dialogs.cc +++ b/examples/standalone/dialogs/dialogs.cc @@ -17,12 +17,12 @@ #include -#include +#include #ifndef Q_MOC_RUN - #include - #include - #include + #include + #include + #include #endif ////////////////////////////////////////////////// @@ -31,11 +31,11 @@ int main(int _argc, char **_argv) std::cout << "Hello, GUI!" << std::endl; // Increase verboosity so we see all messages - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); // Initialize app - ignition::gui::Application app(_argc, _argv, - ignition::gui::WindowType::kDialog); + gz::gui::Application app(_argc, _argv, + gz::gui::WindowType::kDialog); // Load plugins / config app.LoadPlugin("Publisher"); diff --git a/examples/standalone/start_dialog/start_dialog.cc b/examples/standalone/start_dialog/start_dialog.cc index 3ef1b7d43..625eb885d 100644 --- a/examples/standalone/start_dialog/start_dialog.cc +++ b/examples/standalone/start_dialog/start_dialog.cc @@ -17,24 +17,24 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include ////////////////////////////////////////////////// int main(int _argc, char **_argv) { // Increase verboosity so we see all messages - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); // Create app - ignition::gui::Application app(_argc, _argv, ignition::gui::WindowType::kDialog); + gz::gui::Application app(_argc, _argv, gz::gui::WindowType::kDialog); igndbg << "Open dialog" << std::endl; // Add and display a dialog - auto dialog = new ignition::gui::Dialog(); + auto dialog = new gz::gui::Dialog(); dialog->QuickWindow(); std::string qmlFile(":start_dialog/start_dialog.qml"); @@ -45,7 +45,7 @@ int main(int _argc, char **_argv) return -1; } - QQmlComponent dialogComponent(ignition::gui::App()->Engine(), + QQmlComponent dialogComponent(gz::gui::App()->Engine(), QString(QString::fromStdString(qmlFile))); if (dialogComponent.isError()) { diff --git a/examples/standalone/window/CMakeLists.txt b/examples/standalone/window/CMakeLists.txt index 35da108e8..18cf6a883 100644 --- a/examples/standalone/window/CMakeLists.txt +++ b/examples/standalone/window/CMakeLists.txt @@ -17,7 +17,7 @@ find_package (Qt5 REQUIRED ) -# Find the Ignition gui library +# Find the Gazebo gui library find_package(ignition-gui3 REQUIRED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNITION-GUI_CXX_FLAGS}") diff --git a/examples/standalone/window/window.cc b/examples/standalone/window/window.cc index 8986216a1..031dcbcbb 100644 --- a/examples/standalone/window/window.cc +++ b/examples/standalone/window/window.cc @@ -18,9 +18,9 @@ #include #ifndef Q_MOC_RUN - #include - #include - #include + #include + #include + #include #endif ////////////////////////////////////////////////// @@ -29,10 +29,10 @@ int main(int _argc, char **_argv) std::cout << "Hello, GUI!" << std::endl; // Increase verboosity so we see all messages - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); // Create app - ignition::gui::Application app(_argc, _argv); + gz::gui::Application app(_argc, _argv); // Load plugins / config if (!app.LoadPlugin("Publisher")) @@ -41,7 +41,7 @@ int main(int _argc, char **_argv) } // Customize main window - auto win = app.findChild()->QuickWindow(); + auto win = app.findChild()->QuickWindow(); win->setProperty("title", "Hello Window!"); // Run window diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 25ec89762..4b2bdd7bb 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1 +1,2 @@ -add_subdirectory(ignition) +add_subdirectory(gz) +install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL}) diff --git a/include/ignition/CMakeLists.txt b/include/gz/CMakeLists.txt similarity index 100% rename from include/ignition/CMakeLists.txt rename to include/gz/CMakeLists.txt diff --git a/include/gz/gui/Application.hh b/include/gz/gui/Application.hh new file mode 100644 index 000000000..161dfec0b --- /dev/null +++ b/include/gz/gui/Application.hh @@ -0,0 +1,226 @@ +/* + * Copyright (C) 2018 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef GZ_GUI_APPLICATION_HH_ +#define GZ_GUI_APPLICATION_HH_ + +#include +#include +#include +#include + +#include "gz/gui/qt.h" +#include "gz/gui/Export.hh" + +#ifdef _WIN32 +// Disable warning C4251 which is triggered by +// std::unique_ptr +#pragma warning(push) +#pragma warning(disable: 4251) +#endif + +namespace tinyxml2 +{ + class XMLElement; +} + +namespace ignition +{ + namespace gui + { + class ApplicationPrivate; + class Dialog; + class MainWindow; + class Plugin; + + /// \brief Type of window which the application will display + enum class WindowType : int + { + /// \brief A main window, which may contain top-level menus and multiple + /// plugins + kMainWindow = 0, + + /// \brief One independent dialog per plugin. Also useful to open a + /// startup dialog before the main window. + kDialog = 1 + }; + + /// \brief An Gazebo GUI application loads a QML engine and + /// provides an API to load plugins and configuration files. The application + /// supports either running a single main window or several plugins as + /// standalone dialogs. + class IGNITION_GUI_VISIBLE Application : public QGuiApplication + { + Q_OBJECT + + /// \brief Constructor. + /// \param[in] _argc Argument count. + /// \param[in] _argv Argument values. + /// \param[in] _type Window type, by default it's a main window. + public: Application(int &_argc, char **_argv, + const WindowType _type = WindowType::kMainWindow); + + /// \brief Destructor + public: virtual ~Application(); + + /// \brief Get the QML engine + /// \return Pointer to QML engine + public: QQmlApplicationEngine *Engine() const; + + /// \brief Load a plugin from a file name. The plugin file must be in the + /// path. + /// If a window has been initialized, the plugin is added to the window. + /// Otherwise, the plugin is stored and can be later added to a window or + /// dialog. + /// \param[in] _filename Plugin filename. + /// \param[in] _pluginElem Element containing plugin configuration + /// \return True if successful + /// \sa LoadConfig + /// \sa AddPluginsToWindow + public: bool LoadPlugin(const std::string &_filename, + const tinyxml2::XMLElement *_pluginElem = nullptr); + + /// \brief Load a configuration file, which includes window configurations + /// and plugins. This function doesn't instantiate the plugins, it just + /// keeps them in memory and they can be applied later by either + /// instantiating a window or several dialogs. + /// and plugins. + /// \param[in] _path Full path to configuration file. + /// \return True if successful + /// \sa InitializeMainWindow + /// \sa InitializeDialogs + public: bool LoadConfig(const std::string &_path); + + /// \brief Load the configuration from the default config file. + /// \return True if successful + /// \sa SetDefaultConfigPath + /// \sa DefaultConfigPath + /// \sa LoadConfig + public: bool LoadDefaultConfig(); + + /// \brief Specifies the location of the default configuration file. + /// This is the file that stores the user settings when pressing + /// "Save configuration". + /// \param[in] _path The default configuration full path including + /// filename. + /// \sa LoadDefaultConfig + /// \sa defaultConfigPath + public: void SetDefaultConfigPath(const std::string &_path); + + /// \brief Get the location of the default configuration file. + /// \return The default configuration path. + /// \sa LoadDefaultConfig + /// \sa SetDefaultConfigPath + public: std::string DefaultConfigPath(); + + /// \brief Set the environment variable which defines the paths to + /// look for plugins. + /// \param[in] _env Name of environment variable. + public: void SetPluginPathEnv(const std::string &_env); + + /// \brief Add an path to look for plugins. + /// \param[in] _path Full path. + public: void AddPluginPath(const std::string &_path); + + /// \brief Get the list of available plugins, organized by path. The + /// paths are given in the following order: + /// + /// 1. Paths given by the environment variable + /// 2. Paths added by calling addPluginPath + /// 3. Path ~/.ignition/gui/plugins + /// 4. The path where Gazebo GUI plugins are installed + /// + /// \return A vector of pairs, where each pair contains: + /// * A path + /// * A vector of plugins in that path + public: std::vector>> + PluginList(); + + /// \brief Remove plugin by name. The plugin is removed from the + /// application and its shared library unloaded if this was its last + /// instance. + /// \param[in] _pluginName Plugn instance's unique name. This is the + /// plugin card's object name. + /// \return True if successful + public: bool RemovePlugin(const std::string &_pluginName); + + + /// \brief Get a plugin by its unique name. + /// \param[in] _pluginName Plugn instance's unique name. This is the + /// plugin card's object name. + /// \return Pointer to plugin object, null if not found. + public: std::shared_ptr PluginByName( + const std::string &_pluginName) const; + + /// \brief Notify that a plugin has been added. + /// \param[in] _objectName Plugin's object name. + signals: void PluginAdded(const QString &_objectName); + + /// \brief Callback when user requests to close a plugin + public slots: void OnPluginClose(); + + /// \brief Create a main window. Just calls InitializeMainWindow. + /// \return True if successful + /// \sa InitializeMainWindow + public: bool CreateMainWindow(); + + /// \brief Create a main window, populate with previously loaded plugins + /// and apply previously loaded configuration. + /// An empty window will be created if no plugins have been loaded. + /// \return True if successful + /// \sa LoadConfig + /// \sa LoadPlugin + private: bool InitializeMainWindow(); + + /// \brief Create individual dialogs for all previously loaded plugins. + /// This has no effect if no plugins have been loaded. + /// \return True if successful + /// \sa LoadConfig + /// \sa LoadPlugin + private: bool InitializeDialogs(); + + /// \brief Remove plugin by pointer. + /// \param[in] _plugin Shared pointer to plugin + private: void RemovePlugin(std::shared_ptr _plugin); + + /// \brief Add previously loaded plugins to the main window. + /// \return True if successful. Will fail if the window hasn't been + /// created yet. + /// \sa LoadPlugin + private: bool AddPluginsToWindow(); + + /// \brief Apply previously loaded config to the main window. + /// \return True if successful, will fail if there's no main window + /// initialized. + private: bool ApplyConfig(); + + /// \internal + /// \brief Private data pointer + private: std::unique_ptr dataPtr; + }; + + /// \brief Get current running application, this is a cast of qGuiApp. + /// \return Pointer to running application, or nullptr if none is running. + IGNITION_GUI_VISIBLE + Application *App(); + } +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif diff --git a/include/ignition/gui/CMakeLists.txt b/include/gz/gui/CMakeLists.txt similarity index 99% rename from include/ignition/gui/CMakeLists.txt rename to include/gz/gui/CMakeLists.txt index aae3170bb..3c6871a60 100644 --- a/include/ignition/gui/CMakeLists.txt +++ b/include/gz/gui/CMakeLists.txt @@ -31,7 +31,7 @@ set (headers DragDropModel.hh Enums.hh Helpers.hh - ign.hh + gz.hh qt.h SearchModel.hh System.hh @@ -64,4 +64,3 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} ) ign_install_all_headers() - diff --git a/include/gz/gui/Conversions.hh b/include/gz/gui/Conversions.hh new file mode 100644 index 000000000..a592aaff2 --- /dev/null +++ b/include/gz/gui/Conversions.hh @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#ifndef GZ_GUI_CONVERSIONS_HH_ +#define GZ_GUI_CONVERSIONS_HH_ + +#ifdef _MSC_VER +#pragma warning(push, 0) +#endif +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#include +#include +#include +#include + +#include "gz/gui/qt.h" +#include "gz/gui/Export.hh" + +namespace ignition +{ + namespace common + { + class MouseEvent; + } + + namespace gui + { + /// \brief Return the equivalent qt color + /// \param[in] _color Gazebo color to convert + /// \return Qt color value + IGNITION_GUI_VISIBLE + QColor convert(const math::Color &_color); + + /// \brief Return the equivalent gazebo color + /// \param[in] _color Qt color to convert + /// \return Gazebo color value + IGNITION_GUI_VISIBLE + math::Color convert(const QColor &_color); + + /// \brief Return the equivalent QPointF. + /// \param[in] _pt Gazebo vector to convert. + /// \return QPointF. + IGNITION_GUI_VISIBLE + QPointF convert(const math::Vector2d &_pt); + + /// \brief Return the equivalent gazebo vector. + /// \param[in] _pt QPointF to convert + /// \return Gazebo Vector2d. + IGNITION_GUI_VISIBLE + math::Vector2d convert(const QPointF &_pt); + + /// \brief Return the equivalent qt vector 3d. + /// \param[in] _vec Gazebo vector 3d to convert. + /// \return Qt vector 3d value. + IGNITION_GUI_VISIBLE + QVector3D convert(const math::Vector3d &_vec); + + /// \brief Return the equivalent gazebo vector 3d. + /// \param[in] _vec Qt vector 3d to convert. + /// \return Gazebo vector 3d value + IGNITION_GUI_VISIBLE + math::Vector3d convert(const QVector3D &_vec); + + /// \brief Return the equivalent gazebo mouse event. + /// + /// Note that there isn't a 1-1 mapping between these types, so fields such + /// as common::MouseEvent::PressPos need to be set afterwards. + /// \param[in] _e Qt mouse event + /// \return Gazebo mouse event + IGNITION_GUI_VISIBLE + common::MouseEvent convert(const QMouseEvent &_e); + + /// \brief Convert an gz::msgs::Time to an gz::common::Time + /// \param[in] _t The time to convert + /// \return An gz::common::Time object + IGNITION_GUI_VISIBLE + common::Time convert(const msgs::Time &_t); + + /// \brief Convert an gz::common::Time to an gz::msgs::Time + /// \param[in] _t The time to convert + /// \return An gz::msgs::Time object + IGNITION_GUI_VISIBLE + msgs::Time convert(const common::Time &_t); + } +} +#endif diff --git a/include/gz/gui/Dialog.hh b/include/gz/gui/Dialog.hh new file mode 100644 index 000000000..2b3e2b9ae --- /dev/null +++ b/include/gz/gui/Dialog.hh @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GZ_GUI_DIALOG_HH_ +#define GZ_GUI_DIALOG_HH_ + +#include +#include + +#include "gz/gui/qt.h" +#include "gz/gui/Export.hh" + +#ifdef _WIN32 +// Disable warning C4251 which is triggered by +// std::unique_ptr +#pragma warning(push) +#pragma warning(disable: 4251) +#endif + +namespace ignition +{ + namespace gui + { + class DialogPrivate; + + /// \brief Gui plugin + class IGNITION_GUI_VISIBLE Dialog : public QObject + { + Q_OBJECT + + /// \brief Constructor + public: Dialog(); + + /// \brief Destructor + public: virtual ~Dialog(); + + /// \brief Get the QtQuick window created by this object + /// \return Pointer to the QtQuick window + public: QQuickWindow *QuickWindow() const; + + /// \brief Get the root quick item of this window + /// \return Pointer to the item + public: QQuickItem *RootItem() const; + + /// \brief Store dialog default config + /// \param[in] _config XML config as string + /// \deprecated Introduce deprecation warnings on v7. + public: void SetDefaultConfig(const std::string &_config); + + /// \brief Update an attribute on an XML file. The attribute belongs to + /// a `` element that has a `name` attrbute matching this dialog's + /// name, i.e. + /// + /// `` + /// + /// If a dialog element with this dialog's name doesn't exist yet, one + /// will be created. + /// + /// \param[in] _path File path. File must already exist, this function + /// will not create a new file. + /// \param[in] _attribute XMLElement attribute name + /// \param[in] _value XMLElement attribute value + /// \return True if written to config file + public: bool UpdateConfigAttribute( + const std::string &_path, const std::string &_attribute, + const bool _value) const; + + /// \brief Gets an attribute value from an XML file. The attribute belongs + /// to a `` element that has a `name` attribute matching this + /// dialog's name. + /// It will return an empty string if the file or the attribute + /// don't exist. + /// \param[in] _path File path + /// \param[in] _attribute attribute name + /// \return Attribute value as string + public: std::string ReadConfigAttribute(const std::string &_path, + const std::string &_attribute) const; + + /// \internal + /// \brief Private data pointer + private: std::unique_ptr dataPtr; + }; + } +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif diff --git a/include/gz/gui/DragDropModel.hh b/include/gz/gui/DragDropModel.hh new file mode 100644 index 000000000..cffe3be44 --- /dev/null +++ b/include/gz/gui/DragDropModel.hh @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef GZ_GUI_DRAGDROPMODEL_HH_ +#define GZ_GUI_DRAGDROPMODEL_HH_ + +#include "gz/gui/Export.hh" +#include "gz/gui/qt.h" + +namespace ignition +{ +namespace gui +{ + /// \brief Customized item model so that we can pass along an URI query as + /// MIME information during a drag-drop. + class IGNITION_GUI_VISIBLE DragDropModel : public QStandardItemModel + { + /// \brief Overloaded from Qt. Custom MIME data function. + /// \param[in] _indexes List of selected items. + /// \return Mime data for the selected items. + public: QMimeData *mimeData(const QModelIndexList &_indexes) const; + }; +} +} +#endif diff --git a/include/gz/gui/Enums.hh b/include/gz/gui/Enums.hh new file mode 100644 index 000000000..9fc2ab9ab --- /dev/null +++ b/include/gz/gui/Enums.hh @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#ifndef GZ_GUI_ENUMS_HH_ +#define GZ_GUI_ENUMS_HH_ + +#include "gz/gui/qt.h" + +namespace ignition +{ +namespace gui +{ + /// \brief Data roles + enum DataRole + { + /// \brief Text which is displayed for the user. + DISPLAY_NAME = Qt::UserRole + 100, + + /// \brief URI including detailed query. This is the information carried + /// during a drag-drop operation. + URI_QUERY, + + /// \brief Data type name, such as "Double" or "Bool", or "model", "link". + /// Used to specialize display according to type. + TYPE, + + /// \brief Flag indicating whether an item should be expanded or not. + TO_EXPAND + }; + + /// \brief String types + enum class StringType + { + /// \brief Undefined type + NONE, + + /// \brief Use line for short strings which usually fit in a single + /// line. + LINE, + + /// \brief Use text for longer strings which span multiple lines. + PLAIN_TEXT + }; + + /// \brief Number types + enum class NumberType + { + /// \brief Undefined type + NONE, + + /// \brief Double + DOUBLE, + + /// \brief Integer + INT, + + /// \brief Unsigned integer + UINT + }; + + /// \brief File types + enum FileType + { + /// \brief Comma separated value (CSV) + CSVFile, + + /// \brief Portable document format (PDF) + PDFFile + }; +} +} +#endif diff --git a/include/gz/gui/GuiEvents.hh b/include/gz/gui/GuiEvents.hh new file mode 100644 index 000000000..f5f04540d --- /dev/null +++ b/include/gz/gui/GuiEvents.hh @@ -0,0 +1,262 @@ +/* + * Copyright (C) 2020 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef GZ_GUI_GUIEVENTS_HH_ +#define GZ_GUI_GUIEVENTS_HH_ + +#include +#include +#include +#include +#include + +namespace ignition +{ + namespace gui + { + /// \brief Namespace for all events. + namespace events + { + /// User defined events should start from QEvent::MaxUser and + /// count down to avoid collision with ign-gazebo events + + /// \brief Event called in the render thread of a 3D scene. + /// It's safe to make rendering calls in this event's callback. + class Render : public QEvent + { + public: Render() + : QEvent(kType) + { + } + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser); + }; + + /// \brief The class for sending and receiving custom snap value events. + /// This event is used in the Transform Control plugin tool when the + /// user manually alters their snapping values. + class SnapIntervals : public QEvent + { + /// \brief Constructor + /// \param[in] _xyz XYZ snapping values. + /// \param[in] _rpy RPY snapping values. + /// \param[in] _scale Scale snapping values. + public: SnapIntervals( + const math::Vector3d &_xyz, + const math::Vector3d &_rpy, + const math::Vector3d &_scale) + : QEvent(kType), xyz(_xyz), rpy(_rpy), scale(_scale) + { + } + + /// \brief Get the XYZ snapping values. + /// \return The XYZ snapping values. + public: math::Vector3d Position() const + { + return this->xyz; + } + + /// \brief Get the RPY snapping values. + /// \return The RPY snapping values. + public: math::Vector3d Rotation() const + { + return this->rpy; + } + + /// \brief Get the scale snapping values. + /// \return The scale snapping values. + public: math::Vector3d Scale() const + { + return this->scale; + } + + /// \brief The QEvent representing a snap event occurrence. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 1); + + /// \brief XYZ snapping values in meters, these values must be positive. + private: math::Vector3d xyz; + + /// \brief RPY snapping values in degrees, these values must be + /// positive. + private: math::Vector3d rpy; + + /// \brief Scale snapping values - a multiplier of the current size, + /// these values must be positive. + private: math::Vector3d scale; + }; + + /// \brief Event called to spawn a resource, given its description as a + /// string. + class SpawnFromDescription : public QEvent + { + /// \brief Constructor + /// \param[in] _description The resource's description as a string, such + /// as an SDF file. + public: explicit SpawnFromDescription(const std::string &_description) + : QEvent(kType), description(_description) + { + } + + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 2); + + /// \brief Get the string description of the resource. + /// \return The resource string + public: const std::string &Description() const + { + return this->description; + } + + /// \brief The string of the resource to be spawned. + std::string description; + }; + + /// \brief Event called to spawn a resource, which takes the path + /// to its file. + class SpawnFromPath : public QEvent + { + /// \brief Constructor + /// \param[in] _filePath The path to a file. + public: explicit SpawnFromPath(const std::string &_filePath) + : QEvent(kType), filePath(_filePath) + { + } + + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 3); + + /// \brief Get the path of the file. + /// \return The file path. + public: const std::string &FilePath() const + { + return this->filePath; + } + + /// \brief The path of file to be previewed. + std::string filePath; + }; + + /// \brief Event which is called to broadcast the 3D coordinates of a + /// user's mouse hover within the scene. + class HoverToScene : public QEvent + { + /// \brief Constructor + /// \param[in] _point The point at which the mouse is hovering within + /// the scene + public: explicit HoverToScene(const math::Vector3d &_point) + : QEvent(kType), point(_point) + { + } + + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 4); + + /// \brief Get the point within the scene over which the user is + /// hovering. + /// \return The 3D point + public: math::Vector3d Point() const + { + return this->point; + } + + /// \brief The 3D point over which the user is hovering. + private: math::Vector3d point; + }; + + /// \brief Event which is called to broadcast the 3D coordinates of a + /// user's left click within the scene. + class LeftClickToScene : public QEvent + { + /// \brief Constructor + /// \param[in] _point The point which the user has left clicked within + /// the scene + public: explicit LeftClickToScene(const math::Vector3d &_point) + : QEvent(kType), point(_point) + { + } + + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 5); + + /// \brief Get the point within the scene that the user clicked. + /// \return The 3D point. + public: math::Vector3d Point() const + { + return this->point; + } + + /// \brief The 3D point that the user clicked within the scene. + private: math::Vector3d point; + }; + + /// \brief Event which is called to broadcast the 3D coordinates of a + /// user's right click within the scene. + class RightClickToScene : public QEvent + { + /// \brief Constructor + /// \param[in] _point The point which the user has right clicked + /// within the scene + public: explicit RightClickToScene(const math::Vector3d &_point) + : QEvent(kType), point(_point) + { + } + + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 6); + + /// \brief Get the point within the scene that the user clicked. + /// \return The 3D point. + public: math::Vector3d Point() const + { + return this->point; + } + + /// \brief The 3D point that the user clicked within the scene. + private: math::Vector3d point; + }; + + /// \brief Event which is called to enable or disable the dropdown menu. + /// This is primarily used by plugins which also use the right click + /// mouse event to cancel any actions currently in progress. + class DropdownMenuEnabled : public QEvent + { + /// \brief Constructor + /// \param[in] _menuEnabled The boolean indicating whether the dropdown + /// menu should be enabled or disabled. + public: explicit DropdownMenuEnabled(bool _menuEnabled) + : QEvent(kType), menuEnabled(_menuEnabled) + { + } + + /// \brief Unique type for this event. + static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 7); + + /// \brief Gets whether the menu is enabled or not for this event. + /// \return True if enabling the menu, false if disabling the menu + public: bool MenuEnabled() const + { + return this->menuEnabled; + } + + /// \brief The boolean indicating whether the menu is disabled or not + /// for this event. + private: bool menuEnabled; + }; + } + } +} + +#endif // GZ_GUI_GUIEVENTS_HH_ diff --git a/include/gz/gui/Helpers.hh b/include/gz/gui/Helpers.hh new file mode 100644 index 000000000..dffb43b42 --- /dev/null +++ b/include/gz/gui/Helpers.hh @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef GZ_GUI_HELPERS_HH_ +#define GZ_GUI_HELPERS_HH_ + +#include + +#include "gz/gui/Enums.hh" +#include "gz/gui/Export.hh" + +namespace ignition +{ + namespace gui + { + /// \brief Create a human readable key, capitalizing the first letter + /// and removing characters like "_". + /// \param[in] _key Non-human-readable key. + /// \return Human-readable key. + IGNITION_GUI_VISIBLE + std::string humanReadable(const std::string &_key); + + /// \brief Returns the unit for a given key. For example, the key "mass" + /// returns "kg". + /// \param[in] _key The key. + /// \param[in] _type In case the key may have more than one type, the type + /// must be given too. For example, a prismatic joint will have different + /// units from a revolute joint. + /// \return The unit. + IGNITION_GUI_VISIBLE + std::string unitFromKey(const std::string &_key, + const std::string &_type = ""); + + /// \brief Returns the range for a given key. For example, the key + /// "transparency" returns min == 0, max == 1. + /// \param[in] _key The key. + /// \param[out] _min The minimum value. + /// \param[out] _max The maximum value. + IGNITION_GUI_VISIBLE + void rangeFromKey(const std::string &_key, double &_min, double &_max); + + /// \brief Returns the string type for a given key. For example, the key + /// "innerxml" has a PLAIN_TEXT type while "name" is a LINE. + /// \param[in] _key The key. + /// \return The string type. + IGNITION_GUI_VISIBLE + StringType stringTypeFromKey(const std::string &_key); + + /// \brief Generates a path for a file which doesn't collide with existing + /// files, by appending numbers to it (i.e. (0), (1), ...) + /// \param[in] _pathAndName Full absolute path and file name up to the + /// file extension. + /// \param[in] _extension File extension, such as "pdf". + /// \return Full path, with name and extension, which doesn't collide with + /// existing files + IGNITION_GUI_VISIBLE + std::string uniqueFilePath(const std::string &_pathAndName, + const std::string &_extension); + + /// \brief The main window's "worldNames" property may be filled with a list + /// of the names of all worlds currently loaded. This information can be + /// used by plugins to choose which world to work with. + /// This helper function provides a handy access to the world names list. + /// \return List of world names, as stored in the `MainWindow`'s + /// "worldNames" property. + IGNITION_GUI_VISIBLE + QStringList worldNames(); + + + /// \brief Import path for gz-gui QML modules added to the Qt resource + /// system. This helper function returns the QRC resource path where custom + /// Gazebo QML modules can be imported from. To import a Gazebo QML + /// module, add this path to the QML engine's import path list before + /// attempting to load a QML file that imports Gazebo QML modules. + /// \return Resousrce path prefix as a string + IGNITION_GUI_VISIBLE + const QString qmlQrcImportPath(); + + /// \brief Returns the first element on a QList which matches the given + /// property. + /// \param[in] _list The list to search through. + /// \param[in] _key The property key value. + /// \param[in] _value The property value. + /// \return The first matching element. + template + T findFirstByProperty(const QList _list, const char *_key, + QVariant _value) + { + for (const auto &w : _list) + { + if (w->property(_key) == _value) + return w; + } + return nullptr; + } + } +} +#endif diff --git a/include/gz/gui/MainWindow.hh b/include/gz/gui/MainWindow.hh new file mode 100644 index 000000000..8f1de6ef7 --- /dev/null +++ b/include/gz/gui/MainWindow.hh @@ -0,0 +1,683 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef GZ_GUI_MAINWINDOW_HH_ +#define GZ_GUI_MAINWINDOW_HH_ + +#include +#include +#include +#include +#include + +#include + +#include "gz/gui/qt.h" +#include "gz/gui/Export.hh" + +#ifdef _WIN32 +// Disable warning C4251 which is triggered by +// std::unique_ptr +#pragma warning(push) +#pragma warning(disable: 4251) +#endif + +namespace ignition +{ + namespace gui + { + Q_NAMESPACE + class MainWindowPrivate; + struct WindowConfig; + + /// \brief The action executed when GUI is closed without prompt. + enum class ExitAction + { + /// \brief Close GUI and leave server running + CLOSE_GUI, + /// \brief Close GUI and shutdown server + SHUTDOWN_SERVER, + }; + /// \cond DO_NOT_DOCUMENT + Q_ENUM_NS(ExitAction) + /// \endcond + + /// \brief The main window class creates a QQuickWindow and acts as an + /// interface which provides properties and functions which can be called + /// from Main.qml + class IGNITION_GUI_VISIBLE MainWindow : public QObject + { + Q_OBJECT + + /// \brief Number of plugins currently instantiated inside the window. + Q_PROPERTY( + int pluginCount + READ PluginCount + WRITE SetPluginCount + NOTIFY PluginCountChanged + ) + + /// \brief Material theme (Light / Dark) + Q_PROPERTY( + QString materialTheme + READ MaterialTheme + WRITE SetMaterialTheme + NOTIFY MaterialThemeChanged + ) + + /// \brief Material primary color (Pre-defined color name or hex value) + Q_PROPERTY( + QString materialPrimary + READ MaterialPrimary + WRITE SetMaterialPrimary + NOTIFY MaterialPrimaryChanged + ) + + /// \brief Material accent color (Pre-defined color name or hex value) + Q_PROPERTY( + QString materialAccent + READ MaterialAccent + WRITE SetMaterialAccent + NOTIFY MaterialAccentChanged + ) + + /// \brief Top toolbar color for light theme (Pre-defined color name or + /// hex value). Defaults to material primary. + Q_PROPERTY( + QString toolBarColorLight + READ ToolBarColorLight + WRITE SetToolBarColorLight + NOTIFY ToolBarColorLightChanged + ) + + /// \brief Top toolbar text color for light theme (Pre-defined color name + /// or hex value). Defaults to material background. + Q_PROPERTY( + QString toolBarTextColorLight + READ ToolBarTextColorLight + WRITE SetToolBarTextColorLight + NOTIFY ToolBarTextColorLightChanged + ) + + /// \brief Top toolbar color for dark theme (Pre-defined color name or + /// hex value). Defaults to material primary. + Q_PROPERTY( + QString toolBarColorDark + READ ToolBarColorDark + WRITE SetToolBarColorDark + NOTIFY ToolBarColorDarkChanged + ) + + /// \brief Top toolbar text color for dark theme (Pre-defined color name + /// or hex value). Defaults to material background. + Q_PROPERTY( + QString toolBarTextColorDark + READ ToolBarTextColorDark + WRITE SetToolBarTextColorDark + NOTIFY ToolBarTextColorDarkChanged + ) + + /// \brief Plugin toolbar color for light theme (Pre-defined color name or + /// hex value). Defaults to material accent. + Q_PROPERTY( + QString pluginToolBarColorLight + READ PluginToolBarColorLight + WRITE SetPluginToolBarColorLight + NOTIFY PluginToolBarColorLightChanged + ) + + /// \brief Plugin toolbar text color for light theme (Pre-defined color + /// name or hex value). Defaults to material foreground. + Q_PROPERTY( + QString pluginToolBarTextColorLight + READ PluginToolBarTextColorLight + WRITE SetPluginToolBarTextColorLight + NOTIFY PluginToolBarTextColorLightChanged + ) + + /// \brief Plugin toolbar color for dark theme (Pre-defined color name or + /// hex value). Defaults to material accent. + Q_PROPERTY( + QString pluginToolBarColorDark + READ PluginToolBarColorDark + WRITE SetPluginToolBarColorDark + NOTIFY PluginToolBarColorDarkChanged + ) + + /// \brief Plugin toolbar text color for dark theme (Pre-defined color + /// name or hex value). Defaults to material foreground. + Q_PROPERTY( + QString pluginToolBarTextColorDark + READ PluginToolBarTextColorDark + WRITE SetPluginToolBarTextColorDark + NOTIFY PluginToolBarTextColorDarkChanged + ) + + /// \brief Flag to show side drawer + Q_PROPERTY( + bool showDrawer + READ ShowDrawer + WRITE SetShowDrawer + NOTIFY ShowDrawerChanged + ) + + /// \brief Flag to show side drawer's default options + Q_PROPERTY( + bool showDefaultDrawerOpts + READ ShowDefaultDrawerOpts + WRITE SetShowDefaultDrawerOpts + NOTIFY ShowDefaultDrawerOptsChanged + ) + + /// \brief Flag to show plugins menu + Q_PROPERTY( + bool showPluginMenu + READ ShowPluginMenu + WRITE SetShowPluginMenu + NOTIFY ShowPluginMenuChanged + ) + + /// \brief Flag to enable confirmation dialog on exit + Q_PROPERTY( + ExitAction defaultExitAction + READ DefaultExitAction + WRITE SetDefaultExitAction + NOTIFY DefaultExitActionChanged + ) + + /// \brief Flag to enable confirmation dialog on exit + Q_PROPERTY( + bool showDialogOnExit + READ ShowDialogOnExit + WRITE SetShowDialogOnExit + NOTIFY ShowDialogOnExitChanged + ) + + /// \brief Text of the prompt in confirmation dialog on exit + Q_PROPERTY( + QString dialogOnExitText + READ DialogOnExitText + WRITE SetDialogOnExitText + NOTIFY DialogOnExitTextChanged + ) + + /// \brief Flag to show "shutdown" button in confirmation dialog on exit + Q_PROPERTY( + bool exitDialogShowShutdown + READ ExitDialogShowShutdown + WRITE SetExitDialogShowShutdown + NOTIFY ExitDialogShowShutdownChanged + ) + + /// \brief Flag to show "close GUI" button in confirmation dialog on exit + Q_PROPERTY( + bool exitDialogShowCloseGui + READ ExitDialogShowCloseGui + WRITE SetExitDialogShowCloseGui + NOTIFY ExitDialogShowCloseGuiChanged + ) + + /// \brief Text of the "shutdown" button in confirmation dialog on exit + Q_PROPERTY( + QString exitDialogShutdownText + READ ExitDialogShutdownText + WRITE SetExitDialogShutdownText + NOTIFY ExitDialogShutdownTextChanged + ) + + /// \brief Text of the "Close GUI" button in confirmation dialog on exit + Q_PROPERTY( + QString exitDialogCloseGuiText + READ ExitDialogCloseGuiText + WRITE SetExitDialogCloseGuiText + NOTIFY ExitDialogCloseGuiTextChanged + ) + + /// \brief Constructor + public: MainWindow(); + + /// \brief Destructor + public: virtual ~MainWindow(); + + /// \brief Get the QtQuick window created by this object + /// \return Pointer to the QtQuick window + public: QQuickWindow *QuickWindow() const; + + /// \brief Save current window and plugin configuration to a file on disk. + /// Will open an error dialog in case it's not possible to write to the + /// path. + /// \param[in] _path The full destination path including filename. + public: void SaveConfig(const std::string &_path); + + /// \brief Apply a WindowConfig to this window and keep a copy of it. + /// \param[in] _config The configuration to apply. + /// \return True if successful. + public: bool ApplyConfig(const WindowConfig &_config); + + /// \brief Get the current window configuration. + /// \return Updated window config + public: WindowConfig CurrentWindowConfig() const; + + /// \brief Add a plugin to the window. + /// \param [in] _plugin Plugin filename + public slots: void OnAddPlugin(QString _plugin); + + /// \brief Return a list of all plugin names found + /// \return List with plugin names + public: Q_INVOKABLE QStringList PluginListModel() const; + + /// \brief Returns the number of plugins current instantiated in the + /// window. + /// \return Number of plugins + public: Q_INVOKABLE int PluginCount() const; + + /// \brief Sets the number of plugins current instantiated in the + /// window. + /// \param[in] _pluginCount Number of plugins + public: Q_INVOKABLE void SetPluginCount(const int _pluginCount); + + /// \brief Returns the material theme. + /// \return Theme (Light / Dark) + public: Q_INVOKABLE QString MaterialTheme() const; + + /// \brief Sets the material theme + /// \param[in] _materialTheme Theme (Light / Dark) + public: Q_INVOKABLE void SetMaterialTheme( + const QString &_materialTheme); + + /// \brief Returns the material primary color. + /// \return Primary color + public: Q_INVOKABLE QString MaterialPrimary() const; + + /// \brief Sets the material primary color + /// \param[in] _materialPrimary Primary color + public: Q_INVOKABLE void SetMaterialPrimary( + const QString &_materialPrimary); + + /// \brief Returns the material accent color. + /// \return Accent color + public: Q_INVOKABLE QString MaterialAccent() const; + + /// \brief Sets the material accent color + /// \param[in] _materialAccent Accent color + public: Q_INVOKABLE void SetMaterialAccent( + const QString &_materialAccent); + + /// \brief Returns the top toolbar color for light theme. + /// \return Toolbar color + public: Q_INVOKABLE QString ToolBarColorLight() const; + + /// \brief Sets the top toolbar color for light theme. + /// \param[in] _toolBarColorLight Toolbar color + public: Q_INVOKABLE void SetToolBarColorLight( + const QString &_toolBarColorLight); + + /// \brief Returns the top toolbar text color for light theme. + /// \return Toolbar text color + public: Q_INVOKABLE QString ToolBarTextColorLight() const; + + /// \brief Sets the top toolbar text color for light theme. + /// \param[in] _toolBarTextColorLight Toolbar text color + public: Q_INVOKABLE void SetToolBarTextColorLight( + const QString &_toolBarTextColorLight); + + /// \brief Returns the top toolbar color for dark theme. + /// \return Toolbar color + public: Q_INVOKABLE QString ToolBarColorDark() const; + + /// \brief Sets the top toolbar color for dark theme. + /// \param[in] _toolBarColorDark Toolbar color + public: Q_INVOKABLE void SetToolBarColorDark( + const QString &_toolBarColorDark); + + /// \brief Returns the top toolbar text color for dark theme. + /// \return Toolbar text color + public: Q_INVOKABLE QString ToolBarTextColorDark() const; + + /// \brief Sets the top toolbar text color for dark theme. + /// \param[in] _toolBarTextColorDark Toolbar text color + public: Q_INVOKABLE void SetToolBarTextColorDark( + const QString &_toolBarTextColorDark); + + /// \brief Returns the plugin toolbar color for light theme. + /// \return Toolbar color + public: Q_INVOKABLE QString PluginToolBarColorLight() const; + + /// \brief Sets the plugin toolbar color for light theme. + /// \param[in] _pluginPluginToolBarColorLight Toolbar color + public: Q_INVOKABLE void SetPluginToolBarColorLight( + const QString &_pluginPluginToolBarColorLight); + + /// \brief Returns the plugin toolbar text color for light theme. + /// \return Toolbar text color + public: Q_INVOKABLE QString PluginToolBarTextColorLight() const; + + /// \brief Sets the plugin toolbar text color for light theme. + /// \param[in] _pluginPluginToolBarTextColorLight Toolbar text color + public: Q_INVOKABLE void SetPluginToolBarTextColorLight( + const QString &_pluginPluginToolBarTextColorLight); + + /// \brief Returns the plugin toolbar color for dark theme. + /// \return Toolbar color + public: Q_INVOKABLE QString PluginToolBarColorDark() const; + + /// \brief Sets the plugin toolbar color for dark theme. + /// \param[in] _pluginPluginToolBarColorDark Toolbar color + public: Q_INVOKABLE void SetPluginToolBarColorDark( + const QString &_pluginPluginToolBarColorDark); + + /// \brief Returns the plugin toolbar text color for dark theme. + /// \return Toolbar text color + public: Q_INVOKABLE QString PluginToolBarTextColorDark() const; + + /// \brief Sets the plugin toolbar text color for dark theme. + /// \param[in] _pluginPluginToolBarTextColorDark Toolbar text color + public: Q_INVOKABLE void SetPluginToolBarTextColorDark( + const QString &_pluginPluginToolBarTextColorDark); + + /// \brief Get the flag to show the side drawer. + /// \return True to show. + public: Q_INVOKABLE bool ShowDrawer() const; + + /// \brief Set the flag to show the side drawer. + /// \param[in] _showDrawer True to show. + public: Q_INVOKABLE void SetShowDrawer(const bool _showDrawer); + + /// \brief Get the flag to show the side drawer's default options. + /// \return True to show. + public: Q_INVOKABLE bool ShowDefaultDrawerOpts() const; + + /// \brief Set the flag to show the side drawer's default options. + /// \param[in] _showDefaultDrawerOpts True to show. + public: Q_INVOKABLE void SetShowDefaultDrawerOpts( + const bool _showDefaultDrawerOpts); + + /// \brief Get the flag to show the plugin menu. + /// \return True to show. + public: Q_INVOKABLE bool ShowPluginMenu() const; + + /// \brief Set the flag to show the plugin menu. + /// \param[in] _showPluginMenu True to show. + public: Q_INVOKABLE void SetShowPluginMenu(const bool _showPluginMenu); + + /// \brief Get the action performed when GUI closes without prompt. + /// \return The action. + public: Q_INVOKABLE ExitAction DefaultExitAction() const; + + /// \brief Set the action performed when GUI closes without prompt. + /// \param[in] _defaultExitAction The action. + public: Q_INVOKABLE void SetDefaultExitAction( + enum ExitAction _defaultExitAction); + + /// \brief Get the flag to show the plugin menu. + /// \return True to show. + public: Q_INVOKABLE bool ShowDialogOnExit() const; + + /// \brief Set the flag to show the confirmation dialog when exiting. + /// \param[in] _showDialogOnExit True to show. + public: Q_INVOKABLE void SetShowDialogOnExit(bool _showDialogOnExit); + + /// \brief Get the text of prompt in exit dialog. + /// \return Prompt text. + public: Q_INVOKABLE QString DialogOnExitText() const; + + /// \brief Set the text of the prompt in exit dialog. + /// \param[in] _dialogOnExitText Prompt text. + public: Q_INVOKABLE void SetDialogOnExitText( + const QString &_dialogOnExitText); + + /// \brief Get the flag to show "shutdown" button in exit dialog. + /// \return True to show. + public: Q_INVOKABLE bool ExitDialogShowShutdown() const; + + /// \brief Set the flag to show "shutdown" button in exit dialog. + /// \param[in] _exitDialogShowShutdown True to show. + public: Q_INVOKABLE void SetExitDialogShowShutdown( + bool _exitDialogShowShutdown); + + /// \brief Get the flag to show "Close GUI" button in exit dialog. + /// \return True to show. + public: Q_INVOKABLE bool ExitDialogShowCloseGui() const; + + /// \brief Set the flag to show "Close GUI" button in exit dialog. + /// \param[in] _exitDialogShowCloseGui True to show. + public: Q_INVOKABLE void SetExitDialogShowCloseGui( + bool _exitDialogShowCloseGui); + + /// \brief Get the text of the "shutdown" button in exit dialog. + /// \return Button text. + public: Q_INVOKABLE QString ExitDialogShutdownText() const; + + /// \brief Set the text of the "shutdown" button in exit dialog. + /// \param[in] _exitDialogShutdownText Button text. + public: Q_INVOKABLE void SetExitDialogShutdownText( + const QString &_exitDialogShutdownText); + + /// \brief Get the text of the "Close GUI" button in exit dialog. + /// \return Button text. + public: Q_INVOKABLE QString ExitDialogCloseGuiText() const; + + /// \brief Set the text of the "Close GUI" button in exit dialog. + /// \param[in] _exitDialogCloseGuiText Button text. + public: Q_INVOKABLE void SetExitDialogCloseGuiText( + const QString &_exitDialogCloseGuiText); + + /// \brief Get the topic of the server control service. + /// \return The service topic. + public: Q_INVOKABLE std::string ServerControlService() const; + + /// \brief Set the topic of the server control service. + /// \param[in] _service The service topic. + public: Q_INVOKABLE void SetServerControlService( + const std::string &_service); + + /// \brief Callback when load configuration is selected + public slots: void OnLoadConfig(const QString &_path); + + /// \brief Callback when "save configuration" is selected + public slots: void OnSaveConfig(); + + /// \brief Callback when "save configuration as" is selected + public slots: void OnSaveConfigAs(const QString &_path); + + /// \brief Callback when "shutdown simulation" is called + public slots: void OnStopServer(); + + /// \brief Notifies when the number of plugins has changed. + signals: void PluginCountChanged(); + + /// \brief Notifies when the theme has changed. + signals: void MaterialThemeChanged(); + + /// \brief Notifies when the primary color has changed. + signals: void MaterialPrimaryChanged(); + + /// \brief Notifies when the accent color has changed. + signals: void MaterialAccentChanged(); + + /// \brief Notifies when the toolbar color light has changed. + signals: void ToolBarColorLightChanged(); + + /// \brief Notifies when the toolbar text color light has changed. + signals: void ToolBarTextColorLightChanged(); + + /// \brief Notifies when the toolbar color dark has changed. + signals: void ToolBarColorDarkChanged(); + + /// \brief Notifies when the toolbar text color dark has changed. + signals: void ToolBarTextColorDarkChanged(); + + /// \brief Notifies when the toolbar color light has changed. + signals: void PluginToolBarColorLightChanged(); + + /// \brief Notifies when the toolbar text color light has changed. + signals: void PluginToolBarTextColorLightChanged(); + + /// \brief Notifies when the toolbar color dark has changed. + signals: void PluginToolBarColorDarkChanged(); + + /// \brief Notifies when the toolbar text color dark has changed. + signals: void PluginToolBarTextColorDarkChanged(); + + /// \brief Notifies when the show drawer flag has changed. + signals: void ShowDrawerChanged(); + + /// \brief Notifies when the show drawer default options flag has changed. + signals: void ShowDefaultDrawerOptsChanged(); + + /// \brief Notifies when the show menu flag has changed. + signals: void ShowPluginMenuChanged(); + + /// \brief Notifies when the defaultExitAction has changed. + signals: void DefaultExitActionChanged(); + + /// \brief Notifies when the showDialogOnExit flag has changed. + signals: void ShowDialogOnExitChanged(); + + /// \brief Notifies when dialogOnExitText has changed. + signals: void DialogOnExitTextChanged(); + + /// \brief Notifies when the exitDialogShowShutdown flag has changed. + signals: void ExitDialogShowShutdownChanged(); + + /// \brief Notifies when the exitDialogShowCloseGui flag has changed. + signals: void ExitDialogShowCloseGuiChanged(); + + /// \brief Notifies when exitDialogShutdownText has changed. + signals: void ExitDialogShutdownTextChanged(); + + /// \brief Notifies when exitDialogCloseGuiText has changed. + signals: void ExitDialogCloseGuiTextChanged(); + + /// \brief Notifies when the window config has changed. + signals: void configChanged(); + + /// \brief Displays a message to the user + /// The message will appear in a snackbar, this message requires to + /// click on the botton "Dismiss" to close the dialog. + signals: void notify(const QString &_message); + + /// \brief Displays a message to the user + /// The message will appear in a snackbar, this message disappear when + /// the duration is over, or if the user clicks outside or escape before + /// that. + /// \param[in] _message Message to show + /// \param[in] _duration Time in milliseconds that the message will + /// appear + signals: void notifyWithDuration(const QString &_message, int _duration); + + /// \internal + /// \brief Private data pointer + private: std::unique_ptr dataPtr; + }; + + /// \brief Holds configurations related to a MainWindow. + struct IGNITION_GUI_VISIBLE WindowConfig + { + /// \brief Update this config from an XML string. Only fields present on + /// the XML will be overriden / appended / created. + /// \param[in] _xml A config XML file in string format + /// \return True if successful. It may fail for example if the string + /// can't be parsed into XML. + bool MergeFromXML(const std::string &_xml); + + /// \brief Return this configuration in XML format as a string. + /// \return String containing a complete config file. + std::string XMLString() const; + + /// \brief Get whether a property should be ignored + /// \return True if it's being ignored + bool IsIgnoring(const std::string &_prop) const; + + /// \brief Window X position in px + int posX{-1}; + + /// \brief Window Y position in px + int posY{-1}; + + /// \brief Window width in px + int width{-1}; + + /// \brief Window height in px + int height{-1}; + + /// \brief Window state (dock configuration) + QByteArray state; + + /// \brief Material theme (light / dark) + std::string materialTheme{""}; + + /// \brief Material primary color + std::string materialPrimary{""}; + + /// \brief Material accent color + std::string materialAccent{""}; + + /// \brief Top toolbar color light + std::string toolBarColorLight{""}; + + /// \brief Top toolbar text color light + std::string toolBarTextColorLight{""}; + + /// \brief Top toolbar color dark + std::string toolBarColorDark{""}; + + /// \brief Top toolbar text color dark + std::string toolBarTextColorDark{""}; + + /// \brief Plugin toolbar color light + std::string pluginToolBarColorLight{""}; + + /// \brief Plugin toolbar text color light + std::string pluginToolBarTextColorLight{""}; + + /// \brief Plugin toolbar color dark + std::string pluginToolBarColorDark{""}; + + /// \brief Plugin toolbar text color dark + std::string pluginToolBarTextColorDark{""}; + + /// \brief Show the side drawer + bool showDrawer{true}; + + /// \brief Show the default options of the drawer + bool showDefaultDrawerOpts{true}; + + /// \brief Show the plugins menu + bool showPluginMenu{true}; + + /// \brief True if plugins found in plugin paths should be listed under + /// the Plugins menu. True by default. + bool pluginsFromPaths{true}; + + /// \brief List of plugins which should be shown on the list + std::vector showPlugins; + + /// \brief List of window properties which should be ignored on load + std::set ignoredProps; + + /// \brief Concatenation of all plugin configurations. + std::string plugins{""}; + + }; + } +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif diff --git a/include/gz/gui/Plugin.hh b/include/gz/gui/Plugin.hh new file mode 100644 index 000000000..ed15ebfbe --- /dev/null +++ b/include/gz/gui/Plugin.hh @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifndef GZ_GUI_PLUGIN_HH_ +#define GZ_GUI_PLUGIN_HH_ + +#include +#include +#include + +#include "gz/gui/qt.h" +#include "gz/gui/Export.hh" + +#ifdef _WIN32 +// Disable warning C4251 which is triggered by +// std::unique_ptr +#pragma warning(push) +#pragma warning(disable: 4251) +#endif + +namespace ignition +{ + namespace gui + { + class PluginPrivate; + + /// \brief Base class for Gazebo GUI plugins. + /// + /// When inheriting from this plugin, the following are assumed: + /// + /// * The derived class' name is the same as the generated shared library + /// (i.e. if the Publisher class extends Plugin, the library file is + /// libPublisher.so) + /// + /// * There is a QML file with the same name as the plugin's shared library + /// name. + /// (i.e. there must be a Publisher.qml) + /// + /// * The QML file is prefixed by the library's name in the QRC file + /// (i.e. the file's resource is found at ':/Publisher/Publisher.qml') + class IGNITION_GUI_VISIBLE Plugin : public QObject + { + Q_OBJECT + + /// \brief Constructor + public: Plugin(); + + /// \brief Destructor + public: virtual ~Plugin(); + + /// \brief Load the plugin with a configuration file. + /// This loads the default parameters and then calls LoadConfig(), which + /// should be overridden to load custom parameters. + /// + /// Called when a plugin is first created. + /// This function should not be blocking. + /// + /// \sa Load + /// \param[in] _pluginElem Element containing configuration + public: void Load(const tinyxml2::XMLElement *_pluginElem); + + /// \brief Get the configuration XML as a string + /// \return Config element + public: virtual std::string ConfigStr(); + + /// \brief Get the card item which contains this plugin. The item is + /// generated the first time this function is run. + /// \return Pointer to card item. + public: QQuickItem *CardItem() const; + + /// \brief Get the plugin item. + /// \return Pointer to plugin item. + public: QQuickItem *PluginItem() const; + + /// \brief Get the QML context where the plugin was created. + /// \return Pointer context. + public: QQmlContext *Context() const; + + /// \brief Apply changes which should come after the plugin already + /// has a parent. + public: void PostParentChanges(); + + /// \brief Load the plugin with a configuration file. Override this + /// on custom plugins to handle custom configurations. + /// + /// Called when a plugin is first created. + /// This function should not be blocking. + /// + /// \sa Load + /// \param[in] _pluginElem Element containing configuration + protected: virtual void LoadConfig( + const tinyxml2::XMLElement *_pluginElem) + { + (void)_pluginElem; + } + + /// \brief Get title + /// \return Plugin title. + public: virtual std::string Title() const {return this->title;} + + /// \brief Get the value of the the `delete_later` element from the + /// configuration file, which defaults to false. + /// \return The value of `delete_later`. + public: bool DeleteLaterRequested() const; + + /// \brief Wait until the plugin has a parent, then close and delete the + /// parent. + protected: void DeleteLater(); + + /// \brief Title to be displayed on top of plugin. + protected: std::string title = ""; + + /// \brief XML configuration + protected: std::string configStr; + + /// \brief Load configuration which is common to all plugins and handled + /// by Gazebo GUI. + /// \details Called when a plugin is first created. + /// \sa LoadConfig + /// \param[in] _ignGuiElem element within the . + /// Will be nullptr if not present in the SDF. + private: virtual void LoadCommonConfig( + const tinyxml2::XMLElement *_ignGuiElem); + + /// \brief Apply any anchors which may have been specified on the config + /// through the tag and any state properties. + private: void ApplyAnchors(); + + /// \internal + /// \brief Pointer to private data + private: std::unique_ptr dataPtr; + }; + } +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif diff --git a/include/gz/gui/SearchModel.hh b/include/gz/gui/SearchModel.hh new file mode 100644 index 000000000..df75295fb --- /dev/null +++ b/include/gz/gui/SearchModel.hh @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef GZ_GUI_SEARCHMODEL_HH_ +#define GZ_GUI_SEARCHMODEL_HH_ + +#include "gz/gui/Export.hh" +#include "gz/gui/qt.h" + +namespace ignition +{ +namespace gui +{ + /// \brief Customize the proxy model to display search results. + /// + /// Features: + /// + /// * This has been tested with QTreeView and QTableView. + /// * Manages expansion of nested items through DataRole::TO_EXPAND when + /// applicable + /// * Items with DataRole::TYPE == "title" are ignored + /// + class IGNITION_GUI_VISIBLE SearchModel : public QSortFilterProxyModel + { + /// \brief Overloaded Qt method. Customize so we accept rows where: + /// 1. Each of the words can be found in its ancestors or itself, but not + /// necessarily all words on the same row, or + /// 2. One of its descendants matches rule 1, or + /// 3. One of its ancestors matches rule 1. + /// + /// For example this structure: + /// - a + /// -- b + /// -- c + /// --- d + /// + /// * A search of "a" will display all rows. + /// * A search of "b" or "a b" will display "a" and "b". + /// * A search of "c", "d", "a c", "a d", "a c d" or "c d" will display + /// "a", "c" and "d". + /// * A search of "a b c d", "b c" or "b d" will display nothing. + /// + /// \param[in] _srcRow Row on the source model. + /// \param[in] _srcParent Parent on the source model. + /// \return True if row is accepted. + public: bool filterAcceptsRow(const int _srcRow, + const QModelIndex &_srcParent) const; + + /// \brief Check if row contains the word on itself. + /// \param[in] _srcRow Row on the source model. + /// \param[in] _srcParent Parent on the source model. + /// \param[in] _word Word to be checked. + /// \return True if row matches. + public: bool FilterAcceptsRowItself(const int _srcRow, + const QModelIndex &_srcParent, + const QString &_word) const; + + /// \brief Check if any of the children is fully accepted. + /// \param[in] _srcRow Row on the source model. + /// \param[in] _srcParent Parent on the source model. + /// \return True if any of the children match. + public: bool HasAcceptedChildren(const int _srcRow, + const QModelIndex &_srcParent) const; + + /// \brief Check if any of the children accepts a specific word. + /// \param[in] _srcParent Parent on the source model. + /// \param[in] _word Word to be checked. + /// \return True if any of the children match. + public: bool HasChildAcceptsItself(const QModelIndex &_srcParent, + const QString &_word) const; + + /// \brief Set a new search value. + /// \param[in] _search Full search string. + public: void SetSearch(const QString &_search); + + /// \brief Full search string. + public: QString search; + }; +} +} +#endif diff --git a/include/ignition/gui/config.hh.in b/include/gz/gui/config.hh.in similarity index 69% rename from include/ignition/gui/config.hh.in rename to include/gz/gui/config.hh.in index e439764c9..aef429786 100644 --- a/include/ignition/gui/config.hh.in +++ b/include/gz/gui/config.hh.in @@ -8,10 +8,19 @@ #define IGNITION_GUI_VERSION "${PROJECT_VERSION}" #define IGNITION_GUI_VERSION_FULL "${PROJECT_VERSION_FULL}" -#define IGNITION_GUI_VERSION_HEADER "Ignition ${GZ_DESIGNATION}, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2017 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n" +#define IGNITION_GUI_VERSION_HEADER "Gazebo ${GZ_DESIGNATION}, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2017 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n" #cmakedefine BUILD_TYPE_PROFILE 1 #cmakedefine BUILD_TYPE_DEBUG 1 #cmakedefine BUILD_TYPE_RELEASE 1 #define IGN_GUI_PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/ign-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins" + +namespace ignition +{ +} + +namespace gz +{ + using namespace ignition; +} diff --git a/include/gz/gui/gz.hh b/include/gz/gui/gz.hh new file mode 100644 index 000000000..c9a66b64c --- /dev/null +++ b/include/gz/gui/gz.hh @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#ifndef GZ_GUI_IGN_HH_ +#define GZ_GUI_IGN_HH_ + +#include "gz/gui/Export.hh" + +/// \brief External hook to read the library version. +/// \return C-string representing the version. Ex.: 0.1.2 +extern "C" IGNITION_GUI_VISIBLE char *ignitionVersion(); + +/// \brief External hook to execute 'ign gui -l' from the command line. +extern "C" IGNITION_GUI_VISIBLE void cmdPluginList(); + +/// \brief External hook to execute 'ign gui -s' from the command line. +/// \param[in] _filename Name of a plugin file. +extern "C" IGNITION_GUI_VISIBLE void cmdStandalone(const char *_filename); + +/// \brief External hook to execute 'ign gui -c' from the command line. +/// \param[in] _config Path to a config file. +extern "C" IGNITION_GUI_VISIBLE void cmdConfig(const char *_config); + +/// \brief External hook to execute 'ign gui' from the command line. +extern "C" IGNITION_GUI_VISIBLE void cmdEmptyWindow(); + +/// \brief External hook when executing 'ign gui -t' from the command line. +/// \param[in] _filename Path to a QSS file. +extern "C" IGNITION_GUI_VISIBLE void cmdSetStyleFromFile(const char *_filename); + +#endif diff --git a/include/gz/gui/ign_auto_headers.hh.in b/include/gz/gui/ign_auto_headers.hh.in new file mode 100644 index 000000000..78322db29 --- /dev/null +++ b/include/gz/gui/ign_auto_headers.hh.in @@ -0,0 +1,3 @@ +// Automatically generated +#include +${ign_headers} diff --git a/include/ignition/gui/qml/GzColor.qml b/include/gz/gui/qml/GzColor.qml similarity index 100% rename from include/ignition/gui/qml/GzColor.qml rename to include/gz/gui/qml/GzColor.qml diff --git a/include/ignition/gui/qml/GzPose.qml b/include/gz/gui/qml/GzPose.qml similarity index 100% rename from include/ignition/gui/qml/GzPose.qml rename to include/gz/gui/qml/GzPose.qml diff --git a/include/ignition/gui/qml/GzVector3.qml b/include/gz/gui/qml/GzVector3.qml similarity index 100% rename from include/ignition/gui/qml/GzVector3.qml rename to include/gz/gui/qml/GzVector3.qml diff --git a/include/ignition/gui/qml/IgnCard.qml b/include/gz/gui/qml/IgnCard.qml similarity index 100% rename from include/ignition/gui/qml/IgnCard.qml rename to include/gz/gui/qml/IgnCard.qml diff --git a/include/ignition/gui/qml/IgnCardSettings.qml b/include/gz/gui/qml/IgnCardSettings.qml similarity index 100% rename from include/ignition/gui/qml/IgnCardSettings.qml rename to include/gz/gui/qml/IgnCardSettings.qml diff --git a/include/ignition/gui/qml/IgnHelpers.qml b/include/gz/gui/qml/IgnHelpers.qml similarity index 100% rename from include/ignition/gui/qml/IgnHelpers.qml rename to include/gz/gui/qml/IgnHelpers.qml diff --git a/include/ignition/gui/qml/IgnRulers.qml b/include/gz/gui/qml/IgnRulers.qml similarity index 100% rename from include/ignition/gui/qml/IgnRulers.qml rename to include/gz/gui/qml/IgnRulers.qml diff --git a/include/ignition/gui/qml/IgnSnackBar.qml b/include/gz/gui/qml/IgnSnackBar.qml similarity index 100% rename from include/ignition/gui/qml/IgnSnackBar.qml rename to include/gz/gui/qml/IgnSnackBar.qml diff --git a/include/ignition/gui/qml/IgnSortFilterModel.qml b/include/gz/gui/qml/IgnSortFilterModel.qml similarity index 100% rename from include/ignition/gui/qml/IgnSortFilterModel.qml rename to include/gz/gui/qml/IgnSortFilterModel.qml diff --git a/include/ignition/gui/qml/IgnSpinBox.qml b/include/gz/gui/qml/IgnSpinBox.qml similarity index 100% rename from include/ignition/gui/qml/IgnSpinBox.qml rename to include/gz/gui/qml/IgnSpinBox.qml diff --git a/include/ignition/gui/qml/IgnSplit.qml b/include/gz/gui/qml/IgnSplit.qml similarity index 100% rename from include/ignition/gui/qml/IgnSplit.qml rename to include/gz/gui/qml/IgnSplit.qml diff --git a/include/ignition/gui/qml/Main.qml b/include/gz/gui/qml/Main.qml similarity index 99% rename from include/ignition/gui/qml/Main.qml rename to include/gz/gui/qml/Main.qml index 4ce98ff64..9cc59485f 100644 --- a/include/ignition/gui/qml/Main.qml +++ b/include/gz/gui/qml/Main.qml @@ -24,7 +24,7 @@ import "qrc:/qml" ApplicationWindow { - title: qsTr("Ignition GUI") + title: qsTr("Gazebo GUI") width: 1200 height: 1000 minimumWidth: 300 @@ -260,7 +260,7 @@ ApplicationWindow id: aboutDialog modal: true focus: true - title: "Ignition GUI" + title: "Gazebo GUI" x: (window.width - width) / 2 y: window.height / 6 width: Math.min(window.width, window.height) / 3 * 2 diff --git a/include/ignition/gui/qml/PluginMenu.qml b/include/gz/gui/qml/PluginMenu.qml similarity index 100% rename from include/ignition/gui/qml/PluginMenu.qml rename to include/gz/gui/qml/PluginMenu.qml diff --git a/include/ignition/gui/qml/SideDrawer.qml b/include/gz/gui/qml/SideDrawer.qml similarity index 100% rename from include/ignition/gui/qml/SideDrawer.qml rename to include/gz/gui/qml/SideDrawer.qml diff --git a/include/ignition/gui/qml/StandaloneDialog.qml b/include/gz/gui/qml/StandaloneDialog.qml similarity index 100% rename from include/ignition/gui/qml/StandaloneDialog.qml rename to include/gz/gui/qml/StandaloneDialog.qml diff --git a/include/ignition/gui/qml/StyleDialog.qml b/include/gz/gui/qml/StyleDialog.qml similarity index 100% rename from include/ignition/gui/qml/StyleDialog.qml rename to include/gz/gui/qml/StyleDialog.qml diff --git a/include/ignition/gui/qml/images/drawer.png b/include/gz/gui/qml/images/drawer.png similarity index 100% rename from include/ignition/gui/qml/images/drawer.png rename to include/gz/gui/qml/images/drawer.png diff --git a/include/ignition/gui/qml/images/ignition_logo_50x50.png b/include/gz/gui/qml/images/ignition_logo_50x50.png similarity index 100% rename from include/ignition/gui/qml/images/ignition_logo_50x50.png rename to include/gz/gui/qml/images/ignition_logo_50x50.png diff --git a/include/ignition/gui/qml/images/menu.png b/include/gz/gui/qml/images/menu.png similarity index 100% rename from include/ignition/gui/qml/images/menu.png rename to include/gz/gui/qml/images/menu.png diff --git a/include/ignition/gui/qml/images/search.svg b/include/gz/gui/qml/images/search.svg similarity index 100% rename from include/ignition/gui/qml/images/search.svg rename to include/gz/gui/qml/images/search.svg diff --git a/include/ignition/gui/qml/qmldir b/include/gz/gui/qml/qmldir similarity index 100% rename from include/ignition/gui/qml/qmldir rename to include/gz/gui/qml/qmldir diff --git a/include/gz/gui/qt.h b/include/gz/gui/qt.h new file mode 100644 index 000000000..e03d51dfb --- /dev/null +++ b/include/gz/gui/qt.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2017 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#ifndef GZ_GUI_QT_H_ +#define GZ_GUI_QT_H_ + +#ifndef _MSC_VER +#pragma GCC system_header +#endif + +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + + +#endif // GZ_GUI_QT_H_ diff --git a/include/ignition/gui/qtquickcontrols2.conf b/include/gz/gui/qtquickcontrols2.conf similarity index 100% rename from include/ignition/gui/qtquickcontrols2.conf rename to include/gz/gui/qtquickcontrols2.conf diff --git a/include/ignition/gui/resources.qrc b/include/gz/gui/resources.qrc similarity index 100% rename from include/ignition/gui/resources.qrc rename to include/gz/gui/resources.qrc diff --git a/include/ignition/gui.hh b/include/ignition/gui.hh new file mode 100644 index 000000000..432d7aabc --- /dev/null +++ b/include/ignition/gui.hh @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include diff --git a/include/ignition/gui/Application.hh b/include/ignition/gui/Application.hh index 0a104848b..7b3377be8 100644 --- a/include/ignition/gui/Application.hh +++ b/include/ignition/gui/Application.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,214 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ -#ifndef IGNITION_GUI_APPLICATION_HH_ -#define IGNITION_GUI_APPLICATION_HH_ + */ -#include -#include -#include -#include - -#include "ignition/gui/qt.h" -#include "ignition/gui/Export.hh" - -#ifdef _WIN32 -// Disable warning C4251 which is triggered by -// std::unique_ptr -#pragma warning(push) -#pragma warning(disable: 4251) -#endif - -namespace tinyxml2 -{ - class XMLElement; -} - -namespace ignition -{ - namespace gui - { - class ApplicationPrivate; - class Dialog; - class MainWindow; - class Plugin; - - /// \brief Type of window which the application will display - enum class WindowType : int - { - /// \brief A main window, which may contain top-level menus and multiple - /// plugins - kMainWindow = 0, - - /// \brief One independent dialog per plugin. Also useful to open a - /// startup dialog before the main window. - kDialog = 1 - }; - - /// \brief An Ignition GUI application loads a QML engine and - /// provides an API to load plugins and configuration files. The application - /// supports either running a single main window or several plugins as - /// standalone dialogs. - class IGNITION_GUI_VISIBLE Application : public QGuiApplication - { - Q_OBJECT - - /// \brief Constructor. - /// \param[in] _argc Argument count. - /// \param[in] _argv Argument values. - /// \param[in] _type Window type, by default it's a main window. - public: Application(int &_argc, char **_argv, - const WindowType _type = WindowType::kMainWindow); - - /// \brief Destructor - public: virtual ~Application(); - - /// \brief Get the QML engine - /// \return Pointer to QML engine - public: QQmlApplicationEngine *Engine() const; - - /// \brief Load a plugin from a file name. The plugin file must be in the - /// path. - /// If a window has been initialized, the plugin is added to the window. - /// Otherwise, the plugin is stored and can be later added to a window or - /// dialog. - /// \param[in] _filename Plugin filename. - /// \param[in] _pluginElem Element containing plugin configuration - /// \return True if successful - /// \sa LoadConfig - /// \sa AddPluginsToWindow - public: bool LoadPlugin(const std::string &_filename, - const tinyxml2::XMLElement *_pluginElem = nullptr); - - /// \brief Load a configuration file, which includes window configurations - /// and plugins. This function doesn't instantiate the plugins, it just - /// keeps them in memory and they can be applied later by either - /// instantiating a window or several dialogs. - /// and plugins. - /// \param[in] _path Full path to configuration file. - /// \return True if successful - /// \sa InitializeMainWindow - /// \sa InitializeDialogs - public: bool LoadConfig(const std::string &_path); - - /// \brief Load the configuration from the default config file. - /// \return True if successful - /// \sa SetDefaultConfigPath - /// \sa DefaultConfigPath - /// \sa LoadConfig - public: bool LoadDefaultConfig(); - - /// \brief Specifies the location of the default configuration file. - /// This is the file that stores the user settings when pressing - /// "Save configuration". - /// \param[in] _path The default configuration full path including - /// filename. - /// \sa LoadDefaultConfig - /// \sa defaultConfigPath - public: void SetDefaultConfigPath(const std::string &_path); - - /// \brief Get the location of the default configuration file. - /// \return The default configuration path. - /// \sa LoadDefaultConfig - /// \sa SetDefaultConfigPath - public: std::string DefaultConfigPath(); - - /// \brief Set the environment variable which defines the paths to - /// look for plugins. - /// \param[in] _env Name of environment variable. - public: void SetPluginPathEnv(const std::string &_env); - - /// \brief Add an path to look for plugins. - /// \param[in] _path Full path. - public: void AddPluginPath(const std::string &_path); - - /// \brief Get the list of available plugins, organized by path. The - /// paths are given in the following order: - /// - /// 1. Paths given by the environment variable - /// 2. Paths added by calling addPluginPath - /// 3. Path ~/.ignition/gui/plugins - /// 4. The path where Ignition GUI plugins are installed - /// - /// \return A vector of pairs, where each pair contains: - /// * A path - /// * A vector of plugins in that path - public: std::vector>> - PluginList(); - - /// \brief Remove plugin by name. The plugin is removed from the - /// application and its shared library unloaded if this was its last - /// instance. - /// \param[in] _pluginName Plugn instance's unique name. This is the - /// plugin card's object name. - /// \return True if successful - public: bool RemovePlugin(const std::string &_pluginName); - - - /// \brief Get a plugin by its unique name. - /// \param[in] _pluginName Plugn instance's unique name. This is the - /// plugin card's object name. - /// \return Pointer to plugin object, null if not found. - public: std::shared_ptr PluginByName( - const std::string &_pluginName) const; - - /// \brief Notify that a plugin has been added. - /// \param[in] _objectName Plugin's object name. - signals: void PluginAdded(const QString &_objectName); - - /// \brief Callback when user requests to close a plugin - public slots: void OnPluginClose(); - - /// \brief Create a main window. Just calls InitializeMainWindow. - /// \return True if successful - /// \sa InitializeMainWindow - public: bool CreateMainWindow(); - - /// \brief Create a main window, populate with previously loaded plugins - /// and apply previously loaded configuration. - /// An empty window will be created if no plugins have been loaded. - /// \return True if successful - /// \sa LoadConfig - /// \sa LoadPlugin - private: bool InitializeMainWindow(); - - /// \brief Create individual dialogs for all previously loaded plugins. - /// This has no effect if no plugins have been loaded. - /// \return True if successful - /// \sa LoadConfig - /// \sa LoadPlugin - private: bool InitializeDialogs(); - - /// \brief Remove plugin by pointer. - /// \param[in] _plugin Shared pointer to plugin - private: void RemovePlugin(std::shared_ptr _plugin); - - /// \brief Add previously loaded plugins to the main window. - /// \return True if successful. Will fail if the window hasn't been - /// created yet. - /// \sa LoadPlugin - private: bool AddPluginsToWindow(); - - /// \brief Apply previously loaded config to the main window. - /// \return True if successful, will fail if there's no main window - /// initialized. - private: bool ApplyConfig(); - - /// \internal - /// \brief Private data pointer - private: std::unique_ptr dataPtr; - }; - - /// \brief Get current running application, this is a cast of qGuiApp. - /// \return Pointer to running application, or nullptr if none is running. - IGNITION_GUI_VISIBLE - Application *App(); - } -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#endif +#include +#include diff --git a/include/ignition/gui/Conversions.hh b/include/ignition/gui/Conversions.hh index 2730f9fbd..63f926f5f 100644 --- a/include/ignition/gui/Conversions.hh +++ b/include/ignition/gui/Conversions.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,91 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ + */ -#ifndef IGNITION_GUI_CONVERSIONS_HH_ -#define IGNITION_GUI_CONVERSIONS_HH_ - -#ifdef _MSC_VER -#pragma warning(push, 0) -#endif -#include -#ifdef _MSC_VER -#pragma warning(pop) -#endif -#include -#include -#include -#include - -#include "ignition/gui/qt.h" -#include "ignition/gui/Export.hh" - -namespace ignition -{ - namespace common - { - class MouseEvent; - } - - namespace gui - { - /// \brief Return the equivalent qt color - /// \param[in] _color Ignition color to convert - /// \return Qt color value - IGNITION_GUI_VISIBLE - QColor convert(const math::Color &_color); - - /// \brief Return the equivalent ignition color - /// \param[in] _color Qt color to convert - /// \return Ignition color value - IGNITION_GUI_VISIBLE - math::Color convert(const QColor &_color); - - /// \brief Return the equivalent QPointF. - /// \param[in] _pt Ignition vector to convert. - /// \return QPointF. - IGNITION_GUI_VISIBLE - QPointF convert(const math::Vector2d &_pt); - - /// \brief Return the equivalent ignition vector. - /// \param[in] _pt QPointF to convert - /// \return Ignition Vector2d. - IGNITION_GUI_VISIBLE - math::Vector2d convert(const QPointF &_pt); - - /// \brief Return the equivalent qt vector 3d. - /// \param[in] _vec Ignition vector 3d to convert. - /// \return Qt vector 3d value. - IGNITION_GUI_VISIBLE - QVector3D convert(const math::Vector3d &_vec); - - /// \brief Return the equivalent ignition vector 3d. - /// \param[in] _vec Qt vector 3d to convert. - /// \return Ignition vector 3d value - IGNITION_GUI_VISIBLE - math::Vector3d convert(const QVector3D &_vec); - - /// \brief Return the equivalent ignition mouse event. - /// - /// Note that there isn't a 1-1 mapping between these types, so fields such - /// as common::MouseEvent::PressPos need to be set afterwards. - /// \param[in] _e Qt mouse event - /// \return Ignition mouse event - IGNITION_GUI_VISIBLE - common::MouseEvent convert(const QMouseEvent &_e); - - /// \brief Convert an ignition::msgs::Time to an ignition::common::Time - /// \param[in] _t The time to convert - /// \return An ignition::common::Time object - IGNITION_GUI_VISIBLE - common::Time convert(const msgs::Time &_t); - - /// \brief Convert an ignition::common::Time to an ignition::msgs::Time - /// \param[in] _t The time to convert - /// \return An ignition::msgs::Time object - IGNITION_GUI_VISIBLE - msgs::Time convert(const common::Time &_t); - } -} -#endif +#include +#include diff --git a/include/ignition/gui/Dialog.hh b/include/ignition/gui/Dialog.hh index 4c7a51daa..c2b3b862e 100644 --- a/include/ignition/gui/Dialog.hh +++ b/include/ignition/gui/Dialog.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,90 +15,5 @@ * */ -#ifndef IGNITION_GUI_DIALOG_HH_ -#define IGNITION_GUI_DIALOG_HH_ - -#include -#include - -#include "ignition/gui/qt.h" -#include "ignition/gui/Export.hh" - -#ifdef _WIN32 -// Disable warning C4251 which is triggered by -// std::unique_ptr -#pragma warning(push) -#pragma warning(disable: 4251) -#endif - -namespace ignition -{ - namespace gui - { - class DialogPrivate; - - /// \brief Gui plugin - class IGNITION_GUI_VISIBLE Dialog : public QObject - { - Q_OBJECT - - /// \brief Constructor - public: Dialog(); - - /// \brief Destructor - public: virtual ~Dialog(); - - /// \brief Get the QtQuick window created by this object - /// \return Pointer to the QtQuick window - public: QQuickWindow *QuickWindow() const; - - /// \brief Get the root quick item of this window - /// \return Pointer to the item - public: QQuickItem *RootItem() const; - - /// \brief Store dialog default config - /// \param[in] _config XML config as string - /// \deprecated Introduce deprecation warnings on v7. - public: void SetDefaultConfig(const std::string &_config); - - /// \brief Update an attribute on an XML file. The attribute belongs to - /// a `` element that has a `name` attrbute matching this dialog's - /// name, i.e. - /// - /// `` - /// - /// If a dialog element with this dialog's name doesn't exist yet, one - /// will be created. - /// - /// \param[in] _path File path. File must already exist, this function - /// will not create a new file. - /// \param[in] _attribute XMLElement attribute name - /// \param[in] _value XMLElement attribute value - /// \return True if written to config file - public: bool UpdateConfigAttribute( - const std::string &_path, const std::string &_attribute, - const bool _value) const; - - /// \brief Gets an attribute value from an XML file. The attribute belongs - /// to a `` element that has a `name` attribute matching this - /// dialog's name. - /// It will return an empty string if the file or the attribute - /// don't exist. - /// \param[in] _path File path - /// \param[in] _attribute attribute name - /// \return Attribute value as string - public: std::string ReadConfigAttribute(const std::string &_path, - const std::string &_attribute) const; - - /// \internal - /// \brief Private data pointer - private: std::unique_ptr dataPtr; - }; - } -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#endif +#include +#include diff --git a/include/ignition/gui/DragDropModel.hh b/include/ignition/gui/DragDropModel.hh index 397a0e6f5..fcd5b1412 100644 --- a/include/ignition/gui/DragDropModel.hh +++ b/include/ignition/gui/DragDropModel.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,26 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ -#ifndef IGNITION_GUI_DRAGDROPMODEL_HH_ -#define IGNITION_GUI_DRAGDROPMODEL_HH_ + */ -#include "ignition/gui/Export.hh" -#include "ignition/gui/qt.h" - -namespace ignition -{ -namespace gui -{ - /// \brief Customized item model so that we can pass along an URI query as - /// MIME information during a drag-drop. - class IGNITION_GUI_VISIBLE DragDropModel : public QStandardItemModel - { - /// \brief Overloaded from Qt. Custom MIME data function. - /// \param[in] _indexes List of selected items. - /// \return Mime data for the selected items. - public: QMimeData *mimeData(const QModelIndexList &_indexes) const; - }; -} -} -#endif +#include +#include diff --git a/include/ignition/gui/Enums.hh b/include/ignition/gui/Enums.hh index 911b929e1..e87d512bc 100644 --- a/include/ignition/gui/Enums.hh +++ b/include/ignition/gui/Enums.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,74 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ + */ -#ifndef IGNITION_GUI_ENUMS_HH_ -#define IGNITION_GUI_ENUMS_HH_ - -#include "ignition/gui/qt.h" - -namespace ignition -{ -namespace gui -{ - /// \brief Data roles - enum DataRole - { - /// \brief Text which is displayed for the user. - DISPLAY_NAME = Qt::UserRole + 100, - - /// \brief URI including detailed query. This is the information carried - /// during a drag-drop operation. - URI_QUERY, - - /// \brief Data type name, such as "Double" or "Bool", or "model", "link". - /// Used to specialize display according to type. - TYPE, - - /// \brief Flag indicating whether an item should be expanded or not. - TO_EXPAND - }; - - /// \brief String types - enum class StringType - { - /// \brief Undefined type - NONE, - - /// \brief Use line for short strings which usually fit in a single - /// line. - LINE, - - /// \brief Use text for longer strings which span multiple lines. - PLAIN_TEXT - }; - - /// \brief Number types - enum class NumberType - { - /// \brief Undefined type - NONE, - - /// \brief Double - DOUBLE, - - /// \brief Integer - INT, - - /// \brief Unsigned integer - UINT - }; - - /// \brief File types - enum FileType - { - /// \brief Comma separated value (CSV) - CSVFile, - - /// \brief Portable document format (PDF) - PDFFile - }; -} -} -#endif +#include +#include diff --git a/include/ignition/gui/Export.hh b/include/ignition/gui/Export.hh new file mode 100644 index 000000000..145530e06 --- /dev/null +++ b/include/ignition/gui/Export.hh @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include diff --git a/include/ignition/gui/GuiEvents.hh b/include/ignition/gui/GuiEvents.hh index 78f8a0cbf..e8961662d 100644 --- a/include/ignition/gui/GuiEvents.hh +++ b/include/ignition/gui/GuiEvents.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,250 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ -#ifndef IGNITION_GUI_GUIEVENTS_HH_ -#define IGNITION_GUI_GUIEVENTS_HH_ + */ -#include -#include -#include -#include -#include - -namespace ignition -{ - namespace gui - { - /// \brief Namespace for all events. - namespace events - { - /// User defined events should start from QEvent::MaxUser and - /// count down to avoid collision with ign-gazebo events - - /// \brief Event called in the render thread of a 3D scene. - /// It's safe to make rendering calls in this event's callback. - class Render : public QEvent - { - public: Render() - : QEvent(kType) - { - } - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser); - }; - - /// \brief The class for sending and receiving custom snap value events. - /// This event is used in the Transform Control plugin tool when the - /// user manually alters their snapping values. - class SnapIntervals : public QEvent - { - /// \brief Constructor - /// \param[in] _xyz XYZ snapping values. - /// \param[in] _rpy RPY snapping values. - /// \param[in] _scale Scale snapping values. - public: SnapIntervals( - const math::Vector3d &_xyz, - const math::Vector3d &_rpy, - const math::Vector3d &_scale) - : QEvent(kType), xyz(_xyz), rpy(_rpy), scale(_scale) - { - } - - /// \brief Get the XYZ snapping values. - /// \return The XYZ snapping values. - public: math::Vector3d Position() const - { - return this->xyz; - } - - /// \brief Get the RPY snapping values. - /// \return The RPY snapping values. - public: math::Vector3d Rotation() const - { - return this->rpy; - } - - /// \brief Get the scale snapping values. - /// \return The scale snapping values. - public: math::Vector3d Scale() const - { - return this->scale; - } - - /// \brief The QEvent representing a snap event occurrence. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 1); - - /// \brief XYZ snapping values in meters, these values must be positive. - private: math::Vector3d xyz; - - /// \brief RPY snapping values in degrees, these values must be - /// positive. - private: math::Vector3d rpy; - - /// \brief Scale snapping values - a multiplier of the current size, - /// these values must be positive. - private: math::Vector3d scale; - }; - - /// \brief Event called to spawn a resource, given its description as a - /// string. - class SpawnFromDescription : public QEvent - { - /// \brief Constructor - /// \param[in] _description The resource's description as a string, such - /// as an SDF file. - public: explicit SpawnFromDescription(const std::string &_description) - : QEvent(kType), description(_description) - { - } - - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 2); - - /// \brief Get the string description of the resource. - /// \return The resource string - public: const std::string &Description() const - { - return this->description; - } - - /// \brief The string of the resource to be spawned. - std::string description; - }; - - /// \brief Event called to spawn a resource, which takes the path - /// to its file. - class SpawnFromPath : public QEvent - { - /// \brief Constructor - /// \param[in] _filePath The path to a file. - public: explicit SpawnFromPath(const std::string &_filePath) - : QEvent(kType), filePath(_filePath) - { - } - - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 3); - - /// \brief Get the path of the file. - /// \return The file path. - public: const std::string &FilePath() const - { - return this->filePath; - } - - /// \brief The path of file to be previewed. - std::string filePath; - }; - - /// \brief Event which is called to broadcast the 3D coordinates of a - /// user's mouse hover within the scene. - class HoverToScene : public QEvent - { - /// \brief Constructor - /// \param[in] _point The point at which the mouse is hovering within - /// the scene - public: explicit HoverToScene(const math::Vector3d &_point) - : QEvent(kType), point(_point) - { - } - - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 4); - - /// \brief Get the point within the scene over which the user is - /// hovering. - /// \return The 3D point - public: math::Vector3d Point() const - { - return this->point; - } - - /// \brief The 3D point over which the user is hovering. - private: math::Vector3d point; - }; - - /// \brief Event which is called to broadcast the 3D coordinates of a - /// user's left click within the scene. - class LeftClickToScene : public QEvent - { - /// \brief Constructor - /// \param[in] _point The point which the user has left clicked within - /// the scene - public: explicit LeftClickToScene(const math::Vector3d &_point) - : QEvent(kType), point(_point) - { - } - - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 5); - - /// \brief Get the point within the scene that the user clicked. - /// \return The 3D point. - public: math::Vector3d Point() const - { - return this->point; - } - - /// \brief The 3D point that the user clicked within the scene. - private: math::Vector3d point; - }; - - /// \brief Event which is called to broadcast the 3D coordinates of a - /// user's right click within the scene. - class RightClickToScene : public QEvent - { - /// \brief Constructor - /// \param[in] _point The point which the user has right clicked - /// within the scene - public: explicit RightClickToScene(const math::Vector3d &_point) - : QEvent(kType), point(_point) - { - } - - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 6); - - /// \brief Get the point within the scene that the user clicked. - /// \return The 3D point. - public: math::Vector3d Point() const - { - return this->point; - } - - /// \brief The 3D point that the user clicked within the scene. - private: math::Vector3d point; - }; - - /// \brief Event which is called to enable or disable the dropdown menu. - /// This is primarily used by plugins which also use the right click - /// mouse event to cancel any actions currently in progress. - class DropdownMenuEnabled : public QEvent - { - /// \brief Constructor - /// \param[in] _menuEnabled The boolean indicating whether the dropdown - /// menu should be enabled or disabled. - public: explicit DropdownMenuEnabled(bool _menuEnabled) - : QEvent(kType), menuEnabled(_menuEnabled) - { - } - - /// \brief Unique type for this event. - static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 7); - - /// \brief Gets whether the menu is enabled or not for this event. - /// \return True if enabling the menu, false if disabling the menu - public: bool MenuEnabled() const - { - return this->menuEnabled; - } - - /// \brief The boolean indicating whether the menu is disabled or not - /// for this event. - private: bool menuEnabled; - }; - } - } -} - -#endif // IGNITION_GUI_GUIEVENTS_HH_ +#include +#include diff --git a/include/ignition/gui/Helpers.hh b/include/ignition/gui/Helpers.hh index bb88ec828..b123adb8b 100644 --- a/include/ignition/gui/Helpers.hh +++ b/include/ignition/gui/Helpers.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,99 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ -#ifndef IGNITION_GUI_HELPERS_HH_ -#define IGNITION_GUI_HELPERS_HH_ + */ -#include - -#include "ignition/gui/Enums.hh" -#include "ignition/gui/Export.hh" - -namespace ignition -{ - namespace gui - { - /// \brief Create a human readable key, capitalizing the first letter - /// and removing characters like "_". - /// \param[in] _key Non-human-readable key. - /// \return Human-readable key. - IGNITION_GUI_VISIBLE - std::string humanReadable(const std::string &_key); - - /// \brief Returns the unit for a given key. For example, the key "mass" - /// returns "kg". - /// \param[in] _key The key. - /// \param[in] _type In case the key may have more than one type, the type - /// must be given too. For example, a prismatic joint will have different - /// units from a revolute joint. - /// \return The unit. - IGNITION_GUI_VISIBLE - std::string unitFromKey(const std::string &_key, - const std::string &_type = ""); - - /// \brief Returns the range for a given key. For example, the key - /// "transparency" returns min == 0, max == 1. - /// \param[in] _key The key. - /// \param[out] _min The minimum value. - /// \param[out] _max The maximum value. - IGNITION_GUI_VISIBLE - void rangeFromKey(const std::string &_key, double &_min, double &_max); - - /// \brief Returns the string type for a given key. For example, the key - /// "innerxml" has a PLAIN_TEXT type while "name" is a LINE. - /// \param[in] _key The key. - /// \return The string type. - IGNITION_GUI_VISIBLE - StringType stringTypeFromKey(const std::string &_key); - - /// \brief Generates a path for a file which doesn't collide with existing - /// files, by appending numbers to it (i.e. (0), (1), ...) - /// \param[in] _pathAndName Full absolute path and file name up to the - /// file extension. - /// \param[in] _extension File extension, such as "pdf". - /// \return Full path, with name and extension, which doesn't collide with - /// existing files - IGNITION_GUI_VISIBLE - std::string uniqueFilePath(const std::string &_pathAndName, - const std::string &_extension); - - /// \brief The main window's "worldNames" property may be filled with a list - /// of the names of all worlds currently loaded. This information can be - /// used by plugins to choose which world to work with. - /// This helper function provides a handy access to the world names list. - /// \return List of world names, as stored in the `MainWindow`'s - /// "worldNames" property. - IGNITION_GUI_VISIBLE - QStringList worldNames(); - - - /// \brief Import path for ign-gui QML modules added to the Qt resource - /// system. This helper function returns the QRC resource path where custom - /// ignition QML modules can be imported from. To import an ignition QML - /// module, add this path to the QML engine's import path list before - /// attempting to load a QML file that imports ignition QML modules. - /// \return Resousrce path prefix as a string - IGNITION_GUI_VISIBLE - const QString qmlQrcImportPath(); - - /// \brief Returns the first element on a QList which matches the given - /// property. - /// \param[in] _list The list to search through. - /// \param[in] _key The property key value. - /// \param[in] _value The property value. - /// \return The first matching element. - template - T findFirstByProperty(const QList _list, const char *_key, - QVariant _value) - { - for (const auto &w : _list) - { - if (w->property(_key) == _value) - return w; - } - return nullptr; - } - } -} -#endif +#include +#include diff --git a/include/ignition/gui/MainWindow.hh b/include/ignition/gui/MainWindow.hh index 9f3cd5e33..5df5762da 100644 --- a/include/ignition/gui/MainWindow.hh +++ b/include/ignition/gui/MainWindow.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,671 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ -#ifndef IGNITION_GUI_MAINWINDOW_HH_ -#define IGNITION_GUI_MAINWINDOW_HH_ + */ -#include -#include -#include -#include -#include - -#include - -#include "ignition/gui/qt.h" -#include "ignition/gui/Export.hh" - -#ifdef _WIN32 -// Disable warning C4251 which is triggered by -// std::unique_ptr -#pragma warning(push) -#pragma warning(disable: 4251) -#endif - -namespace ignition -{ - namespace gui - { - Q_NAMESPACE - class MainWindowPrivate; - struct WindowConfig; - - /// \brief The action executed when GUI is closed without prompt. - enum class ExitAction - { - /// \brief Close GUI and leave server running - CLOSE_GUI, - /// \brief Close GUI and shutdown server - SHUTDOWN_SERVER, - }; - /// \cond DO_NOT_DOCUMENT - Q_ENUM_NS(ExitAction) - /// \endcond - - /// \brief The main window class creates a QQuickWindow and acts as an - /// interface which provides properties and functions which can be called - /// from Main.qml - class IGNITION_GUI_VISIBLE MainWindow : public QObject - { - Q_OBJECT - - /// \brief Number of plugins currently instantiated inside the window. - Q_PROPERTY( - int pluginCount - READ PluginCount - WRITE SetPluginCount - NOTIFY PluginCountChanged - ) - - /// \brief Material theme (Light / Dark) - Q_PROPERTY( - QString materialTheme - READ MaterialTheme - WRITE SetMaterialTheme - NOTIFY MaterialThemeChanged - ) - - /// \brief Material primary color (Pre-defined color name or hex value) - Q_PROPERTY( - QString materialPrimary - READ MaterialPrimary - WRITE SetMaterialPrimary - NOTIFY MaterialPrimaryChanged - ) - - /// \brief Material accent color (Pre-defined color name or hex value) - Q_PROPERTY( - QString materialAccent - READ MaterialAccent - WRITE SetMaterialAccent - NOTIFY MaterialAccentChanged - ) - - /// \brief Top toolbar color for light theme (Pre-defined color name or - /// hex value). Defaults to material primary. - Q_PROPERTY( - QString toolBarColorLight - READ ToolBarColorLight - WRITE SetToolBarColorLight - NOTIFY ToolBarColorLightChanged - ) - - /// \brief Top toolbar text color for light theme (Pre-defined color name - /// or hex value). Defaults to material background. - Q_PROPERTY( - QString toolBarTextColorLight - READ ToolBarTextColorLight - WRITE SetToolBarTextColorLight - NOTIFY ToolBarTextColorLightChanged - ) - - /// \brief Top toolbar color for dark theme (Pre-defined color name or - /// hex value). Defaults to material primary. - Q_PROPERTY( - QString toolBarColorDark - READ ToolBarColorDark - WRITE SetToolBarColorDark - NOTIFY ToolBarColorDarkChanged - ) - - /// \brief Top toolbar text color for dark theme (Pre-defined color name - /// or hex value). Defaults to material background. - Q_PROPERTY( - QString toolBarTextColorDark - READ ToolBarTextColorDark - WRITE SetToolBarTextColorDark - NOTIFY ToolBarTextColorDarkChanged - ) - - /// \brief Plugin toolbar color for light theme (Pre-defined color name or - /// hex value). Defaults to material accent. - Q_PROPERTY( - QString pluginToolBarColorLight - READ PluginToolBarColorLight - WRITE SetPluginToolBarColorLight - NOTIFY PluginToolBarColorLightChanged - ) - - /// \brief Plugin toolbar text color for light theme (Pre-defined color - /// name or hex value). Defaults to material foreground. - Q_PROPERTY( - QString pluginToolBarTextColorLight - READ PluginToolBarTextColorLight - WRITE SetPluginToolBarTextColorLight - NOTIFY PluginToolBarTextColorLightChanged - ) - - /// \brief Plugin toolbar color for dark theme (Pre-defined color name or - /// hex value). Defaults to material accent. - Q_PROPERTY( - QString pluginToolBarColorDark - READ PluginToolBarColorDark - WRITE SetPluginToolBarColorDark - NOTIFY PluginToolBarColorDarkChanged - ) - - /// \brief Plugin toolbar text color for dark theme (Pre-defined color - /// name or hex value). Defaults to material foreground. - Q_PROPERTY( - QString pluginToolBarTextColorDark - READ PluginToolBarTextColorDark - WRITE SetPluginToolBarTextColorDark - NOTIFY PluginToolBarTextColorDarkChanged - ) - - /// \brief Flag to show side drawer - Q_PROPERTY( - bool showDrawer - READ ShowDrawer - WRITE SetShowDrawer - NOTIFY ShowDrawerChanged - ) - - /// \brief Flag to show side drawer's default options - Q_PROPERTY( - bool showDefaultDrawerOpts - READ ShowDefaultDrawerOpts - WRITE SetShowDefaultDrawerOpts - NOTIFY ShowDefaultDrawerOptsChanged - ) - - /// \brief Flag to show plugins menu - Q_PROPERTY( - bool showPluginMenu - READ ShowPluginMenu - WRITE SetShowPluginMenu - NOTIFY ShowPluginMenuChanged - ) - - /// \brief Flag to enable confirmation dialog on exit - Q_PROPERTY( - ExitAction defaultExitAction - READ DefaultExitAction - WRITE SetDefaultExitAction - NOTIFY DefaultExitActionChanged - ) - - /// \brief Flag to enable confirmation dialog on exit - Q_PROPERTY( - bool showDialogOnExit - READ ShowDialogOnExit - WRITE SetShowDialogOnExit - NOTIFY ShowDialogOnExitChanged - ) - - /// \brief Text of the prompt in confirmation dialog on exit - Q_PROPERTY( - QString dialogOnExitText - READ DialogOnExitText - WRITE SetDialogOnExitText - NOTIFY DialogOnExitTextChanged - ) - - /// \brief Flag to show "shutdown" button in confirmation dialog on exit - Q_PROPERTY( - bool exitDialogShowShutdown - READ ExitDialogShowShutdown - WRITE SetExitDialogShowShutdown - NOTIFY ExitDialogShowShutdownChanged - ) - - /// \brief Flag to show "close GUI" button in confirmation dialog on exit - Q_PROPERTY( - bool exitDialogShowCloseGui - READ ExitDialogShowCloseGui - WRITE SetExitDialogShowCloseGui - NOTIFY ExitDialogShowCloseGuiChanged - ) - - /// \brief Text of the "shutdown" button in confirmation dialog on exit - Q_PROPERTY( - QString exitDialogShutdownText - READ ExitDialogShutdownText - WRITE SetExitDialogShutdownText - NOTIFY ExitDialogShutdownTextChanged - ) - - /// \brief Text of the "Close GUI" button in confirmation dialog on exit - Q_PROPERTY( - QString exitDialogCloseGuiText - READ ExitDialogCloseGuiText - WRITE SetExitDialogCloseGuiText - NOTIFY ExitDialogCloseGuiTextChanged - ) - - /// \brief Constructor - public: MainWindow(); - - /// \brief Destructor - public: virtual ~MainWindow(); - - /// \brief Get the QtQuick window created by this object - /// \return Pointer to the QtQuick window - public: QQuickWindow *QuickWindow() const; - - /// \brief Save current window and plugin configuration to a file on disk. - /// Will open an error dialog in case it's not possible to write to the - /// path. - /// \param[in] _path The full destination path including filename. - public: void SaveConfig(const std::string &_path); - - /// \brief Apply a WindowConfig to this window and keep a copy of it. - /// \param[in] _config The configuration to apply. - /// \return True if successful. - public: bool ApplyConfig(const WindowConfig &_config); - - /// \brief Get the current window configuration. - /// \return Updated window config - public: WindowConfig CurrentWindowConfig() const; - - /// \brief Add a plugin to the window. - /// \param [in] _plugin Plugin filename - public slots: void OnAddPlugin(QString _plugin); - - /// \brief Return a list of all plugin names found - /// \return List with plugin names - public: Q_INVOKABLE QStringList PluginListModel() const; - - /// \brief Returns the number of plugins current instantiated in the - /// window. - /// \return Number of plugins - public: Q_INVOKABLE int PluginCount() const; - - /// \brief Sets the number of plugins current instantiated in the - /// window. - /// \param[in] _pluginCount Number of plugins - public: Q_INVOKABLE void SetPluginCount(const int _pluginCount); - - /// \brief Returns the material theme. - /// \return Theme (Light / Dark) - public: Q_INVOKABLE QString MaterialTheme() const; - - /// \brief Sets the material theme - /// \param[in] _materialTheme Theme (Light / Dark) - public: Q_INVOKABLE void SetMaterialTheme( - const QString &_materialTheme); - - /// \brief Returns the material primary color. - /// \return Primary color - public: Q_INVOKABLE QString MaterialPrimary() const; - - /// \brief Sets the material primary color - /// \param[in] _materialPrimary Primary color - public: Q_INVOKABLE void SetMaterialPrimary( - const QString &_materialPrimary); - - /// \brief Returns the material accent color. - /// \return Accent color - public: Q_INVOKABLE QString MaterialAccent() const; - - /// \brief Sets the material accent color - /// \param[in] _materialAccent Accent color - public: Q_INVOKABLE void SetMaterialAccent( - const QString &_materialAccent); - - /// \brief Returns the top toolbar color for light theme. - /// \return Toolbar color - public: Q_INVOKABLE QString ToolBarColorLight() const; - - /// \brief Sets the top toolbar color for light theme. - /// \param[in] _toolBarColorLight Toolbar color - public: Q_INVOKABLE void SetToolBarColorLight( - const QString &_toolBarColorLight); - - /// \brief Returns the top toolbar text color for light theme. - /// \return Toolbar text color - public: Q_INVOKABLE QString ToolBarTextColorLight() const; - - /// \brief Sets the top toolbar text color for light theme. - /// \param[in] _toolBarTextColorLight Toolbar text color - public: Q_INVOKABLE void SetToolBarTextColorLight( - const QString &_toolBarTextColorLight); - - /// \brief Returns the top toolbar color for dark theme. - /// \return Toolbar color - public: Q_INVOKABLE QString ToolBarColorDark() const; - - /// \brief Sets the top toolbar color for dark theme. - /// \param[in] _toolBarColorDark Toolbar color - public: Q_INVOKABLE void SetToolBarColorDark( - const QString &_toolBarColorDark); - - /// \brief Returns the top toolbar text color for dark theme. - /// \return Toolbar text color - public: Q_INVOKABLE QString ToolBarTextColorDark() const; - - /// \brief Sets the top toolbar text color for dark theme. - /// \param[in] _toolBarTextColorDark Toolbar text color - public: Q_INVOKABLE void SetToolBarTextColorDark( - const QString &_toolBarTextColorDark); - - /// \brief Returns the plugin toolbar color for light theme. - /// \return Toolbar color - public: Q_INVOKABLE QString PluginToolBarColorLight() const; - - /// \brief Sets the plugin toolbar color for light theme. - /// \param[in] _pluginPluginToolBarColorLight Toolbar color - public: Q_INVOKABLE void SetPluginToolBarColorLight( - const QString &_pluginPluginToolBarColorLight); - - /// \brief Returns the plugin toolbar text color for light theme. - /// \return Toolbar text color - public: Q_INVOKABLE QString PluginToolBarTextColorLight() const; - - /// \brief Sets the plugin toolbar text color for light theme. - /// \param[in] _pluginPluginToolBarTextColorLight Toolbar text color - public: Q_INVOKABLE void SetPluginToolBarTextColorLight( - const QString &_pluginPluginToolBarTextColorLight); - - /// \brief Returns the plugin toolbar color for dark theme. - /// \return Toolbar color - public: Q_INVOKABLE QString PluginToolBarColorDark() const; - - /// \brief Sets the plugin toolbar color for dark theme. - /// \param[in] _pluginPluginToolBarColorDark Toolbar color - public: Q_INVOKABLE void SetPluginToolBarColorDark( - const QString &_pluginPluginToolBarColorDark); - - /// \brief Returns the plugin toolbar text color for dark theme. - /// \return Toolbar text color - public: Q_INVOKABLE QString PluginToolBarTextColorDark() const; - - /// \brief Sets the plugin toolbar text color for dark theme. - /// \param[in] _pluginPluginToolBarTextColorDark Toolbar text color - public: Q_INVOKABLE void SetPluginToolBarTextColorDark( - const QString &_pluginPluginToolBarTextColorDark); - - /// \brief Get the flag to show the side drawer. - /// \return True to show. - public: Q_INVOKABLE bool ShowDrawer() const; - - /// \brief Set the flag to show the side drawer. - /// \param[in] _showDrawer True to show. - public: Q_INVOKABLE void SetShowDrawer(const bool _showDrawer); - - /// \brief Get the flag to show the side drawer's default options. - /// \return True to show. - public: Q_INVOKABLE bool ShowDefaultDrawerOpts() const; - - /// \brief Set the flag to show the side drawer's default options. - /// \param[in] _showDefaultDrawerOpts True to show. - public: Q_INVOKABLE void SetShowDefaultDrawerOpts( - const bool _showDefaultDrawerOpts); - - /// \brief Get the flag to show the plugin menu. - /// \return True to show. - public: Q_INVOKABLE bool ShowPluginMenu() const; - - /// \brief Set the flag to show the plugin menu. - /// \param[in] _showPluginMenu True to show. - public: Q_INVOKABLE void SetShowPluginMenu(const bool _showPluginMenu); - - /// \brief Get the action performed when GUI closes without prompt. - /// \return The action. - public: Q_INVOKABLE ExitAction DefaultExitAction() const; - - /// \brief Set the action performed when GUI closes without prompt. - /// \param[in] _defaultExitAction The action. - public: Q_INVOKABLE void SetDefaultExitAction( - enum ExitAction _defaultExitAction); - - /// \brief Get the flag to show the plugin menu. - /// \return True to show. - public: Q_INVOKABLE bool ShowDialogOnExit() const; - - /// \brief Set the flag to show the confirmation dialog when exiting. - /// \param[in] _showDialogOnExit True to show. - public: Q_INVOKABLE void SetShowDialogOnExit(bool _showDialogOnExit); - - /// \brief Get the text of prompt in exit dialog. - /// \return Prompt text. - public: Q_INVOKABLE QString DialogOnExitText() const; - - /// \brief Set the text of the prompt in exit dialog. - /// \param[in] _dialogOnExitText Prompt text. - public: Q_INVOKABLE void SetDialogOnExitText( - const QString &_dialogOnExitText); - - /// \brief Get the flag to show "shutdown" button in exit dialog. - /// \return True to show. - public: Q_INVOKABLE bool ExitDialogShowShutdown() const; - - /// \brief Set the flag to show "shutdown" button in exit dialog. - /// \param[in] _exitDialogShowShutdown True to show. - public: Q_INVOKABLE void SetExitDialogShowShutdown( - bool _exitDialogShowShutdown); - - /// \brief Get the flag to show "Close GUI" button in exit dialog. - /// \return True to show. - public: Q_INVOKABLE bool ExitDialogShowCloseGui() const; - - /// \brief Set the flag to show "Close GUI" button in exit dialog. - /// \param[in] _exitDialogShowCloseGui True to show. - public: Q_INVOKABLE void SetExitDialogShowCloseGui( - bool _exitDialogShowCloseGui); - - /// \brief Get the text of the "shutdown" button in exit dialog. - /// \return Button text. - public: Q_INVOKABLE QString ExitDialogShutdownText() const; - - /// \brief Set the text of the "shutdown" button in exit dialog. - /// \param[in] _exitDialogShutdownText Button text. - public: Q_INVOKABLE void SetExitDialogShutdownText( - const QString &_exitDialogShutdownText); - - /// \brief Get the text of the "Close GUI" button in exit dialog. - /// \return Button text. - public: Q_INVOKABLE QString ExitDialogCloseGuiText() const; - - /// \brief Set the text of the "Close GUI" button in exit dialog. - /// \param[in] _exitDialogCloseGuiText Button text. - public: Q_INVOKABLE void SetExitDialogCloseGuiText( - const QString &_exitDialogCloseGuiText); - - /// \brief Get the topic of the server control service. - /// \return The service topic. - public: Q_INVOKABLE std::string ServerControlService() const; - - /// \brief Set the topic of the server control service. - /// \param[in] _service The service topic. - public: Q_INVOKABLE void SetServerControlService( - const std::string &_service); - - /// \brief Callback when load configuration is selected - public slots: void OnLoadConfig(const QString &_path); - - /// \brief Callback when "save configuration" is selected - public slots: void OnSaveConfig(); - - /// \brief Callback when "save configuration as" is selected - public slots: void OnSaveConfigAs(const QString &_path); - - /// \brief Callback when "shutdown simulation" is called - public slots: void OnStopServer(); - - /// \brief Notifies when the number of plugins has changed. - signals: void PluginCountChanged(); - - /// \brief Notifies when the theme has changed. - signals: void MaterialThemeChanged(); - - /// \brief Notifies when the primary color has changed. - signals: void MaterialPrimaryChanged(); - - /// \brief Notifies when the accent color has changed. - signals: void MaterialAccentChanged(); - - /// \brief Notifies when the toolbar color light has changed. - signals: void ToolBarColorLightChanged(); - - /// \brief Notifies when the toolbar text color light has changed. - signals: void ToolBarTextColorLightChanged(); - - /// \brief Notifies when the toolbar color dark has changed. - signals: void ToolBarColorDarkChanged(); - - /// \brief Notifies when the toolbar text color dark has changed. - signals: void ToolBarTextColorDarkChanged(); - - /// \brief Notifies when the toolbar color light has changed. - signals: void PluginToolBarColorLightChanged(); - - /// \brief Notifies when the toolbar text color light has changed. - signals: void PluginToolBarTextColorLightChanged(); - - /// \brief Notifies when the toolbar color dark has changed. - signals: void PluginToolBarColorDarkChanged(); - - /// \brief Notifies when the toolbar text color dark has changed. - signals: void PluginToolBarTextColorDarkChanged(); - - /// \brief Notifies when the show drawer flag has changed. - signals: void ShowDrawerChanged(); - - /// \brief Notifies when the show drawer default options flag has changed. - signals: void ShowDefaultDrawerOptsChanged(); - - /// \brief Notifies when the show menu flag has changed. - signals: void ShowPluginMenuChanged(); - - /// \brief Notifies when the defaultExitAction has changed. - signals: void DefaultExitActionChanged(); - - /// \brief Notifies when the showDialogOnExit flag has changed. - signals: void ShowDialogOnExitChanged(); - - /// \brief Notifies when dialogOnExitText has changed. - signals: void DialogOnExitTextChanged(); - - /// \brief Notifies when the exitDialogShowShutdown flag has changed. - signals: void ExitDialogShowShutdownChanged(); - - /// \brief Notifies when the exitDialogShowCloseGui flag has changed. - signals: void ExitDialogShowCloseGuiChanged(); - - /// \brief Notifies when exitDialogShutdownText has changed. - signals: void ExitDialogShutdownTextChanged(); - - /// \brief Notifies when exitDialogCloseGuiText has changed. - signals: void ExitDialogCloseGuiTextChanged(); - - /// \brief Notifies when the window config has changed. - signals: void configChanged(); - - /// \brief Displays a message to the user - /// The message will appear in a snackbar, this message requires to - /// click on the botton "Dismiss" to close the dialog. - signals: void notify(const QString &_message); - - /// \brief Displays a message to the user - /// The message will appear in a snackbar, this message disappear when - /// the duration is over, or if the user clicks outside or escape before - /// that. - /// \param[in] _message Message to show - /// \param[in] _duration Time in milliseconds that the message will - /// appear - signals: void notifyWithDuration(const QString &_message, int _duration); - - /// \internal - /// \brief Private data pointer - private: std::unique_ptr dataPtr; - }; - - /// \brief Holds configurations related to a MainWindow. - struct IGNITION_GUI_VISIBLE WindowConfig - { - /// \brief Update this config from an XML string. Only fields present on - /// the XML will be overriden / appended / created. - /// \param[in] _xml A config XML file in string format - /// \return True if successful. It may fail for example if the string - /// can't be parsed into XML. - bool MergeFromXML(const std::string &_xml); - - /// \brief Return this configuration in XML format as a string. - /// \return String containing a complete config file. - std::string XMLString() const; - - /// \brief Get whether a property should be ignored - /// \return True if it's being ignored - bool IsIgnoring(const std::string &_prop) const; - - /// \brief Window X position in px - int posX{-1}; - - /// \brief Window Y position in px - int posY{-1}; - - /// \brief Window width in px - int width{-1}; - - /// \brief Window height in px - int height{-1}; - - /// \brief Window state (dock configuration) - QByteArray state; - - /// \brief Material theme (light / dark) - std::string materialTheme{""}; - - /// \brief Material primary color - std::string materialPrimary{""}; - - /// \brief Material accent color - std::string materialAccent{""}; - - /// \brief Top toolbar color light - std::string toolBarColorLight{""}; - - /// \brief Top toolbar text color light - std::string toolBarTextColorLight{""}; - - /// \brief Top toolbar color dark - std::string toolBarColorDark{""}; - - /// \brief Top toolbar text color dark - std::string toolBarTextColorDark{""}; - - /// \brief Plugin toolbar color light - std::string pluginToolBarColorLight{""}; - - /// \brief Plugin toolbar text color light - std::string pluginToolBarTextColorLight{""}; - - /// \brief Plugin toolbar color dark - std::string pluginToolBarColorDark{""}; - - /// \brief Plugin toolbar text color dark - std::string pluginToolBarTextColorDark{""}; - - /// \brief Show the side drawer - bool showDrawer{true}; - - /// \brief Show the default options of the drawer - bool showDefaultDrawerOpts{true}; - - /// \brief Show the plugins menu - bool showPluginMenu{true}; - - /// \brief True if plugins found in plugin paths should be listed under - /// the Plugins menu. True by default. - bool pluginsFromPaths{true}; - - /// \brief List of plugins which should be shown on the list - std::vector showPlugins; - - /// \brief List of window properties which should be ignored on load - std::set ignoredProps; - - /// \brief Concatenation of all plugin configurations. - std::string plugins{""}; - - }; - } -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#endif +#include +#include diff --git a/include/ignition/gui/Plugin.hh b/include/ignition/gui/Plugin.hh index b943b1e0d..fd5a6338c 100644 --- a/include/ignition/gui/Plugin.hh +++ b/include/ignition/gui/Plugin.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,140 +14,6 @@ * limitations under the License. * */ -#ifndef IGNITION_GUI_PLUGIN_HH_ -#define IGNITION_GUI_PLUGIN_HH_ -#include -#include -#include - -#include "ignition/gui/qt.h" -#include "ignition/gui/Export.hh" - -#ifdef _WIN32 -// Disable warning C4251 which is triggered by -// std::unique_ptr -#pragma warning(push) -#pragma warning(disable: 4251) -#endif - -namespace ignition -{ - namespace gui - { - class PluginPrivate; - - /// \brief Base class for Ignition GUI plugins. - /// - /// When inheriting from this plugin, the following are assumed: - /// - /// * The derived class' name is the same as the generated shared library - /// (i.e. if the Publisher class extends Plugin, the library file is - /// libPublisher.so) - /// - /// * There is a QML file with the same name as the plugin's shared library - /// name. - /// (i.e. there must be a Publisher.qml) - /// - /// * The QML file is prefixed by the library's name in the QRC file - /// (i.e. the file's resource is found at ':/Publisher/Publisher.qml') - class IGNITION_GUI_VISIBLE Plugin : public QObject - { - Q_OBJECT - - /// \brief Constructor - public: Plugin(); - - /// \brief Destructor - public: virtual ~Plugin(); - - /// \brief Load the plugin with a configuration file. - /// This loads the default parameters and then calls LoadConfig(), which - /// should be overridden to load custom parameters. - /// - /// Called when a plugin is first created. - /// This function should not be blocking. - /// - /// \sa Load - /// \param[in] _pluginElem Element containing configuration - public: void Load(const tinyxml2::XMLElement *_pluginElem); - - /// \brief Get the configuration XML as a string - /// \return Config element - public: virtual std::string ConfigStr(); - - /// \brief Get the card item which contains this plugin. The item is - /// generated the first time this function is run. - /// \return Pointer to card item. - public: QQuickItem *CardItem() const; - - /// \brief Get the plugin item. - /// \return Pointer to plugin item. - public: QQuickItem *PluginItem() const; - - /// \brief Get the QML context where the plugin was created. - /// \return Pointer context. - public: QQmlContext *Context() const; - - /// \brief Apply changes which should come after the plugin already - /// has a parent. - public: void PostParentChanges(); - - /// \brief Load the plugin with a configuration file. Override this - /// on custom plugins to handle custom configurations. - /// - /// Called when a plugin is first created. - /// This function should not be blocking. - /// - /// \sa Load - /// \param[in] _pluginElem Element containing configuration - protected: virtual void LoadConfig( - const tinyxml2::XMLElement *_pluginElem) - { - (void)_pluginElem; - } - - /// \brief Get title - /// \return Plugin title. - public: virtual std::string Title() const {return this->title;} - - /// \brief Get the value of the the `delete_later` element from the - /// configuration file, which defaults to false. - /// \return The value of `delete_later`. - public: bool DeleteLaterRequested() const; - - /// \brief Wait until the plugin has a parent, then close and delete the - /// parent. - protected: void DeleteLater(); - - /// \brief Title to be displayed on top of plugin. - protected: std::string title = ""; - - /// \brief XML configuration - protected: std::string configStr; - - /// \brief Load configuration which is common to all plugins and handled - /// by Ignition GUI. - /// \details Called when a plugin is first created. - /// \sa LoadConfig - /// \param[in] _ignGuiElem element within the . - /// Will be nullptr if not present in the SDF. - private: virtual void LoadCommonConfig( - const tinyxml2::XMLElement *_ignGuiElem); - - /// \brief Apply any anchors which may have been specified on the config - /// through the tag and any state properties. - private: void ApplyAnchors(); - - /// \internal - /// \brief Pointer to private data - private: std::unique_ptr dataPtr; - }; - } -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#endif +#include +#include diff --git a/include/ignition/gui/SearchModel.hh b/include/ignition/gui/SearchModel.hh index 563063f10..b168d1034 100644 --- a/include/ignition/gui/SearchModel.hh +++ b/include/ignition/gui/SearchModel.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,82 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ -#ifndef IGNITION_GUI_SEARCHMODEL_HH_ -#define IGNITION_GUI_SEARCHMODEL_HH_ + */ -#include "ignition/gui/Export.hh" -#include "ignition/gui/qt.h" - -namespace ignition -{ -namespace gui -{ - /// \brief Customize the proxy model to display search results. - /// - /// Features: - /// - /// * This has been tested with QTreeView and QTableView. - /// * Manages expansion of nested items through DataRole::TO_EXPAND when - /// applicable - /// * Items with DataRole::TYPE == "title" are ignored - /// - class IGNITION_GUI_VISIBLE SearchModel : public QSortFilterProxyModel - { - /// \brief Overloaded Qt method. Customize so we accept rows where: - /// 1. Each of the words can be found in its ancestors or itself, but not - /// necessarily all words on the same row, or - /// 2. One of its descendants matches rule 1, or - /// 3. One of its ancestors matches rule 1. - /// - /// For example this structure: - /// - a - /// -- b - /// -- c - /// --- d - /// - /// * A search of "a" will display all rows. - /// * A search of "b" or "a b" will display "a" and "b". - /// * A search of "c", "d", "a c", "a d", "a c d" or "c d" will display - /// "a", "c" and "d". - /// * A search of "a b c d", "b c" or "b d" will display nothing. - /// - /// \param[in] _srcRow Row on the source model. - /// \param[in] _srcParent Parent on the source model. - /// \return True if row is accepted. - public: bool filterAcceptsRow(const int _srcRow, - const QModelIndex &_srcParent) const; - - /// \brief Check if row contains the word on itself. - /// \param[in] _srcRow Row on the source model. - /// \param[in] _srcParent Parent on the source model. - /// \param[in] _word Word to be checked. - /// \return True if row matches. - public: bool FilterAcceptsRowItself(const int _srcRow, - const QModelIndex &_srcParent, - const QString &_word) const; - - /// \brief Check if any of the children is fully accepted. - /// \param[in] _srcRow Row on the source model. - /// \param[in] _srcParent Parent on the source model. - /// \return True if any of the children match. - public: bool HasAcceptedChildren(const int _srcRow, - const QModelIndex &_srcParent) const; - - /// \brief Check if any of the children accepts a specific word. - /// \param[in] _srcParent Parent on the source model. - /// \param[in] _word Word to be checked. - /// \return True if any of the children match. - public: bool HasChildAcceptsItself(const QModelIndex &_srcParent, - const QString &_word) const; - - /// \brief Set a new search value. - /// \param[in] _search Full search string. - public: void SetSearch(const QString &_search); - - /// \brief Full search string. - public: QString search; - }; -} -} -#endif +#include +#include diff --git a/include/ignition/gui/config.hh b/include/ignition/gui/config.hh new file mode 100644 index 000000000..bcaae7f88 --- /dev/null +++ b/include/ignition/gui/config.hh @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef IGNITION_GUI__CONFIG_HH_ +#define IGNITION_GUI__CONFIG_HH_ + +#include + +/* Version number */ +// #define IGNITION_GUI_MAJOR_VERSION GZ_GUI_MAJOR_VERSION +// #define IGNITION_GUI_MINOR_VERSION GZ_GUI_MINOR_VERSION +// #define IGNITION_GUI_PATCH_VERSION GZ_GUI_PATCH_VERSION + +// #define IGNITION_GUI_VERSION GZ_GUI_VERSION +// #define IGNITION_GUI_VERSION_FULL GZ_GUI_VERSION_FULL + +// #define IGNITION_GUI_VERSION_HEADER GZ_GUI_VERSION_HEADER + +/* #undef BUILD_TYPE_PROFILE */ +/* #undef BUILD_TYPE_DEBUG */ +/* #undef BUILD_TYPE_RELEASE */ + +// #define IGN_GUI_PLUGIN_INSTALL_DIR GZ_GUI_PLUGIN_INSTALL_DIR + +#endif diff --git a/include/ignition/gui/gz.hh b/include/ignition/gui/gz.hh new file mode 100644 index 000000000..52c6f06ef --- /dev/null +++ b/include/ignition/gui/gz.hh @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include diff --git a/include/ignition/gui/ign.hh b/include/ignition/gui/ign.hh index f5541359c..52c6f06ef 100644 --- a/include/ignition/gui/ign.hh +++ b/include/ignition/gui/ign.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,33 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ + */ -#ifndef IGNITION_GUI_IGN_HH_ -#define IGNITION_GUI_IGN_HH_ - -#include "ignition/gui/Export.hh" - -/// \brief External hook to read the library version. -/// \return C-string representing the version. Ex.: 0.1.2 -extern "C" IGNITION_GUI_VISIBLE char *ignitionVersion(); - -/// \brief External hook to execute 'ign gui -l' from the command line. -extern "C" IGNITION_GUI_VISIBLE void cmdPluginList(); - -/// \brief External hook to execute 'ign gui -s' from the command line. -/// \param[in] _filename Name of a plugin file. -extern "C" IGNITION_GUI_VISIBLE void cmdStandalone(const char *_filename); - -/// \brief External hook to execute 'ign gui -c' from the command line. -/// \param[in] _config Path to a config file. -extern "C" IGNITION_GUI_VISIBLE void cmdConfig(const char *_config); - -/// \brief External hook to execute 'ign gui' from the command line. -extern "C" IGNITION_GUI_VISIBLE void cmdEmptyWindow(); - -/// \brief External hook when executing 'ign gui -t' from the command line. -/// \param[in] _filename Path to a QSS file. -extern "C" IGNITION_GUI_VISIBLE void cmdSetStyleFromFile(const char *_filename); - -#endif +#include +#include diff --git a/include/ignition/gui/ign_auto_headers.hh.in b/include/ignition/gui/ign_auto_headers.hh.in deleted file mode 100644 index a92282ee3..000000000 --- a/include/ignition/gui/ign_auto_headers.hh.in +++ /dev/null @@ -1,3 +0,0 @@ -// Automatically generated -#include -${ign_headers} diff --git a/include/ignition/gui/qt.h b/include/ignition/gui/qt.h index 0f8a83abe..bc538a3e2 100644 --- a/include/ignition/gui/qt.h +++ b/include/ignition/gui/qt.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Open Source Robotics Foundation + * Copyright (C) 2022 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,33 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * -*/ + */ -#ifndef IGNITION_GUI_QT_H_ -#define IGNITION_GUI_QT_H_ - -#ifndef _MSC_VER -#pragma GCC system_header -#endif - -#include - -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - -#endif // IGNITION_GUI_QT_H_ +#include +#include diff --git a/src/Application.cc b/src/Application.cc index 9928224f6..39ec03f02 100644 --- a/src/Application.cc +++ b/src/Application.cc @@ -18,23 +18,23 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/config.hh" -#include "ignition/gui/Dialog.hh" -#include "ignition/gui/Helpers.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/config.hh" +#include "gz/gui/Dialog.hh" +#include "gz/gui/Helpers.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" -#include "ignition/transport/TopicUtils.hh" +#include "gz/transport/TopicUtils.hh" namespace ignition { @@ -82,7 +82,7 @@ namespace ignition } } -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// @@ -91,9 +91,9 @@ Application::Application(int &_argc, char **_argv, const WindowType _type) { igndbg << "Initializing application." << std::endl; - this->setOrganizationName("Ignition"); - this->setOrganizationDomain("ignitionrobotics.org"); - this->setApplicationName("Ignition GUI"); + this->setOrganizationName("Gazebo"); + this->setOrganizationDomain("gazebosim.org"); + this->setApplicationName("Gazebo GUI"); // Configure console common::Console::SetPrefix("[GUI] "); diff --git a/src/Application_TEST.cc b/src/Application_TEST.cc index 1e234e591..fbbbbf7b7 100644 --- a/src/Application_TEST.cc +++ b/src/Application_TEST.cc @@ -17,14 +17,14 @@ #include #include -#include -#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Dialog.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Dialog.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" int g_argc = 1; char* g_argv[] = @@ -32,10 +32,10 @@ char* g_argv[] = reinterpret_cast(const_cast("./Application_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 ////////////////////////////////////////////////// TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Constructor)) { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6d92b8912..960a27f44 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,7 +6,7 @@ set (sources ${CMAKE_CURRENT_SOURCE_DIR}/Dialog.cc ${CMAKE_CURRENT_SOURCE_DIR}/DragDropModel.cc ${CMAKE_CURRENT_SOURCE_DIR}/Helpers.cc - ${CMAKE_CURRENT_SOURCE_DIR}/ign.cc + ${CMAKE_CURRENT_SOURCE_DIR}/gz.cc ${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.cc ${CMAKE_CURRENT_SOURCE_DIR}/Plugin.cc ${CMAKE_CURRENT_SOURCE_DIR}/SearchModel.cc @@ -20,7 +20,7 @@ set (gtest_sources DragDropModel_TEST Helpers_TEST GuiEvents_TEST - ign_TEST + gz_TEST MainWindow_TEST Plugin_TEST SearchModel_TEST @@ -38,7 +38,7 @@ endif() # this test currently fails on brew (issue #27) # so disable it for now if (NOT HAVE_IGN_TOOLS OR APPLE) - list(REMOVE_ITEM gtest_sources ign_TEST.cc) + list(REMOVE_ITEM gtest_sources gz_TEST.cc) endif() ign_build_tests(TYPE UNIT @@ -56,7 +56,7 @@ foreach(test ${gtest_targets}) "PROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\"") endforeach() -if(TARGET UNIT_ign_TEST) +if(TARGET UNIT_gz_TEST) # Running `ign gazebo` on macOS has problems when run with /usr/bin/ruby # due to System Integrity Protection (SIP). Try to find ruby from # homebrew as a workaround. @@ -64,16 +64,16 @@ if(TARGET UNIT_ign_TEST) find_program(BREW_RUBY ruby HINTS /usr/local/opt/ruby/bin) endif() - target_compile_definitions(UNIT_ign_TEST PRIVATE + target_compile_definitions(UNIT_gz_TEST PRIVATE "BREW_RUBY=\"${BREW_RUBY} \"") - target_compile_definitions(UNIT_ign_TEST PRIVATE + target_compile_definitions(UNIT_gz_TEST PRIVATE "IGN_PATH=\"${HAVE_IGN_TOOLS}\"") set(_env_vars) list(APPEND _env_vars "IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf") - set_tests_properties(UNIT_ign_TEST PROPERTIES + set_tests_properties(UNIT_gz_TEST PROPERTIES ENVIRONMENT "${_env_vars}") endif() diff --git a/src/Conversions.cc b/src/Conversions.cc index 77b1eee68..76569010a 100644 --- a/src/Conversions.cc +++ b/src/Conversions.cc @@ -15,13 +15,13 @@ * */ -#include -#include +#include +#include -#include "ignition/gui/Conversions.hh" +#include "gz/gui/Conversions.hh" ////////////////////////////////////////////////// -QColor ignition::gui::convert(const ignition::math::Color &_color) +QColor gz::gui::convert(const gz::math::Color &_color) { return QColor(_color.R()*255.0, _color.G()*255.0, @@ -30,40 +30,40 @@ QColor ignition::gui::convert(const ignition::math::Color &_color) } ////////////////////////////////////////////////// -ignition::math::Color ignition::gui::convert(const QColor &_color) +gz::math::Color gz::gui::convert(const QColor &_color) { - return ignition::math::Color(_color.red() / 255.0, + return gz::math::Color(_color.red() / 255.0, _color.green() / 255.0, _color.blue() / 255.0, _color.alpha() / 255.0); } ////////////////////////////////////////////////// -QPointF ignition::gui::convert(const ignition::math::Vector2d &_pt) +QPointF gz::gui::convert(const gz::math::Vector2d &_pt) { return QPointF(_pt.X(), _pt.Y()); } ////////////////////////////////////////////////// -ignition::math::Vector2d ignition::gui::convert(const QPointF &_pt) +gz::math::Vector2d gz::gui::convert(const QPointF &_pt) { - return ignition::math::Vector2d(_pt.x(), _pt.y()); + return gz::math::Vector2d(_pt.x(), _pt.y()); } ////////////////////////////////////////////////// -QVector3D ignition::gui::convert(const ignition::math::Vector3d &_vec) +QVector3D gz::gui::convert(const gz::math::Vector3d &_vec) { return QVector3D(_vec.X(), _vec.Y(), _vec.Z()); } ////////////////////////////////////////////////// -ignition::math::Vector3d ignition::gui::convert(const QVector3D &_vec) +gz::math::Vector3d gz::gui::convert(const QVector3D &_vec) { - return ignition::math::Vector3d(_vec.x(), _vec.y(), _vec.z()); + return gz::math::Vector3d(_vec.x(), _vec.y(), _vec.z()); } ////////////////////////////////////////////////// -ignition::common::MouseEvent ignition::gui::convert(const QMouseEvent &_e) +gz::common::MouseEvent gz::gui::convert(const QMouseEvent &_e) { common::MouseEvent event; event.SetPos(_e.pos().x(), _e.pos().y()); @@ -114,16 +114,16 @@ ignition::common::MouseEvent ignition::gui::convert(const QMouseEvent &_e) } ///////////////////////////////////////////////// -ignition::common::Time ignition::gui::convert(const ignition::msgs::Time &_t) +gz::common::Time gz::gui::convert(const gz::msgs::Time &_t) { - ignition::common::Time result(_t.sec(), _t.nsec()); + gz::common::Time result(_t.sec(), _t.nsec()); return result; } ///////////////////////////////////////////////// -ignition::msgs::Time ignition::gui::convert(const ignition::common::Time &_t) +gz::msgs::Time gz::gui::convert(const gz::common::Time &_t) { - ignition::msgs::Time result; + gz::msgs::Time result; result.set_sec(_t.sec); result.set_nsec(_t.nsec); return result; diff --git a/src/Conversions_TEST.cc b/src/Conversions_TEST.cc index 7ab42ba39..168ec794f 100644 --- a/src/Conversions_TEST.cc +++ b/src/Conversions_TEST.cc @@ -17,20 +17,20 @@ #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Conversions.hh" +#include "gz/gui/Conversions.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// TEST(ConversionsTest, Color) { - // Ignition to Qt to Ignition + // Gazebo to Qt to Gazebo { double red = 0.1; double green = 0.3; @@ -48,7 +48,7 @@ TEST(ConversionsTest, Color) EXPECT_NEAR(newColor.A(), newColor.A(), tol); } - // Qt to Ignition to Qt + // Qt to Gazebo to Qt { int red = 100; int green = 150; @@ -66,13 +66,13 @@ TEST(ConversionsTest, Point2d) double x = -0.5; double y = 123; - // Ignition to Qt to Ignition + // Gazebo to Qt to Gazebo { math::Vector2d point(x, y); EXPECT_EQ(convert(convert(point)), point); } - // Qt to Ignition to Qt + // Qt to Gazebo to Qt { QPointF point(x, y); EXPECT_EQ(convert(convert(point)), point); @@ -86,13 +86,13 @@ TEST(ConversionsTest, Vector3d) double y = 0; double z = 1234; - // Ignition to Qt to Ignition + // Gazebo to Qt to Gazebo { math::Vector3d vec(x, y, z); EXPECT_EQ(convert(convert(vec)), vec); } - // Qt to Ignition to Qt + // Qt to Gazebo to Qt { QVector3D vec(x, y, z); EXPECT_EQ(convert(convert(vec)), vec); diff --git a/src/Dialog.cc b/src/Dialog.cc index 3b8da900e..c8b4b3455 100644 --- a/src/Dialog.cc +++ b/src/Dialog.cc @@ -17,9 +17,9 @@ #include -#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/Dialog.hh" +#include +#include "gz/gui/Application.hh" +#include "gz/gui/Dialog.hh" namespace ignition { @@ -33,7 +33,7 @@ namespace ignition } } -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/Dialog_TEST.cc b/src/Dialog_TEST.cc index 33a3e7fb8..e502a78ca 100644 --- a/src/Dialog_TEST.cc +++ b/src/Dialog_TEST.cc @@ -17,21 +17,21 @@ #include -#include -#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Dialog.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Dialog.hh" -std::string kTestConfigFile = "/tmp/ign-gui-test.config"; // NOLINT(*) +std::string kTestConfigFile = "/tmp/gz-gui-test.config"; // NOLINT(*) int g_argc = 1; char* g_argv[] = { reinterpret_cast(const_cast("./Dialog_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/DragDropModel.cc b/src/DragDropModel.cc index 5e1708c25..73a645c0d 100644 --- a/src/DragDropModel.cc +++ b/src/DragDropModel.cc @@ -15,10 +15,10 @@ * */ -#include "ignition/gui/Enums.hh" -#include "ignition/gui/DragDropModel.hh" +#include "gz/gui/Enums.hh" +#include "gz/gui/DragDropModel.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/DragDropModel_TEST.cc b/src/DragDropModel_TEST.cc index d5fbb45ee..2ff05e331 100644 --- a/src/DragDropModel_TEST.cc +++ b/src/DragDropModel_TEST.cc @@ -17,14 +17,14 @@ #include -#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Enums.hh" -#include "ignition/gui/DragDropModel.hh" +#include "gz/gui/Enums.hh" +#include "gz/gui/DragDropModel.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/GuiEvents_TEST.cc b/src/GuiEvents_TEST.cc index 72c4ee740..a0563954f 100644 --- a/src/GuiEvents_TEST.cc +++ b/src/GuiEvents_TEST.cc @@ -18,9 +18,9 @@ #include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/GuiEvents.hh" +#include "gz/gui/GuiEvents.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/Helpers.cc b/src/Helpers.cc index 0fc89d7cc..a413bdc47 100644 --- a/src/Helpers.cc +++ b/src/Helpers.cc @@ -18,15 +18,15 @@ #include #include #include -#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/Enums.hh" -#include "ignition/gui/Helpers.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Enums.hh" +#include "gz/gui/Helpers.hh" +#include "gz/gui/MainWindow.hh" ///////////////////////////////////////////////// -std::string ignition::gui::humanReadable(const std::string &_key) +std::string gz::gui::humanReadable(const std::string &_key) { std::string humanKey = _key; humanKey[0] = toupper(humanKey[0]); @@ -35,7 +35,7 @@ std::string ignition::gui::humanReadable(const std::string &_key) } ///////////////////////////////////////////////// -std::string ignition::gui::unitFromKey(const std::string &_key, +std::string gz::gui::unitFromKey(const std::string &_key, const std::string &_type) { if (_key == "pos" || _key == "length" || _key == "min_depth") @@ -110,7 +110,7 @@ std::string ignition::gui::unitFromKey(const std::string &_key, } ///////////////////////////////////////////////// -void ignition::gui::rangeFromKey(const std::string &_key, double &_min, +void gz::gui::rangeFromKey(const std::string &_key, double &_min, double &_max) { // Maximum range by default @@ -139,19 +139,19 @@ void ignition::gui::rangeFromKey(const std::string &_key, double &_min, } ///////////////////////////////////////////////// -ignition::gui::StringType ignition::gui::stringTypeFromKey( +gz::gui::StringType gz::gui::stringTypeFromKey( const std::string &_key) { if (_key == "innerxml") { - return ignition::gui::StringType::PLAIN_TEXT; + return gz::gui::StringType::PLAIN_TEXT; } return StringType::LINE; } ///////////////////////////////////////////////// -std::string ignition::gui::uniqueFilePath(const std::string &_pathAndName, +std::string gz::gui::uniqueFilePath(const std::string &_pathAndName, const std::string &_extension) { std::string result = _pathAndName + "." + _extension; @@ -168,7 +168,7 @@ std::string ignition::gui::uniqueFilePath(const std::string &_pathAndName, } ///////////////////////////////////////////////// -QStringList ignition::gui::worldNames() +QStringList gz::gui::worldNames() { auto win = App()->findChild(); if (nullptr == win) @@ -182,7 +182,7 @@ QStringList ignition::gui::worldNames() } ///////////////////////////////////////////////// -const QString ignition::gui::qmlQrcImportPath() +const QString gz::gui::qmlQrcImportPath() { return "qrc:/ign-gui-qml/"; } diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index e0fc28ab4..931dafb8b 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -18,18 +18,18 @@ #include #include -#include -#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Helpers.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Helpers.hh" int gg_argc = 1; char **gg_argv = new char *[gg_argc]; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// @@ -119,7 +119,7 @@ TEST(HelpersTest, stringTypeFromKey) } ///////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(HelpersTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(findFirstByProperty)) { Application app(gg_argc, gg_argv); @@ -146,7 +146,7 @@ TEST(HelpersTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(findFirstByProperty)) } ///////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(HelpersTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(worldNames)) { // No app, no window, no names diff --git a/src/MainWindow.cc b/src/MainWindow.cc index e4015dd32..555cd5944 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -19,15 +19,15 @@ #include #include -#include -#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/qt.h" -#include "ignition/msgs/boolean.pb.h" -#include "ignition/msgs/server_control.pb.h" -#include "ignition/transport/Node.hh" +#include +#include +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/qt.h" +#include "gz/msgs/boolean.pb.h" +#include "gz/msgs/server_control.pb.h" +#include "gz/transport/Node.hh" namespace ignition { @@ -76,12 +76,12 @@ namespace ignition public: std::string controlService{"/server_control"}; /// \brief Communication node - public: ignition::transport::Node node; + public: gz::transport::Node node; }; } } -using namespace ignition; +using namespace gz; using namespace gui; /// \brief Strip last component from a path. diff --git a/src/MainWindow_TEST.cc b/src/MainWindow_TEST.cc index 2b7c27fe2..182d921a9 100644 --- a/src/MainWindow_TEST.cc +++ b/src/MainWindow_TEST.cc @@ -21,30 +21,30 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" -std::string kTestConfigFile = "/tmp/ign-gui-test.config"; // NOLINT(*) +std::string kTestConfigFile = "/tmp/gz-gui-test.config"; // NOLINT(*) int g_argc = 1; char* g_argv[] = { reinterpret_cast(const_cast("./MainWindow_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; using namespace std::chrono_literals; ///////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(MainWindowTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Constructor)) { common::Console::SetVerbosity(4); diff --git a/src/Plugin.cc b/src/Plugin.cc index d95c87229..be704f6e9 100644 --- a/src/Plugin.cc +++ b/src/Plugin.cc @@ -17,11 +17,11 @@ #include -#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/Helpers.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include +#include "gz/gui/Application.hh" +#include "gz/gui/Helpers.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" /// \brief Used to store information about anchors set by the user. struct Anchors @@ -51,7 +51,7 @@ static const std::unordered_set kIgnoredProps{ "pluginName", "anchored"}; -class ignition::gui::PluginPrivate +class gz::gui::PluginPrivate { /// \brief Set this to true if the plugin should be deleted as soon as it has /// a parent. @@ -80,7 +80,7 @@ class ignition::gui::PluginPrivate public: Anchors anchors; }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/Plugin_TEST.cc b/src/Plugin_TEST.cc index 93f6960eb..87a4d3412 100644 --- a/src/Plugin_TEST.cc +++ b/src/Plugin_TEST.cc @@ -18,13 +18,13 @@ #include #include -#include -#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" int g_argc = 1; char* g_argv[] = @@ -32,10 +32,10 @@ char* g_argv[] = reinterpret_cast(const_cast("./Plugin_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(DeleteLater)) { common::Console::SetVerbosity(4); diff --git a/src/SearchModel.cc b/src/SearchModel.cc index 720eee80c..3ccf2bbe3 100644 --- a/src/SearchModel.cc +++ b/src/SearchModel.cc @@ -15,12 +15,12 @@ * */ -#include +#include -#include "ignition/gui/Enums.hh" -#include "ignition/gui/SearchModel.hh" +#include "gz/gui/Enums.hh" +#include "gz/gui/SearchModel.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/SearchModel_TEST.cc b/src/SearchModel_TEST.cc index da1061e73..1b3a0f8f6 100644 --- a/src/SearchModel_TEST.cc +++ b/src/SearchModel_TEST.cc @@ -17,14 +17,14 @@ #include -#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Enums.hh" -#include "ignition/gui/SearchModel.hh" +#include "gz/gui/Enums.hh" +#include "gz/gui/SearchModel.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/cmd/cmdgui.rb.in b/src/cmd/cmdgui.rb.in index ddc84f728..9350e29ef 100644 --- a/src/cmd/cmdgui.rb.in +++ b/src/cmd/cmdgui.rb.in @@ -37,7 +37,7 @@ COMMON_OPTIONS = " \n" + ' --versions Show the available versions.' COMMANDS = { 'gui' => - "Ignition GUI tool.\n\n" + + "Gazebo GUI tool.\n\n" + " ign gui [options]\n\n" + "Options:\n\n" + " -l [ --list ] List all available plugins.\n" + @@ -59,7 +59,7 @@ COMMANDS = { 'gui' => } # -# Class for the Ignition gui command line tools. +# Class for the Gazebo gui command line tools. # class Cmd # diff --git a/src/ign.cc b/src/gz.cc similarity index 75% rename from src/ign.cc rename to src/gz.cc index faba5dcc3..b077c597e 100644 --- a/src/ign.cc +++ b/src/gz.cc @@ -19,13 +19,13 @@ #include -#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/config.hh" -#include "ignition/gui/Export.hh" -#include "ignition/gui/ign.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/config.hh" +#include "gz/gui/Export.hh" +#include "gz/gui/gz.hh" +#include "gz/gui/MainWindow.hh" int g_argc = 1; char* g_argv[] = @@ -37,11 +37,11 @@ char* g_argv[] = void startConsoleLog() { std::string home; - ignition::common::env(IGN_HOMEDIR, home); + gz::common::env(IGN_HOMEDIR, home); - std::string logPathMod = ignition::common::joinPaths(home, + std::string logPathMod = gz::common::joinPaths(home, ".ignition", "gui", "log", - ignition::common::timeToIso(IGN_SYSTEM_TIME())); + gz::common::timeToIso(IGN_SYSTEM_TIME())); ignLogInit(logPathMod, "console.log"); } @@ -56,7 +56,7 @@ extern "C" IGNITION_GUI_VISIBLE void cmdPluginList() { startConsoleLog(); - ignition::gui::Application app(g_argc, g_argv); + gz::gui::Application app(g_argc, g_argv); auto pluginsList = app.PluginList(); for (auto const &path : pluginsList) @@ -81,8 +81,8 @@ extern "C" IGNITION_GUI_VISIBLE void cmdStandalone(const char *_filename) { startConsoleLog(); - ignition::gui::Application app(g_argc, g_argv, - ignition::gui::WindowType::kDialog); + gz::gui::Application app(g_argc, g_argv, + gz::gui::WindowType::kDialog); if (!app.LoadPlugin(_filename)) { @@ -97,9 +97,9 @@ extern "C" IGNITION_GUI_VISIBLE void cmdConfig(const char *_config) { startConsoleLog(); - ignition::gui::Application app(g_argc, g_argv); + gz::gui::Application app(g_argc, g_argv); - if (!app.findChild()) + if (!app.findChild()) { return; } @@ -115,7 +115,7 @@ extern "C" IGNITION_GUI_VISIBLE void cmdConfig(const char *_config) ////////////////////////////////////////////////// extern "C" IGNITION_GUI_VISIBLE void cmdVerbose(const char *_verbosity) { - ignition::common::Console::SetVerbosity(std::atoi(_verbosity)); + gz::common::Console::SetVerbosity(std::atoi(_verbosity)); } ////////////////////////////////////////////////// @@ -123,9 +123,9 @@ extern "C" IGNITION_GUI_VISIBLE void cmdEmptyWindow() { startConsoleLog(); - ignition::gui::Application app(g_argc, g_argv); + gz::gui::Application app(g_argc, g_argv); - if (!app.findChild()) + if (!app.findChild()) { return; } @@ -139,5 +139,5 @@ extern "C" IGNITION_GUI_VISIBLE void cmdEmptyWindow() extern "C" IGNITION_GUI_VISIBLE void cmdSetStyleFromFile( const char * /*_filename*/) { -// ignition::gui::setStyleFromFile(std::string(_filename)); +// gz::gui::setStyleFromFile(std::string(_filename)); } diff --git a/src/ign_TEST.cc b/src/gz_TEST.cc similarity index 94% rename from src/ign_TEST.cc rename to src/gz_TEST.cc index f1e03ee82..ecf3ef653 100644 --- a/src/ign_TEST.cc +++ b/src/gz_TEST.cc @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) @@ -58,7 +58,7 @@ std::string custom_exec_str(std::string _cmd) return result; } -using namespace ignition; +using namespace gz; class CmdLine : public ::testing::Test { @@ -85,7 +85,7 @@ class CmdLine : public ::testing::Test public: std::string realHome; }; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST_F(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(list)) { // Clear home if it exists diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 8084b7a56..8ce646463 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -4,7 +4,7 @@ # [PUBLIC_LINK_LIBS ] # [PRIVATE_LINK_LIBS ]) # -# Add a plugin library to Ignition GUI. +# Add a plugin library to Gazebo GUI. # # Required. Name of the library # @@ -47,7 +47,7 @@ endfunction() # [PUBLIC_LINK_LIBS ] # [PRIVATE_LINK_LIBS ]) # -# Add a plugin to Ignition GUI. +# Add a plugin to Gazebo GUI. # # Required. Name of the plugin. # diff --git a/src/plugins/grid_3d/Grid3D.cc b/src/plugins/grid_3d/Grid3D.cc index f8e7127fd..37cbe64ed 100644 --- a/src/plugins/grid_3d/Grid3D.cc +++ b/src/plugins/grid_3d/Grid3D.cc @@ -18,17 +18,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Grid3D.hh" @@ -89,7 +89,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/grid_3d/Grid3D.hh b/src/plugins/grid_3d/Grid3D.hh index 1d26a3740..ffc1f207c 100644 --- a/src/plugins/grid_3d/Grid3D.hh +++ b/src/plugins/grid_3d/Grid3D.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_GRID3D_HH_ -#define IGNITION_GUI_PLUGINS_GRID3D_HH_ +#ifndef GZ_GUI_PLUGINS_GRID3D_HH_ +#define GZ_GUI_PLUGINS_GRID3D_HH_ #include -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Plugin.hh" namespace ignition { @@ -33,7 +33,7 @@ namespace plugins // TODO(chapulina) Delete this plugin when forward porting to `ign-gui6` in // favor of `GridConfig` - /// \brief Manages grids in an Ignition Rendering scene. This plugin can be + /// \brief Manages grids in an Gazebo Rendering scene. This plugin can be /// used for: /// * Introspecting grids /// * Editing grids diff --git a/src/plugins/grid_3d/Grid3D_TEST.cc b/src/plugins/grid_3d/Grid3D_TEST.cc index 4b816a120..4e7931dfd 100644 --- a/src/plugins/grid_3d/Grid3D_TEST.cc +++ b/src/plugins/grid_3d/Grid3D_TEST.cc @@ -16,20 +16,20 @@ */ #include -#include -#include - -#include "ignition/gui/CollapsibleWidget.hh" -#include "ignition/gui/ColorWidget.hh" -#include "ignition/gui/Helpers.hh" -#include "ignition/gui/Iface.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/NumberWidget.hh" -#include "ignition/gui/Pose3dWidget.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/QtMetatypes.hh" - -using namespace ignition; +#include +#include + +#include "gz/gui/CollapsibleWidget.hh" +#include "gz/gui/ColorWidget.hh" +#include "gz/gui/Helpers.hh" +#include "gz/gui/Iface.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/NumberWidget.hh" +#include "gz/gui/Pose3dWidget.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/QtMetatypes.hh" + +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/plugins/image_display/ImageDisplay.cc b/src/plugins/image_display/ImageDisplay.cc index 2959d66ef..01378901c 100644 --- a/src/plugins/image_display/ImageDisplay.cc +++ b/src/plugins/image_display/ImageDisplay.cc @@ -22,13 +22,13 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" namespace ignition { @@ -57,7 +57,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/image_display/ImageDisplay.hh b/src/plugins/image_display/ImageDisplay.hh index 8aaf62a70..2d4e17298 100644 --- a/src/plugins/image_display/ImageDisplay.hh +++ b/src/plugins/image_display/ImageDisplay.hh @@ -15,8 +15,8 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_IMAGEDISPLAY_HH_ -#define IGNITION_GUI_PLUGINS_IMAGEDISPLAY_HH_ +#ifndef GZ_GUI_PLUGINS_IMAGEDISPLAY_HH_ +#define GZ_GUI_PLUGINS_IMAGEDISPLAY_HH_ #include #include @@ -25,7 +25,7 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif @@ -40,7 +40,7 @@ # endif #endif -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Plugin.hh" namespace ignition { @@ -81,7 +81,7 @@ namespace plugins private: QImage img; }; - /// \brief Display images coming through an Ignition transport topic. + /// \brief Display images coming through an Gazebo transport topic. /// /// ## Configuration /// @@ -145,7 +145,7 @@ namespace plugins /// \brief Subscriber callback when new image is received /// \param[in] _msg New image - private: void OnImageMsg(const ignition::msgs::Image &_msg); + private: void OnImageMsg(const gz::msgs::Image &_msg); /// \internal /// \brief Pointer to private data. diff --git a/src/plugins/image_display/ImageDisplay.qml b/src/plugins/image_display/ImageDisplay.qml index b11021a74..ccd18a8e5 100644 --- a/src/plugins/image_display/ImageDisplay.qml +++ b/src/plugins/image_display/ImageDisplay.qml @@ -85,7 +85,7 @@ Rectangle { ToolTip.visible: hovered ToolTip.delay: tooltipDelay ToolTip.timeout: tooltipTimeout - ToolTip.text: qsTr("Ignition transport topics publishing Image messages") + ToolTip.text: qsTr("Gazebo transport topics publishing Image messages") } } Image { diff --git a/src/plugins/image_display/ImageDisplay_TEST.cc b/src/plugins/image_display/ImageDisplay_TEST.cc index bbd7fd3bc..4c3a7bc2d 100644 --- a/src/plugins/image_display/ImageDisplay_TEST.cc +++ b/src/plugins/image_display/ImageDisplay_TEST.cc @@ -20,19 +20,19 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif -#include -#include -#include -#include +#include +#include +#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" #include "test_config.h" // NOLINT(build/include) #include "ImageDisplay.hh" @@ -42,7 +42,7 @@ char* g_argv[] = reinterpret_cast(const_cast("./ImageDisplay_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/plugins/key_publisher/KeyPublisher.cc b/src/plugins/key_publisher/KeyPublisher.cc index 7fe9fc4e5..36b54a91a 100644 --- a/src/plugins/key_publisher/KeyPublisher.cc +++ b/src/plugins/key_publisher/KeyPublisher.cc @@ -18,16 +18,16 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif #include -#include -#include -#include +#include +#include +#include #include "KeyPublisher.hh" @@ -38,10 +38,10 @@ namespace gui class KeyPublisherPrivate { /// \brief Node for communication - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief Publisher - public: ignition::transport::Node::Publisher pub; + public: gz::transport::Node::Publisher pub; /// \brief Topic public: std::string topic = "keyboard/keypress"; @@ -50,7 +50,7 @@ namespace gui /// \param[in] key_press Pointer to the keyevent public: void KeyPub(QKeyEvent *_keyPress) { - ignition::msgs::Int32 Msg; + gz::msgs::Int32 Msg; Msg.set_data(_keyPress->key()); pub.Publish(Msg); } @@ -58,7 +58,7 @@ namespace gui } } -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/plugins/key_publisher/KeyPublisher.hh b/src/plugins/key_publisher/KeyPublisher.hh index f375feaf4..b4417489a 100644 --- a/src/plugins/key_publisher/KeyPublisher.hh +++ b/src/plugins/key_publisher/KeyPublisher.hh @@ -15,8 +15,8 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_KEYPUBLISHER_HH_ -#define IGNITION_GUI_PLUGINS_KEYPUBLISHER_HH_ +#ifndef GZ_GUI_PLUGINS_KEYPUBLISHER_HH_ +#define GZ_GUI_PLUGINS_KEYPUBLISHER_HH_ #ifndef _WIN32 # define KeyPublisher_EXPORTS_API @@ -28,12 +28,12 @@ # endif #endif -#include +#include #include -#include -#include +#include +#include namespace ignition { @@ -45,7 +45,7 @@ namespace gui /// /// ## Configuration /// This plugin doesn't accept any custom configuration. - class KeyPublisher_EXPORTS_API KeyPublisher : public ignition::gui::Plugin + class KeyPublisher_EXPORTS_API KeyPublisher : public gz::gui::Plugin { Q_OBJECT diff --git a/src/plugins/publisher/Publisher.cc b/src/plugins/publisher/Publisher.cc index 4a6519af3..61184f8de 100644 --- a/src/plugins/publisher/Publisher.cc +++ b/src/plugins/publisher/Publisher.cc @@ -23,9 +23,9 @@ #ifdef _MSC_VER #pragma warning(pop) #endif -#include -#include -#include +#include +#include +#include #include "Publisher.hh" @@ -53,16 +53,16 @@ namespace plugins public: QTimer *timer; /// \brief Node for communication - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief Publisher - public: ignition::transport::Node::Publisher pub; + public: gz::transport::Node::Publisher pub; }; } } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/publisher/Publisher.hh b/src/plugins/publisher/Publisher.hh index f5ec11cdc..e48833921 100644 --- a/src/plugins/publisher/Publisher.hh +++ b/src/plugins/publisher/Publisher.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_PUBLISHER_HH_ -#define IGNITION_GUI_PLUGINS_PUBLISHER_HH_ +#ifndef GZ_GUI_PLUGINS_PUBLISHER_HH_ +#define GZ_GUI_PLUGINS_PUBLISHER_HH_ #include -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Plugin.hh" #ifndef _WIN32 # define Publisher_EXPORTS_API @@ -40,7 +40,7 @@ namespace plugins { class PublisherPrivate; - /// \brief Widget which publishes a custom Ignition transport message. + /// \brief Widget which publishes a custom Gazebo transport message. /// /// ## Configuration /// This plugin doesn't accept any custom configuration. diff --git a/src/plugins/publisher/Publisher_TEST.cc b/src/plugins/publisher/Publisher_TEST.cc index a7ecde9ec..8a7892030 100644 --- a/src/plugins/publisher/Publisher_TEST.cc +++ b/src/plugins/publisher/Publisher_TEST.cc @@ -19,17 +19,17 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif -#include -#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" #include "Publisher.hh" @@ -39,11 +39,11 @@ char* g_argv[] = reinterpret_cast(const_cast("./Publisher_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(PublisherTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Load)) { common::Console::SetVerbosity(4); diff --git a/src/plugins/scene3d/Scene3D.cc b/src/plugins/scene3d/Scene3D.cc index af9572d67..4cc30e7e9 100644 --- a/src/plugins/scene3d/Scene3D.cc +++ b/src/plugins/scene3d/Scene3D.cc @@ -24,14 +24,14 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include +#include +#include // TODO(louise) Remove these pragmas once ign-rendering and ign-msgs // are disabling the warnings @@ -40,23 +40,23 @@ #endif #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif -#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/Conversions.hh" -#include "ignition/gui/GuiEvents.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Conversions.hh" +#include "gz/gui/GuiEvents.hh" +#include "gz/gui/MainWindow.hh" namespace ignition { @@ -199,7 +199,7 @@ namespace plugins /// \brief Transport node for making service request and subscribing to /// pose topic - private: ignition::transport::Node node; + private: gz::transport::Node node; }; /// \brief Private data class for IgnRenderer @@ -263,7 +263,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; @@ -1334,7 +1334,7 @@ void TextureNode::PrepareNode() newId, sz, QQuickWindow::TextureIsOpaque); #else // TODO(anyone) Use createTextureFromNativeObject - // https://github.com/ignitionrobotics/ign-gui/issues/113 + // https://github.com/gazebosim/gz-gui/issues/113 #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/src/plugins/scene3d/Scene3D.hh b/src/plugins/scene3d/Scene3D.hh index dae21ed3c..bee762f8a 100644 --- a/src/plugins/scene3d/Scene3D.hh +++ b/src/plugins/scene3d/Scene3D.hh @@ -15,22 +15,22 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_SCENE3D_HH_ -#define IGNITION_GUI_PLUGINS_SCENE3D_HH_ +#ifndef GZ_GUI_PLUGINS_SCENE3D_HH_ +#define GZ_GUI_PLUGINS_SCENE3D_HH_ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include -#include "ignition/gui/qt.h" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/qt.h" +#include "gz/gui/Plugin.hh" namespace ignition { @@ -46,7 +46,7 @@ namespace plugins /// It is possible to orbit the camera around the scene with /// the mouse. Use other plugins to manage objects in the scene. /// - /// Only one plugin displaying an Ignition Rendering scene can be used at a + /// Only one plugin displaying an Gazebo Rendering scene can be used at a /// time. /// /// ## Configuration @@ -329,7 +329,7 @@ namespace plugins /// \brief Called when the mouse hovers to a new position. /// \param[in] _hoverPos 2D coordinates of the hovered mouse position on /// the render window. - public: void OnHovered(const ignition::math::Vector2i &_hoverPos); + public: void OnHovered(const gz::math::Vector2i &_hoverPos); /// \brief Slot called when thread is ready to be started public Q_SLOTS: void Ready(); diff --git a/src/plugins/screenshot/Screenshot.cc b/src/plugins/screenshot/Screenshot.cc index e990f2b47..b50141a32 100644 --- a/src/plugins/screenshot/Screenshot.cc +++ b/src/plugins/screenshot/Screenshot.cc @@ -18,27 +18,27 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include -#include -#include -#include +#include +#include +#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif -#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/GuiEvents.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/GuiEvents.hh" +#include "gz/gui/MainWindow.hh" namespace ignition { @@ -49,7 +49,7 @@ namespace plugins class ScreenshotPrivate { /// \brief Node for communication - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief Screenshot service name public: std::string screenshotService; @@ -61,7 +61,7 @@ namespace plugins public: bool dirty{false}; /// \brief Pointer to the user camera. - public: ignition::rendering::CameraPtr userCamera{nullptr}; + public: gz::rendering::CameraPtr userCamera{nullptr}; /// \brief Saved screenshot filepath public: QString savedScreenshotPath = ""; @@ -70,7 +70,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/screenshot/Screenshot.hh b/src/plugins/screenshot/Screenshot.hh index cb56a383c..b76decaa5 100644 --- a/src/plugins/screenshot/Screenshot.hh +++ b/src/plugins/screenshot/Screenshot.hh @@ -14,22 +14,22 @@ * limitations under the License. * */ -#ifndef IGNITION_GUI_PLUGINS_SCREENSHOT_HH_ -#define IGNITION_GUI_PLUGINS_SCREENSHOT_HH_ +#ifndef GZ_GUI_PLUGINS_SCREENSHOT_HH_ +#define GZ_GUI_PLUGINS_SCREENSHOT_HH_ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include -#include +#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif #include -#include "ignition/gui/qt.h" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/qt.h" +#include "gz/gui/Plugin.hh" namespace ignition { diff --git a/src/plugins/screenshot/Screenshot_TEST.cc b/src/plugins/screenshot/Screenshot_TEST.cc index f78c0273f..3918a0803 100644 --- a/src/plugins/screenshot/Screenshot_TEST.cc +++ b/src/plugins/screenshot/Screenshot_TEST.cc @@ -17,9 +17,9 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include -#include -#include +#include +#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif @@ -27,16 +27,16 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/GuiEvents.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/GuiEvents.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" #include "Screenshot.hh" int g_argc = 1; @@ -45,7 +45,7 @@ char* g_argv[] = reinterpret_cast(const_cast("./Screenshot_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/plugins/shutdown_button/ShutdownButton.cc b/src/plugins/shutdown_button/ShutdownButton.cc index f8ab9ba3c..2b000928e 100644 --- a/src/plugins/shutdown_button/ShutdownButton.cc +++ b/src/plugins/shutdown_button/ShutdownButton.cc @@ -17,12 +17,12 @@ #include "ShutdownButton.hh" -#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/shutdown_button/ShutdownButton.hh b/src/plugins/shutdown_button/ShutdownButton.hh index f4489cb43..e54e56909 100644 --- a/src/plugins/shutdown_button/ShutdownButton.hh +++ b/src/plugins/shutdown_button/ShutdownButton.hh @@ -15,10 +15,10 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_SHUTDOWNBUTTON_HH_ -#define IGNITION_GUI_PLUGINS_SHUTDOWNBUTTON_HH_ +#ifndef GZ_GUI_PLUGINS_SHUTDOWNBUTTON_HH_ +#define GZ_GUI_PLUGINS_SHUTDOWNBUTTON_HH_ -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Plugin.hh" #ifndef _WIN32 # define ShutdownButton_EXPORTS_API @@ -37,7 +37,7 @@ namespace gui namespace plugins { /// \brief This plugin provides a shutdown button. - class ShutdownButton_EXPORTS_API ShutdownButton: public ignition::gui::Plugin + class ShutdownButton_EXPORTS_API ShutdownButton: public gz::gui::Plugin { Q_OBJECT diff --git a/src/plugins/shutdown_button/ShutdownButton_TEST.cc b/src/plugins/shutdown_button/ShutdownButton_TEST.cc index 07d6a7470..2e42a97dd 100644 --- a/src/plugins/shutdown_button/ShutdownButton_TEST.cc +++ b/src/plugins/shutdown_button/ShutdownButton_TEST.cc @@ -17,14 +17,14 @@ #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" #include "ShutdownButton.hh" int g_argc = 1; @@ -33,10 +33,10 @@ char* g_argv[] = reinterpret_cast(const_cast("./ShutdownButton_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 ///////////////////////////////////////////////// TEST(ShutdownButtonTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Load)) { diff --git a/src/plugins/teleop/Teleop.cc b/src/plugins/teleop/Teleop.cc index 34a6f35a0..210318ac8 100644 --- a/src/plugins/teleop/Teleop.cc +++ b/src/plugins/teleop/Teleop.cc @@ -19,7 +19,7 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif @@ -28,10 +28,10 @@ #include -#include +#include -#include -#include +#include +#include namespace ignition { @@ -60,13 +60,13 @@ namespace plugins class TeleopPrivate { /// \brief Node for communication. - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief Topic. Set '/cmd_vel' as default. public: std::string topic = "/cmd_vel"; /// \brief Publisher. - public: ignition::transport::Node::Publisher cmdVelPub; + public: gz::transport::Node::Publisher cmdVelPub; /// \brief Maximum forward velocity in m/s. GUI buttons and key presses /// will use this velocity. Sliders will scale up to this value. @@ -111,7 +111,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; @@ -157,7 +157,7 @@ void Teleop::OnTeleopTwist(double _forwardVel, double _verticalVel, if (!this->dataPtr->cmdVelPub.Publish(cmdVelMsg)) { - ignerr << "ignition::msgs::Twist message couldn't be published at topic: " + ignerr << "gz::msgs::Twist message couldn't be published at topic: " << this->dataPtr->topic << std::endl; } } diff --git a/src/plugins/teleop/Teleop.hh b/src/plugins/teleop/Teleop.hh index 1406f88d7..3144aa4c6 100644 --- a/src/plugins/teleop/Teleop.hh +++ b/src/plugins/teleop/Teleop.hh @@ -15,15 +15,15 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_TELEOP_HH_ -#define IGNITION_GUI_PLUGINS_TELEOP_HH_ +#ifndef GZ_GUI_PLUGINS_TELEOP_HH_ +#define GZ_GUI_PLUGINS_TELEOP_HH_ #include -#include +#include -#include -#include +#include +#include #ifndef _WIN32 # define Teleop_EXPORTS_API diff --git a/src/plugins/teleop/Teleop_TEST.cc b/src/plugins/teleop/Teleop_TEST.cc index c2ac9d6ad..0ea98e609 100644 --- a/src/plugins/teleop/Teleop_TEST.cc +++ b/src/plugins/teleop/Teleop_TEST.cc @@ -19,18 +19,18 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif -#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/qt.h" +#include "gz/gui/Application.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/qt.h" #include "Teleop.hh" @@ -40,7 +40,7 @@ char* g_argv[] = reinterpret_cast(const_cast("./Teleop_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; class TeleopTest : public ::testing::Test diff --git a/src/plugins/topic_echo/TopicEcho.cc b/src/plugins/topic_echo/TopicEcho.cc index 0bd374e7d..b531fed8e 100644 --- a/src/plugins/topic_echo/TopicEcho.cc +++ b/src/plugins/topic_echo/TopicEcho.cc @@ -16,11 +16,11 @@ */ #include -#include -#include -#include +#include +#include +#include -#include "ignition/gui/Application.hh" +#include "gz/gui/Application.hh" #include "TopicEcho.hh" namespace ignition @@ -48,13 +48,13 @@ namespace plugins public: std::mutex mutex; /// \brief Node for communication - public: ignition::transport::Node node; + public: gz::transport::Node node; }; } } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/topic_echo/TopicEcho.hh b/src/plugins/topic_echo/TopicEcho.hh index e9fd62252..d11582f97 100644 --- a/src/plugins/topic_echo/TopicEcho.hh +++ b/src/plugins/topic_echo/TopicEcho.hh @@ -15,8 +15,8 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_TOPICECHO_HH_ -#define IGNITION_GUI_PLUGINS_TOPICECHO_HH_ +#ifndef GZ_GUI_PLUGINS_TOPICECHO_HH_ +#define GZ_GUI_PLUGINS_TOPICECHO_HH_ #ifdef _MSC_VER #pragma warning(push, 0) @@ -38,7 +38,7 @@ #include -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Plugin.hh" namespace ignition { @@ -48,7 +48,7 @@ namespace plugins { class TopicEchoPrivate; - /// \brief Echo messages coming through an Ignition transport topic. + /// \brief Echo messages coming through an Gazebo transport topic. /// /// ## Configuration /// This plugin doesn't accept any custom configuration. diff --git a/src/plugins/topic_echo/TopicEcho_TEST.cc b/src/plugins/topic_echo/TopicEcho_TEST.cc index c3cbbc8ff..d848eca92 100644 --- a/src/plugins/topic_echo/TopicEcho_TEST.cc +++ b/src/plugins/topic_echo/TopicEcho_TEST.cc @@ -21,19 +21,19 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif -#include -#include -#include -#include +#include +#include +#include +#include -#include "ignition/gui/Application.hh" -#include "ignition/gui/MainWindow.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/MainWindow.hh" +#include "gz/gui/Plugin.hh" #include "test_config.h" // NOLINT(build/include) #include "TopicEcho.hh" @@ -43,7 +43,7 @@ char* g_argv[] = reinterpret_cast(const_cast("./TopicEcho_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/src/plugins/topic_viewer/TopicViewer.cc b/src/plugins/topic_viewer/TopicViewer.cc index a01ca883c..3fffc9e8d 100644 --- a/src/plugins/topic_viewer/TopicViewer.cc +++ b/src/plugins/topic_viewer/TopicViewer.cc @@ -24,14 +24,14 @@ #include #include -#include +#include -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include #include "TopicViewer.hh" #define NAME_KEY "name" @@ -73,7 +73,7 @@ namespace plugins class TopicViewerPrivate { /// \brief Node for Commincation - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief Model to create it from the available topics and messages public: TopicsModel *model; @@ -146,7 +146,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/topic_viewer/TopicViewer.hh b/src/plugins/topic_viewer/TopicViewer.hh index ec4e73185..af14d334f 100644 --- a/src/plugins/topic_viewer/TopicViewer.hh +++ b/src/plugins/topic_viewer/TopicViewer.hh @@ -16,7 +16,7 @@ */ #include -#include +#include #ifndef _WIN32 # define TopicViewer_EXPORTS_API diff --git a/src/plugins/topic_viewer/TopicViewer_TEST.cc b/src/plugins/topic_viewer/TopicViewer_TEST.cc index 27ee57c68..4022a4b5d 100644 --- a/src/plugins/topic_viewer/TopicViewer_TEST.cc +++ b/src/plugins/topic_viewer/TopicViewer_TEST.cc @@ -16,14 +16,14 @@ */ #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" #include "TopicViewer.hh" #define NAME_ROLE 51 @@ -39,12 +39,12 @@ char* g_argv[] = reinterpret_cast(const_cast("./TopicViewer_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; ///////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(TopicViewerTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Load)) { common::Console::SetVerbosity(4); @@ -70,7 +70,7 @@ TEST(TopicViewerTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Load)) } ///////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST(TopicViewerTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Model)) { setenv("IGN_PARTITION", "ign-gazebo-test", 1); diff --git a/src/plugins/world_control/WorldControl.cc b/src/plugins/world_control/WorldControl.cc index dd68be194..e8f0d16c9 100644 --- a/src/plugins/world_control/WorldControl.cc +++ b/src/plugins/world_control/WorldControl.cc @@ -19,12 +19,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include -#include "ignition/gui/Helpers.hh" +#include "gz/gui/Helpers.hh" namespace ignition { @@ -35,7 +35,7 @@ namespace plugins class WorldControlPrivate { /// \brief Message holding latest world statistics - public: ignition::msgs::WorldStatistics msg; + public: gz::msgs::WorldStatistics msg; /// \brief Service to send world control requests public: std::string controlService; @@ -44,7 +44,7 @@ namespace plugins public: std::recursive_mutex mutex; /// \brief Communication node - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief The multi step value public: unsigned int multiStep = 1u; @@ -56,7 +56,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/world_control/WorldControl.hh b/src/plugins/world_control/WorldControl.hh index a434228a7..4adb560f1 100644 --- a/src/plugins/world_control/WorldControl.hh +++ b/src/plugins/world_control/WorldControl.hh @@ -15,8 +15,8 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_WORLDCONTROL_HH_ -#define IGNITION_GUI_PLUGINS_WORLDCONTROL_HH_ +#ifndef GZ_GUI_PLUGINS_WORLDCONTROL_HH_ +#define GZ_GUI_PLUGINS_WORLDCONTROL_HH_ #include @@ -27,9 +27,9 @@ #ifdef _MSC_VER #pragma warning(pop) #endif -#include +#include -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Plugin.hh" #ifndef _WIN32 # define WorldControl_EXPORTS_API @@ -67,7 +67,7 @@ namespace plugins /// /// If no elements are filled for the plugin, both the play/pause and the /// step buttons will be displayed. - class WorldControl_EXPORTS_API WorldControl: public ignition::gui::Plugin + class WorldControl_EXPORTS_API WorldControl: public gz::gui::Plugin { Q_OBJECT @@ -103,7 +103,7 @@ namespace plugins signals: void paused(); /// \brief Subscriber callback when new world statistics are received - private: void OnWorldStatsMsg(const ignition::msgs::WorldStatistics &_msg); + private: void OnWorldStatsMsg(const gz::msgs::WorldStatistics &_msg); // Private data private: std::unique_ptr dataPtr; diff --git a/src/plugins/world_control/WorldControl_TEST.cc b/src/plugins/world_control/WorldControl_TEST.cc index a84602505..a2ff3dfbb 100644 --- a/src/plugins/world_control/WorldControl_TEST.cc +++ b/src/plugins/world_control/WorldControl_TEST.cc @@ -17,14 +17,14 @@ #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" #include "WorldControl.hh" int g_argc = 1; @@ -33,10 +33,10 @@ char* g_argv[] = reinterpret_cast(const_cast("./WorldControl_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 ///////////////////////////////////////////////// TEST(WorldControlTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Load)) { diff --git a/src/plugins/world_stats/WorldStats.cc b/src/plugins/world_stats/WorldStats.cc index 321f8197c..ca1d1a222 100644 --- a/src/plugins/world_stats/WorldStats.cc +++ b/src/plugins/world_stats/WorldStats.cc @@ -19,12 +19,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include -#include "ignition/gui/Helpers.hh" +#include "gz/gui/Helpers.hh" namespace ignition { @@ -35,13 +35,13 @@ namespace plugins class WorldStatsPrivate { /// \brief Message holding latest world statistics - public: ignition::msgs::WorldStatistics msg; + public: gz::msgs::WorldStatistics msg; /// \brief Mutex to protect msg public: std::recursive_mutex mutex; /// \brief Communication node - public: ignition::transport::Node node; + public: gz::transport::Node node; /// \brief Holds real time factor public: QString realTimeFactor; @@ -59,7 +59,7 @@ namespace plugins } } -using namespace ignition; +using namespace gz; using namespace gui; using namespace plugins; diff --git a/src/plugins/world_stats/WorldStats.hh b/src/plugins/world_stats/WorldStats.hh index 472d1c096..5ff96d807 100644 --- a/src/plugins/world_stats/WorldStats.hh +++ b/src/plugins/world_stats/WorldStats.hh @@ -15,8 +15,8 @@ * */ -#ifndef IGNITION_GUI_PLUGINS_WORLDSTATS_HH_ -#define IGNITION_GUI_PLUGINS_WORLDSTATS_HH_ +#ifndef GZ_GUI_PLUGINS_WORLDSTATS_HH_ +#define GZ_GUI_PLUGINS_WORLDSTATS_HH_ #include @@ -27,10 +27,10 @@ #ifdef _MSC_VER #pragma warning(pop) #endif -#include +#include -#include "ignition/gui/Export.hh" -#include "ignition/gui/Plugin.hh" +#include "gz/gui/Export.hh" +#include "gz/gui/Plugin.hh" #ifndef _WIN32 # define WorldStats_EXPORTS_API @@ -70,7 +70,7 @@ namespace plugins /// /// If no elements are filled for the plugin, all properties will be /// displayed. - class WorldStats_EXPORTS_API WorldStats: public ignition::gui::Plugin + class WorldStats_EXPORTS_API WorldStats: public gz::gui::Plugin { Q_OBJECT @@ -163,7 +163,7 @@ namespace plugins signals: void IterationsChanged(); /// \brief Subscriber callback when new world statistics are received - private: void OnWorldStatsMsg(const ignition::msgs::WorldStatistics &_msg); + private: void OnWorldStatsMsg(const gz::msgs::WorldStatistics &_msg); // Private data private: std::unique_ptr dataPtr; diff --git a/src/plugins/world_stats/WorldStats_TEST.cc b/src/plugins/world_stats/WorldStats_TEST.cc index b628f13d8..dc81a6e77 100644 --- a/src/plugins/world_stats/WorldStats_TEST.cc +++ b/src/plugins/world_stats/WorldStats_TEST.cc @@ -17,14 +17,14 @@ #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" #include "WorldStats.hh" int g_argc = 1; @@ -33,10 +33,10 @@ char* g_argv[] = reinterpret_cast(const_cast("./WorldStats_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 ///////////////////////////////////////////////// TEST(WorldStatsTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Load)) { diff --git a/test/helpers/TestHelper.hh b/test/helpers/TestHelper.hh index 8c2fee0f9..4dd761b33 100644 --- a/test/helpers/TestHelper.hh +++ b/test/helpers/TestHelper.hh @@ -14,12 +14,12 @@ * limitations under the License. * */ -#ifndef IGNITION_GUI_TESTHELPER_HH_ -#define IGNITION_GUI_TESTHELPER_HH_ +#ifndef GZ_GUI_TESTHELPER_HH_ +#define GZ_GUI_TESTHELPER_HH_ -#include -#include -#include +#include +#include +#include #ifndef _WIN32 # define TestHelper_EXPORTS_API diff --git a/test/integration/ExamplesBuild_TEST.cc b/test/integration/ExamplesBuild_TEST.cc index 7c87b77c3..389e43c3d 100644 --- a/test/integration/ExamplesBuild_TEST.cc +++ b/test/integration/ExamplesBuild_TEST.cc @@ -18,16 +18,16 @@ #include #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -using namespace ignition; +using namespace gz; // Helper functions copied from -// https://github.com/ignitionrobotics/ign-common/raw/ign-common3/src/Filesystem_TEST.cc +// https://github.com/gazebosim/gz-common/raw/ign-common3/src/Filesystem_TEST.cc #ifndef _WIN32 #include // NOLINT(build/include_order) @@ -167,7 +167,7 @@ void ExamplesBuild::Build(const std::string &_type) } ////////////////////////////////////////////////// -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 TEST_P(ExamplesBuild, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Build)) { Build(GetParam()); diff --git a/test/integration/Examples_TEST.cc b/test/integration/Examples_TEST.cc index 346931086..82eba4ff8 100644 --- a/test/integration/Examples_TEST.cc +++ b/test/integration/Examples_TEST.cc @@ -17,12 +17,12 @@ #include -#include -#include -#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) -#include "ignition/gui/Application.hh" +#include "gz/gui/Application.hh" int g_argc = 1; char* g_argv[] = @@ -30,10 +30,10 @@ char* g_argv[] = reinterpret_cast(const_cast("./Examples_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; -// See https://github.com/ignitionrobotics/ign-gui/issues/75 +// See https://github.com/gazebosim/gz-gui/issues/75 ///////////////////////////////////////////////// TEST(ExampleTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Configs)) { diff --git a/test/integration/deprecated_TEST.cc b/test/integration/deprecated_TEST.cc new file mode 100644 index 000000000..8070c9e77 --- /dev/null +++ b/test/integration/deprecated_TEST.cc @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#include +#include + +///////////////////////////////////////////////// +// Make sure the ignition namespace still works +TEST(Deprecated, IgnitionNamespace) +{ + ignition::gui::Plugin plugin; + EXPECT_TRUE(plugin.Title().empty()); +} diff --git a/test/integration/scene3d.cc b/test/integration/scene3d.cc index 817b82ca5..16ebcd74a 100644 --- a/test/integration/scene3d.cc +++ b/test/integration/scene3d.cc @@ -17,21 +17,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "test_config.h" // NOLINT(build/include) #include "../helpers/TestHelper.hh" -#include "ignition/gui/Application.hh" -#include "ignition/gui/GuiEvents.hh" -#include "ignition/gui/Plugin.hh" -#include "ignition/gui/MainWindow.hh" +#include "gz/gui/Application.hh" +#include "gz/gui/GuiEvents.hh" +#include "gz/gui/Plugin.hh" +#include "gz/gui/MainWindow.hh" int g_argc = 1; char* g_argv[] = @@ -39,7 +39,7 @@ char* g_argv[] = reinterpret_cast(const_cast("./Scene3d_TEST")), }; -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/test/plugins/TestBadInheritancePlugin.cc b/test/plugins/TestBadInheritancePlugin.cc index b98fdbc79..8a52e4f20 100644 --- a/test/plugins/TestBadInheritancePlugin.cc +++ b/test/plugins/TestBadInheritancePlugin.cc @@ -15,12 +15,12 @@ * */ -#include -#include +#include +#include #include "TestBadInheritancePlugin.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/test/plugins/TestBadInheritancePlugin.hh b/test/plugins/TestBadInheritancePlugin.hh index c5c5bc753..c8fb2bfe6 100644 --- a/test/plugins/TestBadInheritancePlugin.hh +++ b/test/plugins/TestBadInheritancePlugin.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_TEST_TESTBADINHERITANCEPLUGIN_HH_ -#define IGNITION_GUI_TEST_TESTBADINHERITANCEPLUGIN_HH_ +#ifndef GZ_GUI_TEST_TESTBADINHERITANCEPLUGIN_HH_ +#define GZ_GUI_TEST_TESTBADINHERITANCEPLUGIN_HH_ #ifndef Q_MOC_RUN - #include - #include + #include + #include #endif namespace ignition diff --git a/test/plugins/TestInvalidQmlPlugin.cc b/test/plugins/TestInvalidQmlPlugin.cc index 2f58cb41f..b0dbc4357 100644 --- a/test/plugins/TestInvalidQmlPlugin.cc +++ b/test/plugins/TestInvalidQmlPlugin.cc @@ -15,11 +15,11 @@ * */ -#include +#include #include "TestInvalidQmlPlugin.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/test/plugins/TestInvalidQmlPlugin.hh b/test/plugins/TestInvalidQmlPlugin.hh index 412dbd1e6..d10731d37 100644 --- a/test/plugins/TestInvalidQmlPlugin.hh +++ b/test/plugins/TestInvalidQmlPlugin.hh @@ -15,10 +15,10 @@ * */ -#ifndef IGNITION_GUI_TEST_MALFORMEDPLUGIN_HH_ -#define IGNITION_GUI_TEST_MALFORMEDPLUGIN_HH_ +#ifndef GZ_GUI_TEST_MALFORMEDPLUGIN_HH_ +#define GZ_GUI_TEST_MALFORMEDPLUGIN_HH_ -#include +#include namespace ignition { diff --git a/test/plugins/TestNotRegisteredPlugin.cc b/test/plugins/TestNotRegisteredPlugin.cc index c9471d8b4..10a61e433 100644 --- a/test/plugins/TestNotRegisteredPlugin.cc +++ b/test/plugins/TestNotRegisteredPlugin.cc @@ -15,12 +15,12 @@ * */ -#include -#include +#include +#include #include "TestNotRegisteredPlugin.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/test/plugins/TestNotRegisteredPlugin.hh b/test/plugins/TestNotRegisteredPlugin.hh index 41726a08a..adf7b49bf 100644 --- a/test/plugins/TestNotRegisteredPlugin.hh +++ b/test/plugins/TestNotRegisteredPlugin.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_TEST_TESTNOTREGISTEREDPLUGIN_HH_ -#define IGNITION_GUI_TEST_TESTNOTREGISTEREDPLUGIN_HH_ +#ifndef GZ_GUI_TEST_TESTNOTREGISTEREDPLUGIN_HH_ +#define GZ_GUI_TEST_TESTNOTREGISTEREDPLUGIN_HH_ #ifndef Q_MOC_RUN - #include - #include + #include + #include #endif namespace ignition diff --git a/test/plugins/TestPlugin.cc b/test/plugins/TestPlugin.cc index 03559ae3f..0a4b08146 100644 --- a/test/plugins/TestPlugin.cc +++ b/test/plugins/TestPlugin.cc @@ -15,12 +15,12 @@ * */ -#include -#include +#include +#include #include "TestPlugin.hh" -using namespace ignition; +using namespace gz; using namespace gui; ///////////////////////////////////////////////// diff --git a/test/plugins/TestPlugin.hh b/test/plugins/TestPlugin.hh index d0a03bac6..1577a263b 100644 --- a/test/plugins/TestPlugin.hh +++ b/test/plugins/TestPlugin.hh @@ -15,12 +15,12 @@ * */ -#ifndef IGNITION_GUI_TEST_TESTPLUGIN_HH_ -#define IGNITION_GUI_TEST_TESTPLUGIN_HH_ +#ifndef GZ_GUI_TEST_TESTPLUGIN_HH_ +#define GZ_GUI_TEST_TESTPLUGIN_HH_ #ifndef Q_MOC_RUN - #include - #include + #include + #include #endif namespace ignition diff --git a/test/test_config.h.in b/test/test_config.h.in index 0ccf50434..124a68eb9 100644 --- a/test/test_config.h.in +++ b/test/test_config.h.in @@ -1,6 +1,8 @@ #define PROJECT_SOURCE_PATH "${PROJECT_SOURCE_DIR}" #define PROJECT_BINARY_PATH "${CMAKE_BINARY_DIR}" +#include + #if (_MSC_VER >= 1400) // Visual Studio 2005 #include diff --git a/tutorials.md.in b/tutorials.md.in index 49e9caf34..ab26d2562 100644 --- a/tutorials.md.in +++ b/tutorials.md.in @@ -1,8 +1,8 @@ \page tutorials Tutorials -Welcome to the Ignition @GZ_DESIGNATION_CAP@ tutorials. These tutorials +Welcome to the Gazebo @GZ_DESIGNATION_CAP@ tutorials. These tutorials will guide you through the process of understanding the capabilities of the -Ignition @GZ_DESIGNATION_CAP@ library and how to use the library effectively. +Gazebo @GZ_DESIGNATION_CAP@ library and how to use the library effectively. **The tutorials** diff --git a/tutorials/01_install.md b/tutorials/01_install.md index e4086b94e..0603de59c 100644 --- a/tutorials/01_install.md +++ b/tutorials/01_install.md @@ -4,9 +4,9 @@ Next Tutorial: \ref commandline # Install -These instructions are for installing only Ignition GUI. If you're interested -in using all the Ignition libraries, not only Igniton GUI, check out this -[Ignition installation](https://ignitionrobotics.org/docs/latest/install). +These instructions are for installing only Gazebo GUI. If you're interested +in using all the Gazebo libraries, not only Igniton GUI, check out this +[Gazebo installation](https://gazebosim.org/docs/latest/install). We recommend following the binary install instructions to get up and running as quickly and painlessly as possible. @@ -19,7 +19,7 @@ contribution. ### Ubuntu -On Ubuntu, it's possible to install Ignition GUI as follows: +On Ubuntu, it's possible to install Gazebo GUI as follows: Add OSRF packages: ``` @@ -28,7 +28,7 @@ Add OSRF packages: sudo apt update ``` -Install Ignition GUI: +Install Gazebo GUI: ``` sudo apt install libignition-gui<#>-dev ``` @@ -44,7 +44,7 @@ On macOS, add OSRF packages: brew tap osrf/simulation ``` -Install Ignition GUI: +Install Gazebo GUI: ``` brew install ignition-gui<#> ``` @@ -74,7 +74,7 @@ Add OSRF packages: Clone source code: ``` # This checks out the default branch. You can append `-b ign-gui#` (replace # with a number) to checkout a specific version - git clone http://github.com/ignitionrobotics/ign-gui + git clone http://github.com/gazebosim/gz-gui ``` Install dependencies @@ -103,7 +103,7 @@ Build and install as follows: #### Install Prerequisites -First, follow the [ign-cmake](https://github.com/ignitionrobotics/ign-cmake) tutorial for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment. +First, follow the [gz-cmake](https://github.com/gazebosim/gz-cmake) tutorial for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment. Navigate to `condabin` if necessary to use the `conda` command (i.e., if Conda is not in your `PATH` environment variable. You can find the location of `condabin` in Anaconda Prompt, `where conda`). @@ -118,12 +118,12 @@ Install dependencies: conda install qt --channel conda-forge ``` -Install Ignition dependencies, replacing `<#>` with the desired versions: +Install Gazebo dependencies, replacing `<#>` with the desired versions: ``` conda install libignition-cmake<#> libignition-common<#> libignition-math<#> libignition-transport<#> libignition-msgs<#> libignition-plugin<#> libignition-tools<#> --channel conda-forge ``` -Before [ign-rendering](https://github.com/ignitionrobotics/ign-rendering) becomes available on conda-forge, follow its tutorial to build it from source. +Before [gz-rendering](https://github.com/gazebosim/gz-rendering) becomes available on conda-forge, follow its tutorial to build it from source. #### Build from source @@ -135,7 +135,7 @@ Before [ign-rendering](https://github.com/ignitionrobotics/ign-rendering) become 1. Navigate to where you would like to build the library, and clone the repository. ``` # Optionally, append `-b ign-gui#` (replace # with a number) to check out a specific version - git clone https://github.com/ignitionrobotics/ign-gui.git + git clone https://github.com/gazebosim/gz-gui.git ``` 1. Configure and build @@ -159,7 +159,7 @@ Before [ign-rendering](https://github.com/ignitionrobotics/ign-rendering) become # Documentation API documentation and tutorials can be accessed at -[https://ignitionrobotics.org/libs/gui](https://ignitionrobotics.org/libs/gui) +[https://gazebosim.org/libs/gui](https://gazebosim.org/libs/gui) You can also generate the documentation from a clone of this repository by following these steps. @@ -170,7 +170,7 @@ You can also generate the documentation from a clone of this repository by follo 2. Clone the repository ``` - git clone https://github.com/ignitionrobotics/ign-gui + git clone https://github.com/gazebosim/gz-gui ``` 3. Configure and build the documentation. @@ -203,5 +203,5 @@ Follow these steps to run tests and static code analysis in your clone of this r make codecheck ``` -See the [Writing Tests section of the contributor guide](https://ignitionrobotics.org/docs/all/contributing#writing-tests) for help creating or modifying tests. +See the [Writing Tests section of the contributor guide](https://gazebosim.org/docs/all/contributing#writing-tests) for help creating or modifying tests. diff --git a/tutorials/02_commandline.md b/tutorials/02_commandline.md index 978021331..15e8d5c32 100644 --- a/tutorials/02_commandline.md +++ b/tutorials/02_commandline.md @@ -5,11 +5,11 @@ Previous Tutorial: \ref install ## Overview -If you have Ignition Tools installed, you can use the `ign gui` command line tool: +If you have Gazebo Tools installed, you can use the `ign gui` command line tool: `ign gui -h` - Ignition GUI tool. + Gazebo GUI tool. ign gui [options] diff --git a/tutorials/03_plugins.md b/tutorials/03_plugins.md index 53ced108c..bbd8c71f7 100644 --- a/tutorials/03_plugins.md +++ b/tutorials/03_plugins.md @@ -5,26 +5,26 @@ Previous Tutorial: \ref commandline ## Writing plugins -An Ignition GUI plugin is a shared library that defines a widget. +An Gazebo GUI plugin is a shared library that defines a widget. The plugin contains [QML](https://doc.qt.io/qt-5/qtqml-index.html) code that specifies what the widget looks like, as well as C++ code that defines the plugin's behaviour and ties it to other libraries. -See [HelloPlugin](https://github.com/ignitionrobotics/ign-gui/blob/ign-gui3/examples/plugin/hello_plugin/) +See [HelloPlugin](https://github.com/gazebosim/gz-gui/blob/ign-gui3/examples/plugin/hello_plugin/) for an example. ## Finding plugins -Ignition GUI will look for plugins on the following paths, in this order: +Gazebo GUI will look for plugins on the following paths, in this order: 1. All paths set on the `IGN_GUI_PLUGIN_PATH` environment variable -2. All paths added by calling `ignition::gui::addPluginPath` +2. All paths added by calling `gz::gui::addPluginPath` 3. `~/.ignition/gui/plugins` -4. [Plugins which are installed with Ignition GUI](https://ignitionrobotics.org/api/gui/3.3/namespaceignition_1_1gui_1_1plugins.html) +4. [Plugins which are installed with Gazebo GUI](https://gazebosim.org/api/gui/3.3/namespaceignition_1_1gui_1_1plugins.html) ## Configuring plugins -Ignition GUI supports loading XML configuration files, which may contain +Gazebo GUI supports loading XML configuration files, which may contain parameters to be passed directly to the plugin. See the \subpage config tutorial for more information. @@ -32,7 +32,7 @@ tutorial for more information. ### Image display -Display images from an Ignition Transport topic. +Display images from an Gazebo Transport topic. ign gui -c examples/config/image.config @@ -42,7 +42,7 @@ or ### Publisher -Publish messages on an Ignition Transport topic. +Publish messages on an Gazebo Transport topic. 1. Listen to string messages on the `/echo` topic: @@ -64,13 +64,13 @@ Publish messages on an Ignition Transport topic. ### Topic echo -Echo messages from an Ignition Transport topic. +Echo messages from an Gazebo Transport topic. ign gui -c examples/config/pubsub.config ### Key publisher -Publish key presses through Ignition Transport. +Publish key presses through Gazebo Transport. ign gui -c examples/config/keypublisher.config @@ -80,7 +80,7 @@ Change the topic to echo to `/keyboard/keypress`, echo, and start pressing keys. **Not ported to versions 1 or higher yet** -Discover all Ignition Transport topics and introspect its fields. +Discover all Gazebo Transport topics and introspect its fields. ign gui -c examples/config/topicViewer.config @@ -88,7 +88,7 @@ Discover all Ignition Transport topics and introspect its fields. **Not ported to versions 1 or higher yet** -Show basic stats of all Ignition Transport topics at the same time. +Show basic stats of all Gazebo Transport topics at the same time. ign gui -c examples/config/topicsStats.config @@ -107,7 +107,7 @@ plugins. This is a container for various Display Plugins that each paint on a Scene. The following example includes the display plugins that are installed with -Ignition GUI by default. +Gazebo GUI by default. ign gui -c examples/config/display_plugins.config @@ -115,9 +115,9 @@ Ignition GUI by default. **Not ported to versions 1 or higher yet** -Ignition GUI will look for display plugins on the following paths, in this +Gazebo GUI will look for display plugins on the following paths, in this order: 1. All paths set on the `IGN_GUI_DISPLAY_PLUGIN_PATH` environment variable 2. `~/.ignition/gui/display_plugins` -3. [Display plugins that are installed with Ignition GUI](https://ignitionrobotics.org/api/gui/0.1/namespaceignition_1_1gui_1_1display_plugins.html) +3. [Display plugins that are installed with Gazebo GUI](https://gazebosim.org/api/gui/0.1/namespaceignition_1_1gui_1_1plugins.html) diff --git a/tutorials/04_layout.md b/tutorials/04_layout.md index 90ff70d7d..66acb981e 100644 --- a/tutorials/04_layout.md +++ b/tutorials/04_layout.md @@ -32,7 +32,7 @@ by adding a `` element to the config file. The child elements are: `` is `false`, closing the window will emit a server shutdown request with `stop = true` to the `` topic. This can be used - in applications like Ignition Gazebo which can run a + in applications like Gazebo Gazebo which can run a server in a process separate from the GUI to stop both the GUI and the server when the window is closed. The value is case-insensitive. @@ -83,7 +83,7 @@ config file. For example: 1. Click on `File->Save configuration as` and save on a new file. > You can also click on `File -> Save configuration` to save that as the - default configuration which is loaded whenever Ignition GUI is opened + default configuration which is loaded whenever Gazebo GUI is opened without a config file. 1. Close the window, then load the new config file: diff --git a/tutorials/05_style.md b/tutorials/05_style.md index 29d65873f..e2d997ff7 100644 --- a/tutorials/05_style.md +++ b/tutorials/05_style.md @@ -5,21 +5,21 @@ Previous Tutorial: \ref layout ## Overview -Ignition GUI leverages +Gazebo GUI leverages [QtQuick Controls 2 Styles](https://doc.qt.io/qt-5.9/qtquickcontrols2-styles.html) for styling. The recommended and best supported style is the Material Style, but it is also possible to use others such as Default and Universal. This tutorial focuses on customizing the Material style. The default style is hardcoded into the -[qtquickcontrols2.conf](https://github.com/ignitionrobotics/ign-gui/blob/ign-gui3/include/ignition/gui/qtquickcontrols2.conf) +[qtquickcontrols2.conf](https://github.com/gazebosim/gz-gui/blob/ign-gui3/include/gz/gui/qtquickcontrols2.conf) file. There are a few ways to override the default style: * Through the graphical interface (GUI) * Setting environment variables (env) -* Through Ignition GUI config files (config) +* Through Gazebo GUI config files (config) If styles are set from multiple sources, this is the order in which they take precendence: @@ -35,13 +35,13 @@ Users can customize the whole application's material style using just a few vari QML types provided by [QtQuick Controls 2](https://doc.qt.io/qt-5/qtquick-controls2-qmlmodule.html), -as well as QML types provided by Ignition GUI, use these variables as appropriate. +as well as QML types provided by Gazebo GUI, use these variables as appropriate. It's recommended that developers make sure their plugins use these variables for a more integrated experience. ### Top toolbar -On top of those, Ignition GUI also offers a few variables specific to customizing +On top of those, Gazebo GUI also offers a few variables specific to customizing the top toolbar. By default, the top toolbar will use the primary color, while the plugin toolbars will @@ -86,7 +86,7 @@ these environment variable preferences. \note Toolbar colors can't be changed through environment variables yet. -\note Applications built on top of Ignition GUI may override custom environment variables. +\note Applications built on top of Gazebo GUI may override custom environment variables. ## Config files diff --git a/tutorials/06_example.md b/tutorials/06_example.md index 469df35c8..2ada94250 100644 --- a/tutorials/06_example.md +++ b/tutorials/06_example.md @@ -5,12 +5,12 @@ Previous Tutorial: \ref style ## Overview -Ignition GUI comes with several examples of plugins and other files +Gazebo GUI comes with several examples of plugins and other files under the `examples` folder. ## Standalone applications -Ignition GUI can be used as a C++ library by other applications. +Gazebo GUI can be used as a C++ library by other applications. Examples provided under `examples/standalone` can be compiled and run without the `ign gui` command line tool. @@ -30,7 +30,7 @@ Then run it: ## Custom plugins -Ignition GUI comes with several plugins, but its true power is loading custom +Gazebo GUI comes with several plugins, but its true power is loading custom plugins developed by others. Under `examples/plugins`, there are several examples on how to build different types of plugins. @@ -42,7 +42,7 @@ For example, we can build the `hello_plugin` example plugin: cmake .. make -Then create the plugins directory and copy the generated library to it so that Ignition GUI can find the plugin: +Then create the plugins directory and copy the generated library to it so that Gazebo GUI can find the plugin: mkdir -p ~/.ignition/gui/plugins cp libHelloPlugin.so ~/.ignition/gui/plugins/ @@ -58,7 +58,7 @@ Now you can use the command line to open it: ## Configuration files -Configuration files are used to load an Ignition GUI window with several +Configuration files are used to load an Gazebo GUI window with several plugins and custom window configurations. Example configuration files are provided in the `/examples/config` folder. diff --git a/tutorials/07_config.md b/tutorials/07_config.md index 8178cbda6..2b6aa059f 100644 --- a/tutorials/07_config.md +++ b/tutorials/07_config.md @@ -4,12 +4,12 @@ Next Tutorial: \ref layout ## Configuration files -Ignition GUI supports loading XML configuration files that define what +Gazebo GUI supports loading XML configuration files that define what the window should look like and which plugins should be loaded. ### Loading -By default, Ignition GUI will load the config file at +By default, Gazebo GUI will load the config file at `$HOME/.ignition/gui/default.config`, if it exists. Configuration files can also be loaded from the command line or through the @@ -30,24 +30,24 @@ environment variable `GZ_GUI_RESOURCE_PATH`, like so: `GZ_GUI_RESOURCE_PATH=/absolute/path/to/ ign gui --config example.config` From the C++ API, pass the file path to -[Application::LoadConfig](https://ignitionrobotics.org/api/gui/3.0/classignition_1_1gui_1_1Application.html#a03c4c3a1b1e58cc4bff05658f21fff17). +[Application::LoadConfig](https://gazebosim.org/api/gui/3.0/classignition_1_1gui_1_1Application.html#a03c4c3a1b1e58cc4bff05658f21fff17). ### File structure -Ignition GUI accepts the following top-level elements on a config file: +Gazebo GUI accepts the following top-level elements on a config file: * ``: Options related to the entire window's layout. See \subpage layout for more details. * ``: Zero or more plugins to be loaded at startup. * `filename`: This attribute specifies the plugin library to be loaded. - * ``: Ignition GUI processes this block before passing the + * ``: Gazebo GUI processes this block before passing the config to the plugin. See - [plugin_params.config](https://github.com/ignitionrobotics/ign-gui/blob/ign-gui2/examples/config/plugin_params.config) + [plugin_params.config](https://github.com/gazebosim/gz-gui/blob/ign-gui2/examples/config/plugin_params.config) for an example. * custom elements: Developers can read custom plugin configurations overriding the - [Plugin::LoadConfig](https://ignitionrobotics.org/api/gui/3.0/classignition_1_1gui_1_1Plugin.html#a72064530af4cd247b994b905559fd4ee) + [Plugin::LoadConfig](https://gazebosim.org/api/gui/3.0/classignition_1_1gui_1_1Plugin.html#a72064530af4cd247b994b905559fd4ee) function, see the - [HelloPlugin](https://github.com/ignitionrobotics/ign-gui/blob/ign-gui2/examples/plugin/hello_plugin/HelloPlugin.cc) + [HelloPlugin](https://github.com/gazebosim/gz-gui/blob/ign-gui2/examples/plugin/hello_plugin/HelloPlugin.cc) example. See the example plugin block below: @@ -59,7 +59,7 @@ See the example plugin block below: /camera -This will load the `libImageDisplay.so` plugin, Ignition GUI will set its +This will load the `libImageDisplay.so` plugin, Gazebo GUI will set its `height` to `120` pixels, and the plugin-specific `` parameter will be handled within `ImageDisplay::LoadConfig`. diff --git a/tutorials/08_screenshot.md b/tutorials/08_screenshot.md index 300f18b05..14d5e2992 100644 --- a/tutorials/08_screenshot.md +++ b/tutorials/08_screenshot.md @@ -10,7 +10,7 @@ the filename will be the timestamp of when the screenshot was taken. It is possible to change the default directory to a different location, which will be shown in the example below. -**Note**: This example is using Ignition Gazebo but is not required. +**Note**: This example is using Gazebo Gazebo but is not required. The same steps can be done using `ign gui` with a 3D scene. First, go to the plugins menu on the top right (vertical ellipsis) then select diff --git a/tutorials/index.md b/tutorials/index.md index b1d04f063..1902b0564 100644 --- a/tutorials/index.md +++ b/tutorials/index.md @@ -1,6 +1,6 @@ # Introduction -Ignition GUI is a component in the Ignition framework, a set +Gazebo GUI is a component in the Gazebo framework, a set of libraries designed to rapidly develop robot applications. -[http://ignitionrobotics.org](http://ignitionrobotics.org) +[http://gazebosim.org](http://gazebosim.org)