Ignition Gazebo

API Reference

3.0.0
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 IGNITION_GAZEBO_GUI_GUIEVENTS_HH_
18 #define IGNITION_GAZEBO_GUI_GUIEVENTS_HH_
19 
20 #include <QEvent>
21 #include <utility>
22 #include <vector>
23 #include <ignition/math/Vector3.hh>
25 #include "ignition/gazebo/config.hh"
26 
27 namespace ignition
28 {
29 namespace gazebo
30 {
31 namespace gui {
32 // Inline bracket to help doxygen filtering.
33 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
36 namespace events
37 {
39  class SnapIntervals : public QEvent
40  {
45  public: SnapIntervals(
46  const math::Vector3d &_xyz,
47  const math::Vector3d &_rpy,
48  const math::Vector3d &_scale)
49  : QEvent(kType), xyz(_xyz), rpy(_rpy), scale(_scale)
50  {
51  }
52 
55  public: math::Vector3d XYZ() const
56  {
57  return this->xyz;
58  }
59 
62  public: math::Vector3d RPY() const
63  {
64  return this->rpy;
65  }
66 
69  public: math::Vector3d Scale() const
70  {
71  return this->scale;
72  }
73 
75  static const QEvent::Type kType = QEvent::Type(QEvent::User);
76 
78  private: math::Vector3d xyz;
79 
81  private: math::Vector3d rpy;
82 
85  private: math::Vector3d scale;
86  };
87 
89  class EntitiesSelected : public QEvent
90  {
95  public: explicit EntitiesSelected(
96  const std::vector<Entity> &_entities, // NOLINT
97  bool _fromUser = false)
98  : QEvent(kType), entities(_entities), fromUser(_fromUser)
99  {
100  }
101 
104  public: std::vector<Entity> Data() const
105  {
106  return this->entities;
107  }
108 
111  public: bool FromUser() const
112  {
113  return this->fromUser;
114  }
115 
117  static const QEvent::Type kType = QEvent::Type(QEvent::User + 1);
118 
120  private: std::vector<Entity> entities;
121 
123  private: bool fromUser{false};
124  };
125 
127  class DeselectAllEntities : public QEvent
128  {
132  public: explicit DeselectAllEntities(bool _fromUser = false)
133  : QEvent(kType), fromUser(_fromUser)
134  {
135  }
136 
139  public: bool FromUser() const
140  {
141  return this->fromUser;
142  }
143 
145  static const QEvent::Type kType = QEvent::Type(QEvent::User + 2);
146 
148  private: bool fromUser{false};
149  };
150 
153  class Render : public QEvent
154  {
155  public: Render()
156  : QEvent(kType)
157  {
158  }
160  static const QEvent::Type kType = QEvent::Type(QEvent::User + 3);
161  };
162 } // namespace events
163 }
164 } // namespace gui
165 } // namespace gazebo
166 } // namespace ignition
167 
168 #endif // IGNITION_GAZEBO_GUI_GUIEVENTS_HH_
EntitiesSelected(const std::vector< Entity > &_entities, bool _fromUser=false)
Constructor.
Definition: GuiEvents.hh:95
math::Vector3d Scale() const
Get the scale snapping values.
Definition: GuiEvents.hh:69
Render()
Definition: GuiEvents.hh:155
SnapIntervals(const math::Vector3d &_xyz, const math::Vector3d &_rpy, const math::Vector3d &_scale)
Constructor.
Definition: GuiEvents.hh:45
DeselectAllEntities(bool _fromUser=false)
Constructor.
Definition: GuiEvents.hh:132
std::vector< Entity > Data() const
Get the data sent with the event.
Definition: GuiEvents.hh:104
math::Vector3d RPY() const
Get the RPY snapping values.
Definition: GuiEvents.hh:62
math::Vector3d XYZ() const
Get the XYZ snapping values.
Definition: GuiEvents.hh:55
Event that notifies when all entities have been deselected.
Definition: GuiEvents.hh:127
Event called in the render thread of a 3D scene. It&#39;s safe to make rendering calls in this event&#39;s ca...
Definition: GuiEvents.hh:153
Event that notifies when new entities have been selected.
Definition: GuiEvents.hh:89
The class for sending and receiving custom snap value events.
Definition: GuiEvents.hh:39
This library is part of the Ignition Robotics project.
bool FromUser() const
Get whether the event was generated by the user.
Definition: GuiEvents.hh:139
bool FromUser() const
Get whether the event was generated by the user.
Definition: GuiEvents.hh:111