GuiEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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  {
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 mainWindowReady.Connect(_subscriber); }
183 
185  public: static void DisconnectMainWindowReady(
186  event::ConnectionPtr _subscriber)
187  { mainWindowReady.Disconnect(_subscriber); }
188 
191  public: template<typename T>
192  static event::ConnectionPtr ConnectLeftPaneVisibility
193  (T _subscriber)
194  { return leftPaneVisibility.Connect(_subscriber); }
195 
197  public: static void DisconnectLeftPaneVisibility(
198  event::ConnectionPtr _subscriber)
199  { leftPaneVisibility.Disconnect(_subscriber); }
200 
203  public: template<typename T>
205  { return scaleEntity.Connect(_subscriber); }
206 
208  public: static void DisconnectScaleEntity(
209  event::ConnectionPtr _subscriber)
210  { scaleEntity.Disconnect(_subscriber); }
211 
214 
217 
219  public: static event::EventT<void (std::string,
220  std::string, std::string, bool)> alignMode;
221 
223  public: static event::EventT<void (std::string,
224  std::string)> createEntity;
225 
228 
231 
234 
237 
239  public: static event::EventT<void ()> fps;
240 
243 
247 
251 
254 
257 
260 
263 
265  public: static event::EventT<void (const std::string &,
267  };
268  }
269 }
270 #endif
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
static event::ConnectionPtr ConnectManipMode(T _subscriber)
Connect a signal to the manip mode signal.
Definition: GuiEvents.hh:55
static event::ConnectionPtr ConnectInputStepSize(T _subscriber)
Connect a signal to the input step size signal.
Definition: GuiEvents.hh:148
static event::ConnectionPtr ConnectOrbit(T _subscriber)
Connect a signal to the view Orbit signal.
Definition: GuiEvents.hh:106
static void DisconnectFollow(event::ConnectionPtr _subscriber)
Disconnect a signal from the follow signal.
Definition: GuiEvents.hh:163
static void DisconnectFullScreen(event::ConnectionPtr _subscriber)
Disconnect a signal from the fullscreen signal.
Definition: GuiEvents.hh:79
static event::EventT< void(const std::string &, const math::Vector3 &)> scaleEntity
Scale entity event.
Definition: GuiEvents.hh:266
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
static void DisconnectMainWindowReady(event::ConnectionPtr _subscriber)
Disconnect a signal from the main window ready signal.
Definition: GuiEvents.hh:185
static void DisconnectAlignMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the align mode signal.
Definition: GuiEvents.hh:69
static event::EventT< void(bool)> leftPaneVisibility
Used to set whether the GUI's left pane is visible.
Definition: GuiEvents.hh:259
static event::EventT< void()> fps
An event to enable first-person-shooter view control.
Definition: GuiEvents.hh:239
static event::ConnectionPtr ConnectEditModel(T _subscriber)
Connect a signal to the edit model signal.
Definition: GuiEvents.hh:170
static void DisconnectCreateEntity(event::ConnectionPtr _subscriber)
Disconnect a signal from add entity signal.
Definition: GuiEvents.hh:38
static event::EventT< void()> orbit
An event to enable orbit view control.
Definition: GuiEvents.hh:242
static void DisconnectScaleEntity(event::ConnectionPtr _subscriber)
Disconnect a signal from the scale entity signal.
Definition: GuiEvents.hh:208
static void DisconnectManipMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the manip mode signal.
Definition: GuiEvents.hh:59
static event::ConnectionPtr ConnectFullScreen(T _subscriber)
Connect a signal to the fullscreen signal.
Definition: GuiEvents.hh:75
static event::EventT< void(const msgs::Model &)> modelUpdate
indicates a model has been updated
Definition: GuiEvents.hh:227
static event::EventT< void(std::string, std::string, std::string, bool)> alignMode
indicates the user is aligning objects
Definition: GuiEvents.hh:220
static event::ConnectionPtr ConnectLightUpdate(T _subscriber)
Connect a signal to the light update signal.
Definition: GuiEvents.hh:126
static event::EventT< void(const std::string &)> follow
Event triggered when the user follows a model.
Definition: GuiEvents.hh:246
static event::ConnectionPtr ConnectCreateEntity(T _subscriber)
Connect a signal the add entity signal.
Definition: GuiEvents.hh:34
static event::EventT< void(std::string)> keyPress
Event triggered when a key is pressed.
Definition: GuiEvents.hh:253
static event::EventT< void(int)> inputStepSize
Step size changed event.
Definition: GuiEvents.hh:256
static void DisconnectShowToolbars(event::ConnectionPtr _subscriber)
Disconnect a signal from the show toolbars signal.
Definition: GuiEvents.hh:89
static void DisconnectInputStepSize(event::ConnectionPtr _subscriber)
Disconnect a signal from the input step size signal.
Definition: GuiEvents.hh:152
static event::ConnectionPtr ConnectModelUpdate(T _subscriber)
Connect a signal to the model update signal.
Definition: GuiEvents.hh:137
static void DisconnectMoveMode(event::ConnectionPtr _subscriber)
Disconnect a signal from the move mode signal.
Definition: GuiEvents.hh:49
static event::EventT< void(std::string, std::string)> createEntity
indicates an entity has been created
Definition: GuiEvents.hh:224
static void DisconnectOrbit(event::ConnectionPtr _subscriber)
Disconnect a signal from the view Orbit signal.
Definition: GuiEvents.hh:110
static event::EventT< void(bool)> fullScreen
An event to trigger full screen mode.
Definition: GuiEvents.hh:233
static void DisconnectLightUpdate(event::ConnectionPtr _subscriber)
Disconnect a signal from the light update signal.
Definition: GuiEvents.hh:130
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 event::EventT< void(bool)> showToolbars
An event to trigger show toolbars.
Definition: GuiEvents.hh:236
static event::ConnectionPtr ConnectMainWindowReady(T _subscriber)
Connect a signal to the main window ready signal.
Definition: GuiEvents.hh:181
static void DisconnectModelUpdate(event::ConnectionPtr _subscriber)
Disconnect a signal from the model update signal.
Definition: GuiEvents.hh:141
static event::EventT< void(std::string)> manipMode
indicates the user is manipulating an object
Definition: GuiEvents.hh:216
static event::EventT< void(const msgs::Light &)> lightUpdate
An event to notify light updates.
Definition: GuiEvents.hh:230
static event::ConnectionPtr ConnectMoveMode(T _subscriber)
Connect a signal to the move mode signal.
Definition: GuiEvents.hh:45
static void DisconnectLeftPaneVisibility(event::ConnectionPtr _subscriber)
Disconnect a signal to toggle the GUI's left hand pane signal.
Definition: GuiEvents.hh:197
Definition: GuiEvents.hh:29
static event::ConnectionPtr ConnectAlignMode(T _subscriber)
Connect a signal to the align mode signal.
Definition: GuiEvents.hh:65
static event::ConnectionPtr ConnectScaleEntity(T _subscriber)
Connect a signal to the scale entity signal.
Definition: GuiEvents.hh:204
static event::EventT< void()> mainWindowReady
Main window ready event.
Definition: GuiEvents.hh:262
static event::ConnectionPtr ConnectFPS(T _subscriber)
Connect a signal to the view FPS signal.
Definition: GuiEvents.hh:96
static event::EventT< void(bool)> moveMode
Indicates the user is moving the camera.
Definition: GuiEvents.hh:213
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
static void DisconnectEditModel(event::ConnectionPtr _subscriber)
Disconnect a signal from the edit model signal.
Definition: GuiEvents.hh:174
static event::ConnectionPtr ConnectShowToolbars(T _subscriber)
Connect a signal to the show toolbars signal.
Definition: GuiEvents.hh:85
static event::EventT< void(const std::string &)> editModel
Event triggered when the user selects edit a model.
Definition: GuiEvents.hh:250
static event::ConnectionPtr ConnectFollow(T _subscriber)
Connect a signal to the follow signal.
Definition: GuiEvents.hh:159
static void DisconnectKeyPress(event::ConnectionPtr _subscriber)
Disconnect a signal from the view KeyPress signal.
Definition: GuiEvents.hh:120