Gazebo Gui

API Reference

6.8.0
gz/gui/GuiEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef GZ_GUI_GUIEVENTS_HH_
18 #define GZ_GUI_GUIEVENTS_HH_
19 
20 #include <QEvent>
21 #include <memory>
22 #include <string>
23 #include <utility>
24 #include <vector>
25 
26 #include <gz/common/KeyEvent.hh>
27 #include <gz/common/MouseEvent.hh>
28 #include <gz/math/Vector2.hh>
29 #include <gz/math/Vector3.hh>
30 #include <gz/msgs/world_control.pb.h>
31 #include <gz/utils/ImplPtr.hh>
32 
33 #include "gz/gui/Export.hh"
34 
35 namespace ignition
36 {
37  namespace gui
38  {
40  namespace events
41  {
44 
48  class Render : public QEvent
49  {
50  public: Render()
51  : QEvent(kType)
52  {
53  }
55  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser);
56  };
57 
61  class IGNITION_GUI_VISIBLE SnapIntervals : public QEvent
62  {
67  public: SnapIntervals(
68  const math::Vector3d &_xyz,
69  const math::Vector3d &_rpy,
70  const math::Vector3d &_scale);
71 
74  public: math::Vector3d Position() const;
75 
78  public: math::Vector3d Rotation() const;
79 
82  public: math::Vector3d Scale() const;
83 
85  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 1);
86 
89  IGN_UTILS_IMPL_PTR(dataPtr)
90  };
91 
94  class IGNITION_GUI_VISIBLE SpawnFromDescription : public QEvent
95  {
99  public: explicit SpawnFromDescription(const std::string &_description);
100 
102  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 2);
103 
106  public: const std::string &Description() const;
107 
110  IGN_UTILS_IMPL_PTR(dataPtr)
111  };
112 
115  class IGNITION_GUI_VISIBLE SpawnFromPath : public QEvent
116  {
119  public: explicit SpawnFromPath(const std::string &_filePath);
120 
122  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 3);
123 
126  public: const std::string &FilePath() const;
127 
130  IGN_UTILS_IMPL_PTR(dataPtr)
131  };
132 
135  class IGNITION_GUI_VISIBLE HoverToScene : public QEvent
136  {
140  public: explicit HoverToScene(const math::Vector3d &_point);
141 
143  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 4);
144 
148  public: math::Vector3d Point() const;
149 
152  IGN_UTILS_IMPL_PTR(dataPtr)
153  };
154 
158  class IGNITION_GUI_VISIBLE LeftClickToScene : public QEvent
159  {
163  public: explicit LeftClickToScene(const math::Vector3d &_point);
164 
166  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 5);
167 
170  public: math::Vector3d Point() const;
171 
174  IGN_UTILS_IMPL_PTR(dataPtr)
175  };
176 
180  class IGNITION_GUI_VISIBLE RightClickToScene : public QEvent
181  {
185  public: explicit RightClickToScene(const math::Vector3d &_point);
186 
188  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 6);
189 
192  public: math::Vector3d Point() const;
193 
196  IGN_UTILS_IMPL_PTR(dataPtr)
197  };
198 
202  class IGNITION_GUI_VISIBLE DropdownMenuEnabled : public QEvent
203  {
207  public: explicit DropdownMenuEnabled(bool _menuEnabled);
208 
210  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 7);
211 
214  public: bool MenuEnabled() const;
215 
218  IGN_UTILS_IMPL_PTR(dataPtr)
219  };
220 
223  class IGNITION_GUI_VISIBLE KeyReleaseOnScene : public QEvent
224  {
227  public: explicit KeyReleaseOnScene(const common::KeyEvent &_key);
228 
230  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 8);
231 
234  public: common::KeyEvent Key() const;
235 
238  IGN_UTILS_IMPL_PTR(dataPtr)
239  };
240 
243  class IGNITION_GUI_VISIBLE KeyPressOnScene : public QEvent
244  {
247  public: explicit KeyPressOnScene(const common::KeyEvent &_key);
248 
250  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 9);
251 
254  public: common::KeyEvent Key() const;
255 
258  IGN_UTILS_IMPL_PTR(dataPtr)
259  };
260 
266  class IGNITION_GUI_VISIBLE LeftClickOnScene : public QEvent
267  {
270  public: explicit LeftClickOnScene(
271  const common::MouseEvent &_mouse);
272 
274  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 10);
275 
277  public: const common::MouseEvent &Mouse() const;
278 
281  IGN_UTILS_IMPL_PTR(dataPtr)
282  };
283 
289  class IGNITION_GUI_VISIBLE RightClickOnScene : public QEvent
290  {
293  public: RightClickOnScene(
294  const common::MouseEvent &_mouse);
295 
297  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 11);
298 
300  public: const common::MouseEvent &Mouse() const;
301 
304  IGN_UTILS_IMPL_PTR(dataPtr)
305  };
306 
310  class IGNITION_GUI_VISIBLE BlockOrbit : public QEvent
311  {
314  public: explicit BlockOrbit(const bool &_block);
315 
317  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 12);
318 
322  public: bool Block() const;
323 
326  IGN_UTILS_IMPL_PTR(dataPtr)
327  };
328 
331  class IGNITION_GUI_VISIBLE HoverOnScene : public QEvent
332  {
335  public: explicit HoverOnScene(const common::MouseEvent &_mouse);
336 
338  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 13);
339 
343  public: common::MouseEvent Mouse() const;
344 
347  IGN_UTILS_IMPL_PTR(dataPtr)
348  };
349 
351  class IGNITION_GUI_VISIBLE SpawnCloneFromName : public QEvent
352  {
355  public: explicit SpawnCloneFromName(const std::string &_name);
356 
358  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 14);
359 
362  public: const std::string &Name() const;
363 
366  IGN_UTILS_IMPL_PTR(dataPtr)
367  };
368 
370  class IGNITION_GUI_VISIBLE DropOnScene : public QEvent
371  {
375  public: explicit DropOnScene(
376  const std::string &_dropText,
377  const math::Vector2i &_dropMouse);
378 
381  public: const std::string &DropText() const;
382 
385  public: const math::Vector2i &Mouse() const;
386 
388  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 15);
389 
392  IGN_UTILS_IMPL_PTR(dataPtr)
393  };
394 
397  class IGNITION_GUI_VISIBLE ScrollOnScene : public QEvent
398  {
401  public: explicit ScrollOnScene(const common::MouseEvent &_mouse);
402 
404  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 16);
405 
407  public: const common::MouseEvent &Mouse() const;
408 
411  IGN_UTILS_IMPL_PTR(dataPtr)
412  };
413 
416  class IGNITION_GUI_VISIBLE DragOnScene : public QEvent
417  {
420  public: explicit DragOnScene(const common::MouseEvent &_mouse);
421 
423  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 17);
424 
428  public: common::MouseEvent Mouse() const;
429 
432  IGN_UTILS_IMPL_PTR(dataPtr)
433  };
434 
437  class IGNITION_GUI_VISIBLE MousePressOnScene : public QEvent
438  {
441  public: MousePressOnScene(
442  const common::MouseEvent &_mouse);
443 
445  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 18);
446 
448  public: const common::MouseEvent &Mouse() const;
449 
452  IGN_UTILS_IMPL_PTR(dataPtr)
453  };
454 
456  class IGNITION_GUI_VISIBLE WorldControl : public QEvent
457  {
460  public: explicit WorldControl(const msgs::WorldControl &_worldControl);
461 
463  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 19);
464 
467  public: const msgs::WorldControl &WorldControlInfo() const;
468 
471  IGN_UTILS_IMPL_PTR(dataPtr)
472  };
473 
477  class IGNITION_GUI_VISIBLE PreRender : public QEvent
478  {
480  public: PreRender();
481 
483  static const QEvent::Type kType = QEvent::Type(QEvent::MaxUser - 20);
484 
487  IGN_UTILS_IMPL_PTR(dataPtr)
488  };
489  }
490  }
491 }
492 
493 #endif // GZ_GUI_GUIEVENTS_HH_
math::Vector3d Position() const
Get the XYZ snapping values.
DragOnScene(const common::MouseEvent &_mouse)
Constructor.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:143
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:274
HoverToScene(const math::Vector3d &_point)
Constructor.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:445
math::Vector3d Point() const
Get the point within the scene that the user clicked.
STL class.
Event which is called to broadcast information about mouse drags on the scene.
Definition: gz/gui/GuiEvents.hh:416
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:423
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:55
Event which is called to broadcast information about mouse scrolls on the scene.
Definition: gz/gui/GuiEvents.hh:397
Event called to clone a resource, given its name as a string.
Definition: gz/gui/GuiEvents.hh:370
Render()
Definition: gz/gui/GuiEvents.hh:50
bool Block() const
Get the if the event should block the Interactive view controller.
Event which is called to broadcast the 2D coordinates of a user's mouse hover within the scene.
Definition: gz/gui/GuiEvents.hh:331
Event that block the Interactive View control when some of the other plugins require it....
Definition: gz/gui/GuiEvents.hh:310
RightClickOnScene(const common::MouseEvent &_mouse)
Constructor.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:338
const msgs::WorldControl & WorldControlInfo() const
Get the WorldControl information.
static const QEvent::Type kType
The QEvent representing a snap event occurrence.
Definition: gz/gui/GuiEvents.hh:85
const std::string & FilePath() const
Get the path of the file.
const common::MouseEvent & Mouse() const
Return the left mouse event.
BlockOrbit(const bool &_block)
Constructor.
common::MouseEvent Mouse() const
Get the point within the scene over which the user is hovering.
Event which is called to broadcast the key press within the scene.
Definition: gz/gui/GuiEvents.hh:243
Event called in the render thread of a 3D scene after the user camera has rendered....
Definition: gz/gui/GuiEvents.hh:48
const std::string & Name() const
Get the name of the resource to be cloned.
HoverOnScene(const common::MouseEvent &_mouse)
Constructor.
ScrollOnScene(const common::MouseEvent &_mouse)
Constructor.
const std::string & DropText() const
Get the text of the dropped thing on the scene.
LeftClickToScene(const math::Vector3d &_point)
Constructor.
LeftClickOnScene(const common::MouseEvent &_mouse)
Constructor.
Event called to spawn a resource, which takes the path to its file.
Definition: gz/gui/GuiEvents.hh:115
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:483
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:317
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:463
const std::string & Description() const
Get the string description of the resource.
const common::MouseEvent & Mouse() const
Return the button press mouse event.
DropdownMenuEnabled(bool _menuEnabled)
Constructor.
DropOnScene(const std::string &_dropText, const math::Vector2i &_dropMouse)
Constructor.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:122
SpawnFromDescription(const std::string &_description)
Constructor.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:297
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:230
Event which is called to broadcast the 3D coordinates of a user's releasing the left button within th...
Definition: gz/gui/GuiEvents.hh:158
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:388
math::Vector3d Point() const
Get the point within the scene over which the user is hovering.
Event which is called to broadcast the 3D coordinates of a user's releasing the right button within t...
Definition: gz/gui/GuiEvents.hh:180
Event called to spawn a resource, given its description as a string.
Definition: gz/gui/GuiEvents.hh:94
common::KeyEvent Key() const
Get the released key within the scene that the user released.
const common::MouseEvent & Mouse() const
Return the scroll mouse event.
Event which is called to share WorldControl information.
Definition: gz/gui/GuiEvents.hh:456
Event which is called to broadcast information about right mouse releases on the scene....
Definition: gz/gui/GuiEvents.hh:289
Event called to clone a resource, given its name as a string.
Definition: gz/gui/GuiEvents.hh:351
math::Vector3d Scale() const
Get the scale snapping values.
math::Vector3d Point() const
Get the point within the scene that the user clicked.
RightClickToScene(const math::Vector3d &_point)
Constructor.
const math::Vector2i & Mouse() const
Get X and Y position.
bool MenuEnabled() const
Gets whether the menu is enabled or not for this event.
MousePressOnScene(const common::MouseEvent &_mouse)
Constructor.
The class for sending and receiving custom snap value events. This event is used in the Transform Con...
Definition: gz/gui/GuiEvents.hh:61
Event which is called to broadcast information about mouse presses on the scene, with right,...
Definition: gz/gui/GuiEvents.hh:437
Event which is called to broadcast information about left mouse releases on the scene....
Definition: gz/gui/GuiEvents.hh:266
math::Vector3d Rotation() const
Get the RPY snapping values.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:166
Event which is called to broadcast the 3D coordinates of a user's mouse hover within the scene.
Definition: gz/gui/GuiEvents.hh:135
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:404
KeyPressOnScene(const common::KeyEvent &_key)
Constructor.
Event called in the render thread of a 3D scene, before the user camera is rendered....
Definition: gz/gui/GuiEvents.hh:477
Event which is called to broadcast the key release within the scene.
Definition: gz/gui/GuiEvents.hh:223
KeyReleaseOnScene(const common::KeyEvent &_key)
Constructor.
common::KeyEvent Key() const
Get the key within the scene that the user pressed.
common::MouseEvent Mouse() const
Get the point within the scene over which the user is dragging.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:188
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:358
SnapIntervals(const math::Vector3d &_xyz, const math::Vector3d &_rpy, const math::Vector3d &_scale)
Constructor.
WorldControl(const msgs::WorldControl &_worldControl)
Constructor.
Event which is called to enable or disable the dropdown menu. This is primarily used by plugins which...
Definition: gz/gui/GuiEvents.hh:202
SpawnFromPath(const std::string &_filePath)
Constructor.
const common::MouseEvent & Mouse() const
Return the right mouse event.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:210
SpawnCloneFromName(const std::string &_name)
Constructor.
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:250
static const QEvent::Type kType
Unique type for this event.
Definition: gz/gui/GuiEvents.hh:102