ModelEditorEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-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 _MODEL_EDITOR_EVENTS_HH_
18 #define _MODEL_EDITOR_EVENTS_HH_
19 
20 #include <string>
21 #include "gazebo/math/Pose.hh"
22 #include "gazebo/common/Event.hh"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
29  namespace model
30  {
32  {
36  public: template<typename T>
38  { return finishModel.Connect(_subscriber); }
39 
42  public: static void DisconnectFinishModel(
43  event::ConnectionPtr _subscriber)
44  { finishModel.Disconnect(_subscriber); }
45 
49  public: template<typename T>
51  { return saveModelEditor.Connect(_subscriber); }
52 
55  public: static void DisconnectSaveModelEditor(
56  event::ConnectionPtr _subscriber)
57  { saveModelEditor.Disconnect(_subscriber); }
58 
62  public: template<typename T>
64  { return saveAsModelEditor.Connect(_subscriber); }
65 
68  public: static void DisconnectSaveAsModelEditor(
69  event::ConnectionPtr _subscriber)
70  { saveAsModelEditor.Disconnect(_subscriber); }
71 
75  public: template<typename T>
77  { return newModelEditor.Connect(_subscriber); }
78 
81  public: static void DisconnectNewModelEditor(
82  event::ConnectionPtr _subscriber)
83  { newModelEditor.Disconnect(_subscriber); }
84 
88  public: template<typename T>
90  { return exitModelEditor.Connect(_subscriber); }
91 
94  public: static void DisconnectExitModelEditor(
95  event::ConnectionPtr _subscriber)
96  { exitModelEditor.Disconnect(_subscriber); }
97 
101  public: template<typename T>
103  { return modelChanged.Connect(_subscriber); }
104 
107  public: static void DisconnectModelChanged(
108  event::ConnectionPtr _subscriber)
109  { modelChanged.Disconnect(_subscriber); }
110 
114  public: template<typename T>
116  { return modelNameChanged.Connect(_subscriber); }
117 
120  public: static void DisconnectModelNameChanged(
121  event::ConnectionPtr _subscriber)
122  { modelNameChanged.Disconnect(_subscriber); }
123 
128  public: template<typename T>
129  static event::ConnectionPtr
131  { return modelPropertiesChanged.Connect(_subscriber); }
132 
136  public: static void DisconnectModelPropertiesChanged(
137  event::ConnectionPtr _subscriber)
138  { modelPropertiesChanged.Disconnect(_subscriber); }
139 
143  public: template<typename T>
145  { return saveModel.Connect(_subscriber); }
146 
149  public: static void DisconnectSaveModel(
150  event::ConnectionPtr _subscriber)
151  { saveModel.Disconnect(_subscriber); }
152 
156  public: template<typename T>
157  static event::ConnectionPtr ConnectNewModel(T _subscriber)
158  { return newModel.Connect(_subscriber); }
159 
162  public: static void DisconnectNewModel(
163  event::ConnectionPtr _subscriber)
164  { newModel.Disconnect(_subscriber); }
165 
169  public: template<typename T>
171  { return linkInserted.Connect(_subscriber); }
172 
175  public: static void DisconnectLinkInserted(
176  event::ConnectionPtr _subscriber)
177  { linkInserted.Disconnect(_subscriber); }
178 
182  public: template<typename T>
184  { return jointInserted.Connect(_subscriber); }
185 
188  public: static void DisconnectJointInserted(
189  event::ConnectionPtr _subscriber)
190  { jointInserted.Disconnect(_subscriber); }
191 
195  public: template<typename T>
197  { return linkRemoved.Connect(_subscriber); }
198 
201  public: static void DisconnectLinkRemoved(
202  event::ConnectionPtr _subscriber)
203  { linkRemoved.Disconnect(_subscriber); }
204 
208  public: template<typename T>
210  { return jointRemoved.Connect(_subscriber); }
211 
214  public: static void DisconnectJointRemoved(
215  event::ConnectionPtr _subscriber)
216  { jointRemoved.Disconnect(_subscriber); }
217 
221  public: template<typename T>
223  { return openLinkInspector.Connect(_subscriber); }
224 
228  public: static void DisconnectOpenLinkInspector(
229  event::ConnectionPtr _subscriber)
230  { openLinkInspector.Disconnect(_subscriber); }
231 
235  public: template<typename T>
237  { return openJointInspector.Connect(_subscriber); }
238 
242  public: static void DisconnectOpenJointInspector(
243  event::ConnectionPtr _subscriber)
244  { openJointInspector.Disconnect(_subscriber); }
245 
249  public: template<typename T>
251  { return jointNameChanged.Connect(_subscriber); }
252 
255  public: static void DisconnectJointNameChanged(
256  event::ConnectionPtr _subscriber)
257  { jointNameChanged.Disconnect(_subscriber); }
258 
262  public: template<typename T> static event::ConnectionPtr
264  { return showLinkContextMenu.Connect(_subscriber); }
265 
269  public: static void DisconnectShowLinkContextMenu(
270  event::ConnectionPtr _subscriber)
271  { showLinkContextMenu.Disconnect(_subscriber); }
272 
276  public: template<typename T> static event::ConnectionPtr
278  { return showJointContextMenu.Connect(_subscriber); }
279 
283  public: static void DisconnectShowJointContextMenu(
284  event::ConnectionPtr _subscriber)
285  { showJointContextMenu.Disconnect(_subscriber); }
286 
290  public: template<typename T> static event::ConnectionPtr
291  ConnectSetSelectedLink(T _subscriber)
292  { return setSelectedLink.Connect(_subscriber); }
293 
296  public: static void DisconnectSetSelectedLink(
297  event::ConnectionPtr _subscriber)
298  { setSelectedLink.Disconnect(_subscriber); }
299 
303  public: template<typename T> static event::ConnectionPtr
304  ConnectSetSelectedJoint(T _subscriber)
305  { return setSelectedJoint.Connect(_subscriber); }
306 
309  public: static void DisconnectSetSelectedJoint(
310  event::ConnectionPtr _subscriber)
311  { setSelectedJoint.Disconnect(_subscriber); }
312 
315 
318 
321 
324 
327 
330 
333 
335  // The properties are: is_static, auto_disable, pose, name.
336  public: static event::EventT<void (bool, bool, const math::Pose &,
337  const std::string &)> modelPropertiesChanged;
338 
341 
344 
347 
352  public: static event::EventT<void (std::string, std::string,
353  std::string, std::string)> jointInserted;
354 
357 
360 
363 
366 
372 
375 
378 
381 
384  };
385  }
386  }
387 }
388 #endif
static event::ConnectionPtr ConnectModelNameChanged(T _subscriber)
Connect a Gazebo event to the name changed signal.
Definition: ModelEditorEvents.hh:115
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
static event::EventT< void(std::string, std::string, std::string, std::string)> jointInserted
Notify that a joint has been inserted.
Definition: ModelEditorEvents.hh:353
static event::ConnectionPtr ConnectSaveModel(T _subscriber)
Connect a Gazebo event to the save model signal.
Definition: ModelEditorEvents.hh:144
static event::EventT< void(std::string)> saveModel
Notify that model has been saved.
Definition: ModelEditorEvents.hh:340
static event::EventT< void(std::string)> showLinkContextMenu
Request to show the link context menu.
Definition: ModelEditorEvents.hh:374
static event::ConnectionPtr ConnectOpenLinkInspector(T _subscriber)
Connect a Gazebo event to the open link inspector signal.
Definition: ModelEditorEvents.hh:222
static void DisconnectOpenJointInspector(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the open joint inspector signal.
Definition: ModelEditorEvents.hh:242
static event::ConnectionPtr ConnectOpenJointInspector(T _subscriber)
Connect a Gazebo event to the open joint inspector signal.
Definition: ModelEditorEvents.hh:236
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
static void DisconnectJointNameChanged(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the joint name changed signal.
Definition: ModelEditorEvents.hh:255
static event::EventT< bool()> saveModelEditor
Request to save the model.
Definition: ModelEditorEvents.hh:317
static event::EventT< void(std::string)> openJointInspector
Request to open the joint inspector.
Definition: ModelEditorEvents.hh:365
static event::EventT< void(std::string)> linkRemoved
Notify that a link has been removed.
Definition: ModelEditorEvents.hh:356
static event::EventT< void(std::string, std::string)> jointNameChanged
Notify that the joint name has been changed.
Definition: ModelEditorEvents.hh:371
static event::ConnectionPtr ConnectNewModel(T _subscriber)
Connect a Gazebo event to the new model signal.
Definition: ModelEditorEvents.hh:157
static void DisconnectFinishModel(event::ConnectionPtr _subscriber)
Disconnect a boost::slot to the finish model signal.
Definition: ModelEditorEvents.hh:42
static void DisconnectSetSelectedJoint(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the set selected joint signal.
Definition: ModelEditorEvents.hh:309
static event::EventT< void(std::string, bool)> setSelectedLink
Request to select or deselect a link.
Definition: ModelEditorEvents.hh:380
Definition: ModelEditorEvents.hh:31
static event::EventT< void()> newModelEditor
Request to start a new model.
Definition: ModelEditorEvents.hh:323
static event::EventT< void(std::string)> jointRemoved
Notify that a joint has been removed.
Definition: ModelEditorEvents.hh:359
static event::ConnectionPtr ConnectSetSelectedJoint(T _subscriber)
Connect a Gazebo event to the set selected joint signal.
Definition: ModelEditorEvents.hh:304
static void DisconnectJointRemoved(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the joint removed signal.
Definition: ModelEditorEvents.hh:214
static void DisconnectLinkInserted(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the link inserted signal.
Definition: ModelEditorEvents.hh:175
static event::ConnectionPtr ConnectJointNameChanged(T _subscriber)
Connect a Gazebo event to the joint name changed signal.
Definition: ModelEditorEvents.hh:250
static void DisconnectSaveModelEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the save signal.
Definition: ModelEditorEvents.hh:55
static void DisconnectShowJointContextMenu(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the show joint context menu signal.
Definition: ModelEditorEvents.hh:283
static event::EventT< void()> finishModel
A model has been completed and uploaded onto the server.
Definition: ModelEditorEvents.hh:314
static event::EventT< void(std::string, bool)> setSelectedJoint
Request to select or deselect a joint.
Definition: ModelEditorEvents.hh:383
static void DisconnectNewModelEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the new signal.
Definition: ModelEditorEvents.hh:81
static void DisconnectShowLinkContextMenu(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the show link context menu signal.
Definition: ModelEditorEvents.hh:269
static event::EventT< void(std::string)> showJointContextMenu
Request to show the joint context menu.
Definition: ModelEditorEvents.hh:377
static event::ConnectionPtr ConnectLinkRemoved(T _subscriber)
Connect a Gazebo event to the link removed signal.
Definition: ModelEditorEvents.hh:196
static void DisconnectModelChanged(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the model changed signal.
Definition: ModelEditorEvents.hh:107
static void DisconnectModelPropertiesChanged(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the model properties changed signal.
Definition: ModelEditorEvents.hh:136
static event::EventT< void(bool, bool, const math::Pose &, const std::string &)> modelPropertiesChanged
Notify that model properties have been changed.
Definition: ModelEditorEvents.hh:337
static event::ConnectionPtr ConnectSetSelectedLink(T _subscriber)
Connect a Gazebo event to the set selected link signal.
Definition: ModelEditorEvents.hh:291
static event::ConnectionPtr ConnectFinishModel(T _subscriber)
Connect a boost::slot to the finish model signal.
Definition: ModelEditorEvents.hh:37
static void DisconnectSaveAsModelEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the save as signal.
Definition: ModelEditorEvents.hh:68
static event::ConnectionPtr ConnectSaveModelEditor(T _subscriber)
Connect a Gazebo event to the save signal.
Definition: ModelEditorEvents.hh:50
static void DisconnectExitModelEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the exit signal.
Definition: ModelEditorEvents.hh:94
static event::EventT< void(std::string)> linkInserted
Notify that a link has been inserted.
Definition: ModelEditorEvents.hh:346
static event::EventT< void()> exitModelEditor
Request to exit the editor.
Definition: ModelEditorEvents.hh:326
static event::ConnectionPtr ConnectShowLinkContextMenu(T _subscriber)
Connect a Gazebo event to the show link context menu signal.
Definition: ModelEditorEvents.hh:263
static void DisconnectNewModel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the new model signal.
Definition: ModelEditorEvents.hh:162
static event::ConnectionPtr ConnectLinkInserted(T _subscriber)
Connect a Gazebo event to the link inserted signal.
Definition: ModelEditorEvents.hh:170
static event::EventT< void(std::string)> openLinkInspector
Request to open the link inspector.
Definition: ModelEditorEvents.hh:362
static event::EventT< void(std::string)> modelNameChanged
Name was changed in the editor palette.
Definition: ModelEditorEvents.hh:332
static event::ConnectionPtr ConnectExitModelEditor(T _subscriber)
Connect a Gazebo event to the exit signal.
Definition: ModelEditorEvents.hh:89
static event::ConnectionPtr ConnectShowJointContextMenu(T _subscriber)
Connect a Gazebo event to the show joint context menu signal.
Definition: ModelEditorEvents.hh:277
static event::ConnectionPtr ConnectJointRemoved(T _subscriber)
Connect a Gazebo event to the joint removed signal.
Definition: ModelEditorEvents.hh:209
static event::ConnectionPtr ConnectSaveAsModelEditor(T _subscriber)
Connect a Gazebo event to the save as signal.
Definition: ModelEditorEvents.hh:63
static event::ConnectionPtr ConnectModelChanged(T _subscriber)
Connect a Gazebo event to the model changed signal.
Definition: ModelEditorEvents.hh:102
static void DisconnectModelNameChanged(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the name changed signal.
Definition: ModelEditorEvents.hh:120
#define GZ_GUI_MODEL_VISIBLE
Definition: system.hh:418
static void DisconnectSaveModel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the save model signal.
Definition: ModelEditorEvents.hh:149
static void DisconnectLinkRemoved(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the link removed signal.
Definition: ModelEditorEvents.hh:201
static event::ConnectionPtr ConnectModelPropertiesChanged(T _subscriber)
Connect a Gazebo event to the model properties changed signal.
Definition: ModelEditorEvents.hh:130
static event::EventT< void()> newModel
Notify that model has been newed.
Definition: ModelEditorEvents.hh:343
static event::ConnectionPtr ConnectNewModelEditor(T _subscriber)
Connect a Gazebo event to the new signal.
Definition: ModelEditorEvents.hh:76
static void DisconnectJointInserted(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the joint inserted signal.
Definition: ModelEditorEvents.hh:188
static void DisconnectOpenLinkInspector(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the open link inspector signal.
Definition: ModelEditorEvents.hh:228
static event::EventT< void()> modelChanged
Model has been changed.
Definition: ModelEditorEvents.hh:329
static event::ConnectionPtr ConnectJointInserted(T _subscriber)
Connect a Gazebo event to the joint inserted signal.
Definition: ModelEditorEvents.hh:183
static event::EventT< bool()> saveAsModelEditor
Request to save the model as.
Definition: ModelEditorEvents.hh:320
static void DisconnectSetSelectedLink(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the set selected link signal.
Definition: ModelEditorEvents.hh:296