GuiEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 _GUI_EVENTS_HH_
18 #define _GUI_EVENTS_HH_
19 
20 #include <string>
21 #include "gazebo/common/Event.hh"
22 #include "gazebo/msgs/msgs.hh"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
29  class GZ_GUI_VISIBLE Events
30  {
33  public: template<typename T>
35  { return createEntity.Connect(_subscriber); }
36 
38  public: static void DisconnectCreateEntity(
39  event::ConnectionPtr _subscriber)
40  { createEntity.Disconnect(_subscriber); }
41 
44  public: template<typename T>
45  static event::ConnectionPtr ConnectMoveMode(T _subscriber)
46  { return moveMode.Connect(_subscriber); }
47 
49  public: static void DisconnectMoveMode(event::ConnectionPtr _subscriber)
50  { moveMode.Disconnect(_subscriber); }
51 
54  public: template<typename T>
55  static event::ConnectionPtr ConnectManipMode(T _subscriber)
56  {return manipMode.Connect(_subscriber);}
57 
59  public: static void DisconnectManipMode(event::ConnectionPtr _subscriber)
60  {manipMode.Disconnect(_subscriber);}
61 
64  public: template<typename T>
65  static event::ConnectionPtr ConnectAlignMode(T _subscriber)
66  {return alignMode.Connect(_subscriber);}
67 
69  public: static void DisconnectAlignMode(event::ConnectionPtr _subscriber)
70  {alignMode.Disconnect(_subscriber);}
71 
74  public: template<typename T>
76  { return fullScreen.Connect(_subscriber); }
77 
79  public: static void DisconnectFullScreen(event::ConnectionPtr _subscriber)
80  { fullScreen.Disconnect(_subscriber); }
81 
84  public: template<typename T>
86  { return showToolbars.Connect(_subscriber); }
87 
90  _subscriber)
91  { showToolbars.Disconnect(_subscriber); }
92 
95  public: template<typename T>
96  static event::ConnectionPtr ConnectFPS(T _subscriber)
97  { return fps.Connect(_subscriber); }
98 
100  public: static void DisconnectFPS(event::ConnectionPtr _subscriber)
101  { fps.Disconnect(_subscriber); }
102 
105  public: template<typename T>
106  static event::ConnectionPtr ConnectOrbit(T _subscriber)
107  { return orbit.Connect(_subscriber); }
108 
110  public: static void DisconnectOrbit(event::ConnectionPtr _subscriber)
111  { orbit.Disconnect(_subscriber); }
112 
115  public: template<typename T>
116  static event::ConnectionPtr ConnectKeyPress(T _subscriber)
117  { return keyPress.Connect(_subscriber); }
118 
120  public: static void DisconnectKeyPress(event::ConnectionPtr _subscriber)
121  { keyPress.Disconnect(_subscriber); }
122 
125  public: template<typename T>
127  { return lightUpdate.Connect(_subscriber); }
128 
130  public: static void DisconnectLightUpdate(
131  event::ConnectionPtr _subscriber)
132  { lightUpdate.Disconnect(_subscriber); }
133 
136  public: template<typename T>
138  { return modelUpdate.Connect(_subscriber); }
139 
141  public: static void DisconnectModelUpdate(
142  event::ConnectionPtr _subscriber)
143  { modelUpdate.Disconnect(_subscriber); }
144 
147  public: template<typename T>
149  { return inputStepSize.Connect(_subscriber); }
150 
152  public: static void DisconnectInputStepSize(
153  event::ConnectionPtr _subscriber)
154  { inputStepSize.Disconnect(_subscriber); }
155 
158  public: template<typename T>
159  static event::ConnectionPtr ConnectFollow(T _subscriber)
160  { return follow.Connect(_subscriber); }
161 
163  public: static void DisconnectFollow(
164  event::ConnectionPtr _subscriber)
165  { follow.Disconnect(_subscriber); }
166 
169  public: template<typename T>
171  { return editModel.Connect(_subscriber); }
172 
174  public: static void DisconnectEditModel(
175  event::ConnectionPtr _subscriber)
176  { editModel.Disconnect(_subscriber); }
177 
180  public: template<typename T>
182  { return windowMode.Connect(_subscriber); }
183 
185  public: static void DisconnectWindowMode(
186  event::ConnectionPtr _subscriber)
187  { windowMode.Disconnect(_subscriber); }
188 
191  public: template<typename T>
193  { return mainWindowReady.Connect(_subscriber); }
194 
196  public: static void DisconnectMainWindowReady(
197  event::ConnectionPtr _subscriber)
198  { mainWindowReady.Disconnect(_subscriber); }
199 
202  public: template<typename T>
203  static event::ConnectionPtr ConnectLeftPaneVisibility
204  (T _subscriber)
205  { return leftPaneVisibility.Connect(_subscriber); }
206 
208  public: static void DisconnectLeftPaneVisibility(
209  event::ConnectionPtr _subscriber)
210  { leftPaneVisibility.Disconnect(_subscriber); }
211 
214  public: template<typename T>
216  { return scaleEntity.Connect(_subscriber); }
217 
219  public: static void DisconnectScaleEntity(
220  event::ConnectionPtr _subscriber)
221  { scaleEntity.Disconnect(_subscriber); }
222 
225 
228 
230  public: static event::EventT<void (std::string,
231  std::string, std::string, bool, bool)> alignMode;
232 
234  public: static event::EventT<void (std::string,
235  std::string)> createEntity;
236 
239 
242 
245 
248 
250  public: static event::EventT<void ()> fps;
251 
254 
258 
262 
266 
269 
272 
275 
278 
280  public: static event::EventT<void (const std::string &,
282  };
283  }
284 }
285 #endif
static event::EventT< void()> fps
An event to enable first-person-shooter view control.
Definition: GuiEvents.hh:250
static event::EventT< void(std::string, std::string, std::string, bool, bool)> alignMode
indicates the user is aligning objects
Definition: GuiEvents.hh:231
static void DisconnectLeftPaneVisibility(event::ConnectionPtr _subscriber)
Disconnect a signal to toggle the GUI&#39;s left hand pane signal.
Definition: GuiEvents.hh:208
static void DisconnectOrbit(event::ConnectionPtr _subscriber)
Disconnect a signal from the view Orbit signal.
Definition: GuiEvents.hh:110
static event::EventT< void(std::string)> keyPress
Event triggered when a key is pressed.
Definition: GuiEvents.hh:268
static void DisconnectEditModel(event::ConnectionPtr _subscriber)
Disconnect a signal from the edit model signal.
Definition: GuiEvents.hh:174
static event::ConnectionPtr ConnectScaleEntity(T _subscriber)
Connect a signal to the scale entity signal.
Definition: GuiEvents.hh:215
static event::ConnectionPtr ConnectManipMode(T _subscriber)
Connect a signal to the manip mode signal.
Definition: GuiEvents.hh:55
static event::EventT< void(bool)> showToolbars
An event to trigger show toolbars.
Definition: GuiEvents.hh:247
static event::EventT< void(const msgs::Model &)> modelUpdate
indicates a model has been updated
Definition: GuiEvents.hh:238
static event::ConnectionPtr ConnectWindowMode(T _subscriber)
Connect a signal to the window mode signal.
Definition: GuiEvents.hh:181
Forward declarations for the common classes.
Definition: Animation.hh:33
static void DisconnectWindowMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the window mode signal.
Definition: GuiEvents.hh:185
static event::EventT< void(int)> inputStepSize
Step size changed event.
Definition: GuiEvents.hh:271
static void DisconnectModelUpdate(event::ConnectionPtr _subscriber)
Disconnect a signal from the model update signal.
Definition: GuiEvents.hh:141
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
static event::ConnectionPtr ConnectModelUpdate(T _subscriber)
Connect a signal to the model update signal.
Definition: GuiEvents.hh:137
static event::EventT< void(std::string)> manipMode
indicates the user is manipulating an object
Definition: GuiEvents.hh:227
static event::EventT< void(bool)> leftPaneVisibility
Used to set whether the GUI&#39;s left pane is visible.
Definition: GuiEvents.hh:274
static event::ConnectionPtr ConnectShowToolbars(T _subscriber)
Connect a signal to the show toolbars signal.
Definition: GuiEvents.hh:85
static event::ConnectionPtr ConnectMainWindowReady(T _subscriber)
Connect a signal to the main window ready signal.
Definition: GuiEvents.hh:192
static event::EventT< void(const std::string &)> follow
Event triggered when the user follows a model.
Definition: GuiEvents.hh:257
static void DisconnectInputStepSize(event::ConnectionPtr _subscriber)
Disconnect a signal from the input step size signal.
Definition: GuiEvents.hh:152
static event::ConnectionPtr ConnectOrbit(T _subscriber)
Connect a signal to the view Orbit signal.
Definition: GuiEvents.hh:106
static event::EventT< void(bool)> moveMode
Indicates the user is moving the camera.
Definition: GuiEvents.hh:224
static event::ConnectionPtr ConnectEditModel(T _subscriber)
Connect a signal to the edit model signal.
Definition: GuiEvents.hh:170
static void DisconnectKeyPress(event::ConnectionPtr _subscriber)
Disconnect a signal from the view KeyPress signal.
Definition: GuiEvents.hh:120
static event::EventT< void()> orbit
An event to enable orbit view control.
Definition: GuiEvents.hh:253
static void DisconnectAlignMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the align mode signal.
Definition: GuiEvents.hh:69
static void DisconnectCreateEntity(event::ConnectionPtr _subscriber)
Disconnect a signal from add entity signal.
Definition: GuiEvents.hh:38
static event::EventT< void(const std::string &)> windowMode
Event triggered when changing window mode.
Definition: GuiEvents.hh:265
static event::EventT< void(const std::string &)> editModel
Event triggered when the user selects edit a model.
Definition: GuiEvents.hh:261
static event::EventT< void(bool)> fullScreen
An event to trigger full screen mode.
Definition: GuiEvents.hh:244
static void DisconnectScaleEntity(event::ConnectionPtr _subscriber)
Disconnect a signal from the scale entity signal.
Definition: GuiEvents.hh:219
static void DisconnectFullScreen(event::ConnectionPtr _subscriber)
Disconnect a signal from the fullscreen signal.
Definition: GuiEvents.hh:79
static event::ConnectionPtr ConnectFullScreen(T _subscriber)
Connect a signal to the fullscreen signal.
Definition: GuiEvents.hh:75
static void DisconnectLightUpdate(event::ConnectionPtr _subscriber)
Disconnect a signal from the light update signal.
Definition: GuiEvents.hh:130
static event::ConnectionPtr ConnectAlignMode(T _subscriber)
Connect a signal to the align mode signal.
Definition: GuiEvents.hh:65
static void DisconnectShowToolbars(event::ConnectionPtr _subscriber)
Disconnect a signal from the show toolbars signal.
Definition: GuiEvents.hh:89
static void DisconnectFollow(event::ConnectionPtr _subscriber)
Disconnect a signal from the follow signal.
Definition: GuiEvents.hh:163
static event::ConnectionPtr ConnectCreateEntity(T _subscriber)
Connect a signal the add entity signal.
Definition: GuiEvents.hh:34
static event::EventT< void(const std::string &, const math::Vector3 &)> scaleEntity
Scale entity event.
Definition: GuiEvents.hh:281
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
static void DisconnectMoveMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the move mode signal.
Definition: GuiEvents.hh:49
static event::ConnectionPtr ConnectInputStepSize(T _subscriber)
Connect a signal to the input step size signal.
Definition: GuiEvents.hh:148
static event::EventT< void(std::string, std::string)> createEntity
indicates an entity has been created
Definition: GuiEvents.hh:235
static void DisconnectMainWindowReady(event::ConnectionPtr _subscriber)
Disconnect a signal from the main window ready signal.
Definition: GuiEvents.hh:196
static event::ConnectionPtr ConnectLightUpdate(T _subscriber)
Connect a signal to the light update signal.
Definition: GuiEvents.hh:126
static event::ConnectionPtr ConnectFollow(T _subscriber)
Connect a signal to the follow signal.
Definition: GuiEvents.hh:159
Definition: GuiEvents.hh:29
static event::ConnectionPtr ConnectKeyPress(T _subscriber)
Connect a signal to the view KeyPress signal.
Definition: GuiEvents.hh:116
static void DisconnectFPS(event::ConnectionPtr _subscriber)
Disconnect a signal from the view FPS signal.
Definition: GuiEvents.hh:100
static void DisconnectManipMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the manip mode signal.
Definition: GuiEvents.hh:59
static event::ConnectionPtr ConnectFPS(T _subscriber)
Connect a signal to the view FPS signal.
Definition: GuiEvents.hh:96
static event::EventT< void()> mainWindowReady
Main window ready event.
Definition: GuiEvents.hh:277
static event::EventT< void(const msgs::Light &)> lightUpdate
An event to notify light updates.
Definition: GuiEvents.hh:241
static event::ConnectionPtr ConnectMoveMode(T _subscriber)
Connect a signal to the move mode signal.
Definition: GuiEvents.hh:45