Ignition Gazebo

API Reference

6.0.0~pre1
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 <string>
22 #include <utility>
23 #include <vector>
24 #include <ignition/math/Vector3.hh>
26 #include "ignition/gazebo/config.hh"
27 
28 namespace ignition
29 {
30 namespace gazebo
31 {
32 namespace gui {
33 // Inline bracket to help doxygen filtering.
34 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
37 namespace events
38 {
40  class EntitiesSelected : public QEvent
41  {
46  public: explicit EntitiesSelected(
47  const std::vector<Entity> &_entities, // NOLINT
48  bool _fromUser = false)
49  : QEvent(kType), entities(_entities), fromUser(_fromUser)
50  {
51  }
52 
55  public: std::vector<Entity> Data() const
56  {
57  return this->entities;
58  }
59 
62  public: bool FromUser() const
63  {
64  return this->fromUser;
65  }
66 
68  static const QEvent::Type kType = QEvent::Type(QEvent::User + 1);
69 
71  private: std::vector<Entity> entities;
72 
74  private: bool fromUser{false};
75  };
76 
78  class DeselectAllEntities : public QEvent
79  {
83  public: explicit DeselectAllEntities(bool _fromUser = false)
84  : QEvent(kType), fromUser(_fromUser)
85  {
86  }
87 
90  public: bool FromUser() const
91  {
92  return this->fromUser;
93  }
94 
96  static const QEvent::Type kType = QEvent::Type(QEvent::User + 2);
97 
99  private: bool fromUser{false};
100  };
101 
104  class TransformControlModeActive : public QEvent
105  {
108  public: explicit TransformControlModeActive(const bool _tranformModeActive)
109  : QEvent(kType), tranformModeActive(_tranformModeActive)
110  {
111  }
112 
114  static const QEvent::Type kType = QEvent::Type(QEvent::User + 6);
115 
117  public: bool TransformControlActive()
118  {
119  return this->tranformModeActive;
120  }
121 
123  private: bool tranformModeActive;
124  };
125 } // namespace events
126 }
127 } // namespace gui
128 } // namespace gazebo
129 } // namespace ignition
130 
131 #endif // IGNITION_GAZEBO_GUI_GUIEVENTS_HH_
EntitiesSelected(const std::vector< Entity > &_entities, bool _fromUser=false)
Constructor.
Definition: GuiEvents.hh:46
DeselectAllEntities(bool _fromUser=false)
Constructor.
Definition: GuiEvents.hh:83
std::vector< Entity > Data() const
Get the data sent with the event.
Definition: GuiEvents.hh:55
bool TransformControlActive()
Get the event&#39;s value.
Definition: GuiEvents.hh:117
Event that notifies when all entities have been deselected.
Definition: GuiEvents.hh:78
True if a transform control is currently active (translate / rotate / scale). False if we&#39;re in selec...
Definition: GuiEvents.hh:104
Event that notifies when new entities have been selected.
Definition: GuiEvents.hh:40
TransformControlModeActive(const bool _tranformModeActive)
Constructor.
Definition: GuiEvents.hh:108
This library is part of the Ignition Robotics project.
bool FromUser() const
Get whether the event was generated by the user.
Definition: GuiEvents.hh:90
bool FromUser() const
Get whether the event was generated by the user.
Definition: GuiEvents.hh:62