BuildingEditorEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 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 _BUILDING_EDITOR_EVENTS_HH_
18 #define _BUILDING_EDITOR_EVENTS_HH_
19 
20 #include <string>
21 #include "gazebo/gui/qt.h"
22 #include "gazebo/common/Event.hh"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
29  namespace editor
30  {
31  class GZ_GUI_VISIBLE Events
32  {
36  public: template<typename T>
38  ConnectToggleEditMode(T _subscriber)
39  { return toggleEditMode.Connect(_subscriber); }
40 
44  public: static void DisconnectToggleEditMode(
45  event::ConnectionPtr _subscriber)
47  { toggleEditMode.Disconnect(_subscriber->Id()); }
48 
52  public: template<typename T>
55  { return createBuildingEditorItem.Connect(_subscriber); }
56 
61  event::ConnectionPtr _subscriber)
63  { createBuildingEditorItem.Disconnect(_subscriber->Id()); }
64 
68  public: template<typename T>
70  ConnectColorSelected(T _subscriber)
71  { return colorSelected.Connect(_subscriber); }
72 
76  public: static void DisconnectColorSelected(
77  event::ConnectionPtr _subscriber)
79  { colorSelected.Disconnect(_subscriber->Id()); }
80 
84  public: template<typename T>
86  ConnectTextureSelected(T _subscriber)
87  { return textureSelected.Connect(_subscriber); }
88 
92  public: static void DisconnectTextureSelected(
93  event::ConnectionPtr _subscriber)
95  { textureSelected.Disconnect(_subscriber->Id()); }
96 
100  public: template<typename T>
102  { return saveBuildingModel.Connect(_subscriber); }
103 
107  public: static void DisconnectSaveBuildingModel(
108  event::ConnectionPtr _subscriber)
109  GAZEBO_DEPRECATED(8.0)
110  { saveBuildingModel.Disconnect(_subscriber->Id()); }
111 
115  public: template<typename T>
116  static event::ConnectionPtr
118  { return finishBuildingModel.Connect(_subscriber); }
119 
123  public: static void DisconnectFinishBuildingModel(
124  event::ConnectionPtr _subscriber)
125  GAZEBO_DEPRECATED(8.0)
126  { finishBuildingModel.Disconnect(_subscriber->Id()); }
127 
131  public: template<typename T>
132  static event::ConnectionPtr
133  ConnectNewBuildingModel(T _subscriber)
134  { return newBuildingModel.Connect(_subscriber); }
135 
139  public: static void DisconnectNewBuildingModel(
140  event::ConnectionPtr _subscriber)
141  GAZEBO_DEPRECATED(8.0)
142  { newBuildingModel.Disconnect(_subscriber->Id()); }
143 
147  public: template<typename T>
148  static event::ConnectionPtr
150  { return changeBuildingLevel.Connect(_subscriber); }
151 
155  public: static void DisconnectChangeBuildingLevel(
156  event::ConnectionPtr _subscriber)
157  GAZEBO_DEPRECATED(8.0)
158  { changeBuildingLevel.Disconnect(_subscriber->Id()); }
159 
163  public: template<typename T>
165  { return addBuildingLevel.Connect(_subscriber); }
166 
170  public: static void DisconnectAddBuildingLevel(
171  event::ConnectionPtr _subscriber)
172  GAZEBO_DEPRECATED(8.0)
173  { addBuildingLevel.Disconnect(_subscriber->Id()); }
174 
178  public: template<typename T>
179  static event::ConnectionPtr
181  { return deleteBuildingLevel.Connect(_subscriber); }
182 
186  public: static void DisconnectDeleteBuildingLevel(
187  event::ConnectionPtr _subscriber)
188  GAZEBO_DEPRECATED(8.0)
189  { deleteBuildingLevel.Disconnect(_subscriber->Id()); }
190 
194  public: template<typename T>
196  { return showFloorplan.Connect(_subscriber); }
197 
201  public: static void DisconnectShowFloorplan(
202  event::ConnectionPtr _subscriber)
203  GAZEBO_DEPRECATED(8.0)
204  { showFloorplan.Disconnect(_subscriber->Id()); }
205 
210  public: template<typename T>
211  static event::ConnectionPtr
213  { return triggerShowFloorplan.Connect(_subscriber); }
214 
219  public: static void DisconnectTriggerShowFloorplan(
220  event::ConnectionPtr _subscriber)
221  GAZEBO_DEPRECATED(8.0)
222  { triggerShowFloorplan.Disconnect(_subscriber->Id()); }
223 
227  public: template<typename T>
229  { return showElements.Connect(_subscriber); }
230 
234  public: static void DisconnectShowElements(
235  event::ConnectionPtr _subscriber)
236  GAZEBO_DEPRECATED(8.0)
237  { showElements.Disconnect(_subscriber->Id()); }
238 
243  public: template<typename T>
244  static event::ConnectionPtr
246  { return triggerShowElements.Connect(_subscriber); }
247 
252  public: static void DisconnectTriggerShowElements(
253  event::ConnectionPtr _subscriber)
254  GAZEBO_DEPRECATED(8.0)
255  { triggerShowElements.Disconnect(_subscriber->Id()); }
256 
260  public: template<typename T>
261  static event::ConnectionPtr
263  { return updateLevelWidget.Connect(_subscriber); }
264 
268  public: static void DisconnectUpdateLevelWidget(
269  event::ConnectionPtr _subscriber)
270  GAZEBO_DEPRECATED(8.0)
271  { updateLevelWidget.Disconnect(_subscriber->Id()); }
272 
276  public: template<typename T>
277  static event::ConnectionPtr
279  { return changeBuildingEditorZoom.Connect(_subscriber); }
280 
285  event::ConnectionPtr _subscriber)
286  GAZEBO_DEPRECATED(8.0)
287  { changeBuildingEditorZoom.Disconnect(_subscriber->Id()); }
288 
292  public: template<typename T>
294  { return saveBuildingEditor.Connect(_subscriber); }
295 
299  public: static void DisconnectSaveBuildingEditor(
300  event::ConnectionPtr _subscriber)
301  GAZEBO_DEPRECATED(8.0)
302  { saveBuildingEditor.Disconnect(_subscriber->Id()); }
303 
307  public: template<typename T>
308  static event::ConnectionPtr ConnectSaveAsBuildingEditor
309  (T _subscriber)
310  { return saveAsBuildingEditor.Connect(_subscriber); }
311 
315  public: static void DisconnectSaveAsBuildingEditor(
316  event::ConnectionPtr _subscriber)
317  GAZEBO_DEPRECATED(8.0)
318  { saveAsBuildingEditor.Disconnect(_subscriber->Id()); }
319 
323  public: template<typename T>
324  static event::ConnectionPtr
326  { return newBuildingEditor.Connect(_subscriber); }
327 
331  public: static void DisconnectNewBuildingEditor(
332  event::ConnectionPtr _subscriber)
333  GAZEBO_DEPRECATED(8.0)
334  { newBuildingEditor.Disconnect(_subscriber->Id()); }
335 
339  public: template<typename T>
341  { return exitBuildingEditor.Connect(_subscriber); }
342 
346  public: static void DisconnectExitBuildingEditor(
347  event::ConnectionPtr _subscriber)
348  GAZEBO_DEPRECATED(8.0)
349  { exitBuildingEditor.Disconnect(_subscriber->Id()); }
350 
354  public: template<typename T>
355  static event::ConnectionPtr ConnectBuildingNameChanged
356  (T _subscriber)
357  { return buildingNameChanged.Connect(_subscriber); }
358 
362  public: static void DisconnectBuildingNameChanged(
363  event::ConnectionPtr _subscriber)
364  GAZEBO_DEPRECATED(8.0)
365  { buildingNameChanged.Disconnect(_subscriber->Id()); }
366 
369 
371  public: static event::EventT<void (std::string)>
373 
376 
379 
382 
385 
388 
391 
394 
397 
400 
403 
406 
409 
413 
416 
419 
422 
425 
428 
431  };
432  }
433  }
434 }
435 #endif
static void DisconnectChangeBuildingEditorZoom(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the change zoom level signal.
Definition: BuildingEditorEvents.hh:284
static void DisconnectBuildingNameChanged(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the name changed signal.
Definition: BuildingEditorEvents.hh:362
static event::EventT< void()> finishBuildingModel
A model has been completed and uploaded onto the server.
Definition: BuildingEditorEvents.hh:384
static event::ConnectionPtr ConnectColorSelected(T _subscriber)
Connect a Gazebo event to the color selected signal.
Definition: BuildingEditorEvents.hh:70
static void DisconnectToggleEditMode(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the toggle edit mode signal.
Definition: BuildingEditorEvents.hh:44
static event::EventT< void()> deleteBuildingLevel
A level has been deleted.
Definition: BuildingEditorEvents.hh:396
static void DisconnectDeleteBuildingLevel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the delete level signal.
Definition: BuildingEditorEvents.hh:186
static event::ConnectionPtr ConnectTriggerShowFloorplan(T _subscriber)
Connect a Gazebo event to the trigger show floorplan signal.
Definition: BuildingEditorEvents.hh:212
static void DisconnectExitBuildingEditor(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the exit signal.
Definition: BuildingEditorEvents.hh:346
static event::ConnectionPtr ConnectSaveBuildingModel(T _subscriber)
Connect a Gazebo event to the save model signal.
Definition: BuildingEditorEvents.hh:101
static event::EventT< void()> triggerShowFloorplan
Trigger show floorplan.
Definition: BuildingEditorEvents.hh:402
static void DisconnectSaveAsBuildingEditor(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the save as signal.
Definition: BuildingEditorEvents.hh:315
static void DisconnectCreateBuildingEditorItem(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the create editor item signal.
Definition: BuildingEditorEvents.hh:60
static event::EventT< void()> showFloorplan
Show or hide floorplan.
Definition: BuildingEditorEvents.hh:399
static event::EventT< void(int, std::string)> updateLevelWidget
The levels have been changed.
Definition: BuildingEditorEvents.hh:412
static void DisconnectShowElements(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the show elements signal.
Definition: BuildingEditorEvents.hh:234
static event::ConnectionPtr ConnectChangeBuildingEditorZoom(T _subscriber)
Connect a Gazebo event to the change zoom signal.
Definition: BuildingEditorEvents.hh:278
static void DisconnectTextureSelected(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the texture selected signal.
Definition: BuildingEditorEvents.hh:92
static event::EventT< void(bool)> toggleEditMode
Toggle if the edit mode was checked or not.
Definition: BuildingEditorEvents.hh:368
static event::EventT< void(std::string)> buildingNameChanged
Name was changed in the editor palette.
Definition: BuildingEditorEvents.hh:430
static void DisconnectAddBuildingLevel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the add level signal.
Definition: BuildingEditorEvents.hh:170
static event::EventT< void(std::string)> saveBuildingModel
A model has been saved with a name and a location.
Definition: BuildingEditorEvents.hh:381
static event::EventT< void()> triggerShowElements
Trigger show elements.
Definition: BuildingEditorEvents.hh:408
static event::EventT< void(QString)> textureSelected
A texture has been selected.
Definition: BuildingEditorEvents.hh:378
static event::ConnectionPtr ConnectTriggerShowElements(T _subscriber)
Connect a Gazebo event to the trigger show elements signal.
Definition: BuildingEditorEvents.hh:245
static event::EventT< void()> exitBuildingEditor
Exit the editor mode with the option to save.
Definition: BuildingEditorEvents.hh:427
static void DisconnectSaveBuildingModel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the save model signal.
Definition: BuildingEditorEvents.hh:107
static event::EventT< void()> newBuildingModel
A new model has been started.
Definition: BuildingEditorEvents.hh:387
static event::ConnectionPtr ConnectExitBuildingEditor(T _subscriber)
Connect a Gazebo event to the exit signal.
Definition: BuildingEditorEvents.hh:340
static event::ConnectionPtr ConnectTextureSelected(T _subscriber)
Connect a Gazebo event to the texture selected signal.
Definition: BuildingEditorEvents.hh:86
static event::ConnectionPtr ConnectShowElements(T _subscriber)
Connect a Gazebo event to the show elements signal.
Definition: BuildingEditorEvents.hh:228
static event::EventT< void(int)> changeBuildingLevel
The current level has been changed.
Definition: BuildingEditorEvents.hh:390
static void DisconnectSaveBuildingEditor(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the save signal.
Definition: BuildingEditorEvents.hh:299
static void DisconnectShowFloorplan(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the show floorplan signal.
Definition: BuildingEditorEvents.hh:201
static void DisconnectFinishBuildingModel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the finish model signal.
Definition: BuildingEditorEvents.hh:123
static event::EventT< void(std::string)> createBuildingEditorItem
An editor item is to be created.
Definition: BuildingEditorEvents.hh:372
static event::EventT< void()> newBuildingEditor
Make a new model.
Definition: BuildingEditorEvents.hh:424
static void DisconnectNewBuildingEditor(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the new signal.
Definition: BuildingEditorEvents.hh:331
static event::ConnectionPtr ConnectDeleteBuildingLevel(T _subscriber)
Connect a Gazebo event to the delete level signal.
Definition: BuildingEditorEvents.hh:180
static event::ConnectionPtr ConnectCreateBuildingEditorItem(T _subscriber)
Connect a Gazebo event to the create editor item signal.
Definition: BuildingEditorEvents.hh:54
Definition: BuildingEditorEvents.hh:31
static event::EventT< void()> addBuildingLevel
A new level has been added.
Definition: BuildingEditorEvents.hh:393
static event::ConnectionPtr ConnectNewBuildingEditor(T _subscriber)
Connect a Gazebo event to the new signal.
Definition: BuildingEditorEvents.hh:325
static void DisconnectTriggerShowFloorplan(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the trigger show floorplan signal.
Definition: BuildingEditorEvents.hh:219
static void DisconnectTriggerShowElements(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the trigger show elements signal.
Definition: BuildingEditorEvents.hh:252
static event::ConnectionPtr ConnectUpdateLevelWidget(T _subscriber)
Connect a Gazebo event to the update level widget signal.
Definition: BuildingEditorEvents.hh:262
static event::EventT< void(QColor)> colorSelected
A color has been selected.
Definition: BuildingEditorEvents.hh:375
static event::ConnectionPtr ConnectFinishBuildingModel(T _subscriber)
Connect a Gazebo event to the finish model signal.
Definition: BuildingEditorEvents.hh:117
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
static event::EventT< bool()> saveBuildingEditor
Save the model.
Definition: BuildingEditorEvents.hh:418
static void DisconnectColorSelected(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the color selected signal.
Definition: BuildingEditorEvents.hh:76
static event::ConnectionPtr ConnectToggleEditMode(T _subscriber)
Connect a Gazebo event to the toggle edit mode signal.
Definition: BuildingEditorEvents.hh:38
static event::EventT< bool()> saveAsBuildingEditor
Save the model as.
Definition: BuildingEditorEvents.hh:421
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
static void DisconnectChangeBuildingLevel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the change level signal.
Definition: BuildingEditorEvents.hh:155
static event::ConnectionPtr ConnectShowFloorplan(T _subscriber)
Connect a Gazebo event to the show floorplan signal.
Definition: BuildingEditorEvents.hh:195
static event::EventT< void(double)> changeBuildingEditorZoom
The current zoom level has been changed.
Definition: BuildingEditorEvents.hh:415
static event::ConnectionPtr ConnectNewBuildingModel(T _subscriber)
Connect a Gazebo event to the new model signal.
Definition: BuildingEditorEvents.hh:133
static event::ConnectionPtr ConnectAddBuildingLevel(T _subscriber)
Connect a Gazebo event to the add level signal.
Definition: BuildingEditorEvents.hh:164
static void DisconnectUpdateLevelWidget(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the update level widget signal.
Definition: BuildingEditorEvents.hh:268
static event::ConnectionPtr ConnectSaveBuildingEditor(T _subscriber)
Connect a Gazebo event to the save signal.
Definition: BuildingEditorEvents.hh:293
static void DisconnectNewBuildingModel(event::ConnectionPtr _subscriber) GAZEBO_DEPRECATED(8.0)
Disconnect a Gazebo event from the new model signal.
Definition: BuildingEditorEvents.hh:139
static event::EventT< void()> showElements
Show or hide building elements.
Definition: BuildingEditorEvents.hh:405
static event::ConnectionPtr ConnectChangeBuildingLevel(T _subscriber)
Connect a Gazebo event to the change model signal.
Definition: BuildingEditorEvents.hh:149