GuiEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 GAZEBO_GUI_GUIEVENTS_HH_
18 #define GAZEBO_GUI_GUIEVENTS_HH_
19 
20 #include <string>
21 #include <ignition/math/Pose3.hh>
22 #include <ignition/math/Vector3.hh>
23 
24 #include "gazebo/common/Event.hh"
25 #include "gazebo/msgs/msgs.hh"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  class GZ_GUI_VISIBLE Events
33  {
36  public: template<typename T>
38  { return createEntity.Connect(_subscriber); }
39 
42  public: static void DisconnectCreateEntity(
43  event::ConnectionPtr _subscriber)
45  { createEntity.Disconnect(_subscriber->Id()); }
46 
49  public: template<typename T>
50  static event::ConnectionPtr ConnectMoveMode(T _subscriber)
51  { return moveMode.Connect(_subscriber); }
52 
55  public: static void DisconnectMoveMode(event::ConnectionPtr _subscriber)
57  { moveMode.Disconnect(_subscriber->Id()); }
58 
61  public: template<typename T>
62  static event::ConnectionPtr ConnectManipMode(T _subscriber)
63  {return manipMode.Connect(_subscriber);}
64 
67  public: static void DisconnectManipMode(event::ConnectionPtr _subscriber)
69  {manipMode.Disconnect(_subscriber->Id());}
70 
73  public: template<typename T>
74  static event::ConnectionPtr ConnectAlignMode(T _subscriber)
75  {return alignMode.Connect(_subscriber);}
76 
79  public: static void DisconnectAlignMode(event::ConnectionPtr _subscriber)
81  {alignMode.Disconnect(_subscriber->Id());}
82 
85  public: template<typename T>
87  { return fullScreen.Connect(_subscriber); }
88 
91  public: static void DisconnectFullScreen(event::ConnectionPtr _subscriber)
93  { fullScreen.Disconnect(_subscriber->Id()); }
94 
97  public: template<typename T>
99  { return showToolbars.Connect(_subscriber); }
100 
104  _subscriber)
105  GAZEBO_DEPRECATED(8.0)
106  { showToolbars.Disconnect(_subscriber->Id()); }
107 
110  public: template<typename T>
111  static event::ConnectionPtr ConnectFPS(T _subscriber)
112  { return fps.Connect(_subscriber); }
113 
116  public: static void DisconnectFPS(event::ConnectionPtr _subscriber)
117  GAZEBO_DEPRECATED(8.0)
118  { fps.Disconnect(_subscriber->Id()); }
119 
122  public: template<typename T>
123  static event::ConnectionPtr ConnectOrbit(T _subscriber)
124  { return orbit.Connect(_subscriber); }
125 
128  public: static void DisconnectOrbit(event::ConnectionPtr _subscriber)
129  GAZEBO_DEPRECATED(8.0)
130  { orbit.Disconnect(_subscriber->Id()); }
131 
134  public: template<typename T>
135  static event::ConnectionPtr ConnectKeyPress(T _subscriber)
136  { return keyPress.Connect(_subscriber); }
137 
140  public: static void DisconnectKeyPress(event::ConnectionPtr _subscriber)
141  GAZEBO_DEPRECATED(8.0)
142  { keyPress.Disconnect(_subscriber->Id()); }
143 
146  public: template<typename T>
148  { return lightUpdate.Connect(_subscriber); }
149 
152  public: static void DisconnectLightUpdate(
153  event::ConnectionPtr _subscriber)
154  GAZEBO_DEPRECATED(8.0)
155  { lightUpdate.Disconnect(_subscriber->Id()); }
156 
159  public: template<typename T>
161  { return modelUpdate.Connect(_subscriber); }
162 
165  public: static void DisconnectModelUpdate(
166  event::ConnectionPtr _subscriber)
167  GAZEBO_DEPRECATED(8.0)
168  { modelUpdate.Disconnect(_subscriber->Id()); }
169 
172  public: template<typename T>
174  { return inputStepSize.Connect(_subscriber); }
175 
178  public: static void DisconnectInputStepSize(
179  event::ConnectionPtr _subscriber)
180  GAZEBO_DEPRECATED(8.0)
181  { inputStepSize.Disconnect(_subscriber->Id()); }
182 
185  public: template<typename T>
186  static event::ConnectionPtr ConnectFollow(T _subscriber)
187  { return follow.Connect(_subscriber); }
188 
191  public: static void DisconnectFollow(
192  event::ConnectionPtr _subscriber)
193  GAZEBO_DEPRECATED(8.0)
194  { follow.Disconnect(_subscriber->Id()); }
195 
198  public: template<typename T>
200  { return editModel.Connect(_subscriber); }
201 
204  public: static void DisconnectEditModel(
205  event::ConnectionPtr _subscriber)
206  GAZEBO_DEPRECATED(8.0)
207  { editModel.Disconnect(_subscriber->Id()); }
208 
211  public: template<typename T>
213  { return windowMode.Connect(_subscriber); }
214 
217  public: static void DisconnectWindowMode(
218  event::ConnectionPtr _subscriber)
219  GAZEBO_DEPRECATED(8.0)
220  { windowMode.Disconnect(_subscriber->Id()); }
221 
224  public: template<typename T>
226  { return mainWindowReady.Connect(_subscriber); }
227 
230  public: static void DisconnectMainWindowReady(
231  event::ConnectionPtr _subscriber)
232  GAZEBO_DEPRECATED(8.0)
233  { mainWindowReady.Disconnect(_subscriber->Id()); }
234 
237  public: template<typename T>
238  static event::ConnectionPtr ConnectLeftPaneVisibility
239  (T _subscriber)
240  { return leftPaneVisibility.Connect(_subscriber); }
241 
244  public: static void DisconnectLeftPaneVisibility(
245  event::ConnectionPtr _subscriber)
246  GAZEBO_DEPRECATED(8.0)
247  { leftPaneVisibility.Disconnect(_subscriber->Id()); }
248 
251  public: template<typename T>
253  { return scaleEntity.Connect(_subscriber); }
254 
257  public: static void DisconnectScaleEntity(
258  event::ConnectionPtr _subscriber)
259  GAZEBO_DEPRECATED(8.0)
260  { scaleEntity.Disconnect(_subscriber->Id()); }
261 
264  public: template<typename T>
266  { return moveEntity.Connect(_subscriber); }
267 
270  public: static void DisconnectMoveEntity(
271  event::ConnectionPtr _subscriber)
272  GAZEBO_DEPRECATED(8.0)
273  { moveEntity.Disconnect(_subscriber->Id()); }
274 
277 
280 
282  public: static event::EventT<void (std::string,
283  std::string, std::string, bool, bool)> alignMode;
284 
286  public: static event::EventT<void (std::string,
287  std::string)> createEntity;
288 
291 
294 
297 
300 
302  public: static event::EventT<void ()> fps;
303 
306 
310 
314 
318 
321 
324 
327 
330 
332  public: static event::EventT<void (const std::string &,
333  const ignition::math::Vector3d &)> scaleEntity;
334 
337  public: static event::EventT<void (const std::string &,
338  const ignition::math::Pose3d &, const bool)> moveEntity;
339  };
340  }
341 }
342 #endif
static event::EventT< void()> fps
An event to enable first-person-shooter view control.
Definition: GuiEvents.hh:302
static event::EventT< void(std::string, std::string, std::string, bool, bool)> alignMode
indicates the user is aligning objects
Definition: GuiEvents.hh:283
static void DisconnectEditModel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the edit model signal.
Definition: GuiEvents.hh:204
static event::EventT< void(std::string)> keyPress
Event triggered when a key is pressed.
Definition: GuiEvents.hh:320
static event::ConnectionPtr ConnectScaleEntity(T _subscriber)
Connect a signal to the scale entity signal.
Definition: GuiEvents.hh:252
static void DisconnectKeyPress(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the view KeyPress signal.
Definition: GuiEvents.hh:140
static event::ConnectionPtr ConnectManipMode(T _subscriber)
Connect a signal to the manip mode signal.
Definition: GuiEvents.hh:62
static event::EventT< void(bool)> showToolbars
An event to trigger show toolbars.
Definition: GuiEvents.hh:299
static event::EventT< void(const msgs::Model &)> modelUpdate
indicates a model has been updated
Definition: GuiEvents.hh:290
static event::ConnectionPtr ConnectWindowMode(T _subscriber)
Connect a signal to the window mode signal.
Definition: GuiEvents.hh:212
Forward declarations for the common classes.
Definition: Animation.hh:33
static event::EventT< void(int)> inputStepSize
Step size changed event.
Definition: GuiEvents.hh:323
static event::ConnectionPtr ConnectModelUpdate(T _subscriber)
Connect a signal to the model update signal.
Definition: GuiEvents.hh:160
static event::EventT< void(std::string)> manipMode
indicates the user is manipulating an object
Definition: GuiEvents.hh:279
static event::EventT< void(bool)> leftPaneVisibility
Used to set whether the GUI&#39;s left pane is visible.
Definition: GuiEvents.hh:326
static void DisconnectScaleEntity(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the scale entity signal.
Definition: GuiEvents.hh:257
static void DisconnectCreateEntity(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from add entity signal.
Definition: GuiEvents.hh:42
static event::ConnectionPtr ConnectShowToolbars(T _subscriber)
Connect a signal to the show toolbars signal.
Definition: GuiEvents.hh:98
static event::ConnectionPtr ConnectMainWindowReady(T _subscriber)
Connect a signal to the main window ready signal.
Definition: GuiEvents.hh:225
static void DisconnectWindowMode(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the window mode signal.
Definition: GuiEvents.hh:217
static void DisconnectMoveEntity(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the move entity event.
Definition: GuiEvents.hh:270
static event::EventT< void(const std::string &)> follow
Event triggered when the user follows a model.
Definition: GuiEvents.hh:309
static void DisconnectLeftPaneVisibility(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal to toggle the GUI&#39;s left hand pane signal.
Definition: GuiEvents.hh:244
static void DisconnectFullScreen(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the fullscreen signal.
Definition: GuiEvents.hh:91
static event::ConnectionPtr ConnectOrbit(T _subscriber)
Connect a signal to the view Orbit signal.
Definition: GuiEvents.hh:123
static event::EventT< void(bool)> moveMode
Indicates the user is moving the camera.
Definition: GuiEvents.hh:276
static event::ConnectionPtr ConnectEditModel(T _subscriber)
Connect a signal to the edit model signal.
Definition: GuiEvents.hh:199
static void DisconnectAlignMode(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the align mode signal.
Definition: GuiEvents.hh:79
static void DisconnectMoveMode(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the move mode signal.
Definition: GuiEvents.hh:55
static event::EventT< void()> orbit
An event to enable orbit view control.
Definition: GuiEvents.hh:305
static void DisconnectModelUpdate(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the model update signal.
Definition: GuiEvents.hh:165
static event::ConnectionPtr ConnectMoveEntity(T _subscriber)
Connect a signal to the move entity event.
Definition: GuiEvents.hh:265
static event::EventT< void(const std::string &)> windowMode
Event triggered when changing window mode.
Definition: GuiEvents.hh:317
static event::EventT< void(const std::string &)> editModel
Event triggered when the user selects edit a model.
Definition: GuiEvents.hh:313
static event::EventT< void(bool)> fullScreen
An event to trigger full screen mode.
Definition: GuiEvents.hh:296
static event::EventT< void(const std::string &, const ignition::math::Pose3d &, const bool)> moveEntity
Move entity event.
Definition: GuiEvents.hh:338
static event::ConnectionPtr ConnectFullScreen(T _subscriber)
Connect a signal to the fullscreen signal.
Definition: GuiEvents.hh:86
static void DisconnectManipMode(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the manip mode signal.
Definition: GuiEvents.hh:67
static event::ConnectionPtr ConnectAlignMode(T _subscriber)
Connect a signal to the align mode signal.
Definition: GuiEvents.hh:74
static event::ConnectionPtr ConnectCreateEntity(T _subscriber)
Connect a signal the add entity signal.
Definition: GuiEvents.hh:37
static event::EventT< void(const std::string &, const ignition::math::Vector3d &)> scaleEntity
Scale entity event.
Definition: GuiEvents.hh:333
static void DisconnectInputStepSize(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the input step size signal.
Definition: GuiEvents.hh:178
static void DisconnectLightUpdate(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the light update signal.
Definition: GuiEvents.hh:152
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
static void DisconnectOrbit(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the view Orbit signal.
Definition: GuiEvents.hh:128
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
static event::ConnectionPtr ConnectInputStepSize(T _subscriber)
Connect a signal to the input step size signal.
Definition: GuiEvents.hh:173
static void DisconnectMainWindowReady(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the main window ready signal.
Definition: GuiEvents.hh:230
static event::EventT< void(std::string, std::string)> createEntity
indicates an entity has been created
Definition: GuiEvents.hh:287
static event::ConnectionPtr ConnectLightUpdate(T _subscriber)
Connect a signal to the light update signal.
Definition: GuiEvents.hh:147
static void DisconnectShowToolbars(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the show toolbars signal.
Definition: GuiEvents.hh:103
static event::ConnectionPtr ConnectFollow(T _subscriber)
Connect a signal to the follow signal.
Definition: GuiEvents.hh:186
Definition: GuiEvents.hh:32
static event::ConnectionPtr ConnectKeyPress(T _subscriber)
Connect a signal to the view KeyPress signal.
Definition: GuiEvents.hh:135
static void DisconnectFPS(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the view FPS signal.
Definition: GuiEvents.hh:116
static event::ConnectionPtr ConnectFPS(T _subscriber)
Connect a signal to the view FPS signal.
Definition: GuiEvents.hh:111
static event::EventT< void()> mainWindowReady
Main window ready event.
Definition: GuiEvents.hh:329
static event::EventT< void(const msgs::Light &)> lightUpdate
An event to notify light updates.
Definition: GuiEvents.hh:293
static event::ConnectionPtr ConnectMoveMode(T _subscriber)
Connect a signal to the move mode signal.
Definition: GuiEvents.hh:50
static void DisconnectFollow(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a signal from the follow signal.
Definition: GuiEvents.hh:191