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>
85  static event::ConnectionPtr ConnectFPS(T _subscriber)
86  { return fps.Connect(_subscriber); }
87 
89  public: static void DisconnectFPS(event::ConnectionPtr _subscriber)
90  { fps.Disconnect(_subscriber); }
91 
94  public: template<typename T>
95  static event::ConnectionPtr ConnectOrbit(T _subscriber)
96  { return orbit.Connect(_subscriber); }
97 
99  public: static void DisconnectOrbit(event::ConnectionPtr _subscriber)
100  { orbit.Disconnect(_subscriber); }
101 
104  public: template<typename T>
105  static event::ConnectionPtr ConnectKeyPress(T _subscriber)
106  { return keyPress.Connect(_subscriber); }
107 
109  public: static void DisconnectKeyPress(event::ConnectionPtr _subscriber)
110  { keyPress.Disconnect(_subscriber); }
111 
114  public: template<typename T>
116  { return lightUpdate.Connect(_subscriber); }
117 
119  public: static void DisconnectLightUpdate(
120  event::ConnectionPtr _subscriber)
121  { lightUpdate.Disconnect(_subscriber); }
122 
125  public: template<typename T>
127  { return modelUpdate.Connect(_subscriber); }
128 
130  public: static void DisconnectModelUpdate(
131  event::ConnectionPtr _subscriber)
132  { modelUpdate.Disconnect(_subscriber); }
133 
136  public: template<typename T>
138  { return inputStepSize.Connect(_subscriber); }
139 
141  public: static void DisconnectInputStepSize(
142  event::ConnectionPtr _subscriber)
143  { inputStepSize.Disconnect(_subscriber); }
144 
147  public: template<typename T>
148  static event::ConnectionPtr ConnectFollow(T _subscriber)
149  { return follow.Connect(_subscriber); }
150 
152  public: static void DisconnectFollow(
153  event::ConnectionPtr _subscriber)
154  { follow.Disconnect(_subscriber); }
155 
158  public: template<typename T>
160  { return mainWindowReady.Connect(_subscriber); }
161 
163  public: static void DisconnectMainWindowReady(
164  event::ConnectionPtr _subscriber)
165  { mainWindowReady.Disconnect(_subscriber); }
166 
169  public: template<typename T>
170  static event::ConnectionPtr ConnectLeftPaneVisibility
171  (T _subscriber)
172  { return leftPaneVisibility.Connect(_subscriber); }
173 
175  public: static void DisconnectLeftPaneVisibility(
176  event::ConnectionPtr _subscriber)
177  { leftPaneVisibility.Disconnect(_subscriber); }
178 
181 
184 
186  public: static event::EventT<void (std::string,
187  std::string, std::string, bool)> alignMode;
188 
190  public: static event::EventT<void (std::string,
191  std::string)> createEntity;
192 
195 
198 
201 
203  public: static event::EventT<void ()> fps;
204 
207 
211 
214 
217 
220 
223  };
224  }
225 }
226 #endif
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:144
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:137
static event::ConnectionPtr ConnectOrbit(T _subscriber)
Connect a signal to the view Orbit signal.
Definition: GuiEvents.hh:95
static void DisconnectFollow(event::ConnectionPtr _subscriber)
Disconnect a signal from the follow signal.
Definition: GuiEvents.hh:152
static void DisconnectFullScreen(event::ConnectionPtr _subscriber)
Disconnect a signal from the fullscreen signal.
Definition: GuiEvents.hh:79
static void DisconnectMainWindowReady(event::ConnectionPtr _subscriber)
Disconnect a signal from the main window ready signal.
Definition: GuiEvents.hh:163
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:219
static event::EventT< void()> fps
An event to enable first-person-shooter view control.
Definition: GuiEvents.hh:203
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:206
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:194
static event::EventT< void(std::string, std::string, std::string, bool)> alignMode
indicates the user is aligning objects
Definition: GuiEvents.hh:187
static event::ConnectionPtr ConnectLightUpdate(T _subscriber)
Connect a signal to the light update signal.
Definition: GuiEvents.hh:115
static event::EventT< void(const std::string &)> follow
Event triggered when the user follows a model.
Definition: GuiEvents.hh:210
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:213
static event::EventT< void(int)> inputStepSize
Step size changed event.
Definition: GuiEvents.hh:216
static void DisconnectInputStepSize(event::ConnectionPtr _subscriber)
Disconnect a signal from the input step size signal.
Definition: GuiEvents.hh:141
static event::ConnectionPtr ConnectModelUpdate(T _subscriber)
Connect a signal to the model update signal.
Definition: GuiEvents.hh:126
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:191
static void DisconnectOrbit(event::ConnectionPtr _subscriber)
Disconnect a signal from the view Orbit signal.
Definition: GuiEvents.hh:99
static event::EventT< void(bool)> fullScreen
An event to trigger full screen mode.
Definition: GuiEvents.hh:200
static void DisconnectLightUpdate(event::ConnectionPtr _subscriber)
Disconnect a signal from the light update signal.
Definition: GuiEvents.hh:119
static event::ConnectionPtr ConnectKeyPress(T _subscriber)
Connect a signal to the view KeyPress signal.
Definition: GuiEvents.hh:105
static void DisconnectFPS(event::ConnectionPtr _subscriber)
Disconnect a signal from the view FPS signal.
Definition: GuiEvents.hh:89
static event::ConnectionPtr ConnectMainWindowReady(T _subscriber)
Connect a signal to the main window ready signal.
Definition: GuiEvents.hh:159
static void DisconnectModelUpdate(event::ConnectionPtr _subscriber)
Disconnect a signal from the model update signal.
Definition: GuiEvents.hh:130
static event::EventT< void(std::string)> manipMode
indicates the user is manipulating an object
Definition: GuiEvents.hh:183
static event::EventT< void(const msgs::Light &)> lightUpdate
An event to notify light updates.
Definition: GuiEvents.hh:197
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:175
Definition: GuiEvents.hh:29
static event::ConnectionPtr ConnectAlignMode(T _subscriber)
Connect a signal to the align mode signal.
Definition: GuiEvents.hh:65
static event::EventT< void()> mainWindowReady
Main window ready event.
Definition: GuiEvents.hh:222
static event::ConnectionPtr ConnectFPS(T _subscriber)
Connect a signal to the view FPS signal.
Definition: GuiEvents.hh:85
static event::EventT< void(bool)> moveMode
Indicates the user is moving the camera.
Definition: GuiEvents.hh:180
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
static event::ConnectionPtr ConnectFollow(T _subscriber)
Connect a signal to the follow signal.
Definition: GuiEvents.hh:148
static void DisconnectKeyPress(event::ConnectionPtr _subscriber)
Disconnect a signal from the view KeyPress signal.
Definition: GuiEvents.hh:109