BuildingEditorEvents.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 _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  {
32  {
36  public: template<typename T>
38  ConnectToggleEditMode(T _subscriber)
39  { return toggleEditMode.Connect(_subscriber); }
40 
43  public: static void DisconnectToggleEditMode(
44  event::ConnectionPtr _subscriber)
45  { toggleEditMode.Disconnect(_subscriber); }
46 
50  public: template<typename T>
53  { return createBuildingEditorItem.Connect(_subscriber); }
54 
58  event::ConnectionPtr _subscriber)
59  { createBuildingEditorItem.Disconnect(_subscriber); }
60 
64  public: template<typename T>
66  ConnectColorSelected(T _subscriber)
67  { return colorSelected.Connect(_subscriber); }
68 
71  public: static void DisconnectColorSelected(
72  event::ConnectionPtr _subscriber)
73  { colorSelected.Disconnect(_subscriber); }
74 
78  public: template<typename T>
80  ConnectTextureSelected(T _subscriber)
81  { return textureSelected.Connect(_subscriber); }
82 
85  public: static void DisconnectTextureSelected(
86  event::ConnectionPtr _subscriber)
87  { textureSelected.Disconnect(_subscriber); }
88 
92  public: template<typename T>
94  { return saveBuildingModel.Connect(_subscriber); }
95 
98  public: static void DisconnectSaveBuildingModel(
99  event::ConnectionPtr _subscriber)
100  { saveBuildingModel.Disconnect(_subscriber); }
101 
105  public: template<typename T>
106  static event::ConnectionPtr
108  { return finishBuildingModel.Connect(_subscriber); }
109 
112  public: static void DisconnectFinishBuildingModel(
113  event::ConnectionPtr _subscriber)
114  { finishBuildingModel.Disconnect(_subscriber); }
115 
119  public: template<typename T>
120  static event::ConnectionPtr
121  ConnectNewBuildingModel(T _subscriber)
122  { return newBuildingModel.Connect(_subscriber); }
123 
126  public: static void DisconnectNewBuildingModel(
127  event::ConnectionPtr _subscriber)
128  { newBuildingModel.Disconnect(_subscriber); }
129 
133  public: template<typename T>
134  static event::ConnectionPtr
136  { return changeBuildingLevel.Connect(_subscriber); }
137 
140  public: static void DisconnectChangeBuildingLevel(
141  event::ConnectionPtr _subscriber)
142  { changeBuildingLevel.Disconnect(_subscriber); }
143 
147  public: template<typename T>
149  { return addBuildingLevel.Connect(_subscriber); }
150 
153  public: static void DisconnectAddBuildingLevel(
154  event::ConnectionPtr _subscriber)
155  { addBuildingLevel.Disconnect(_subscriber); }
156 
160  public: template<typename T>
161  static event::ConnectionPtr
163  { return deleteBuildingLevel.Connect(_subscriber); }
164 
167  public: static void DisconnectDeleteBuildingLevel(
168  event::ConnectionPtr _subscriber)
169  { deleteBuildingLevel.Disconnect(_subscriber); }
170 
174  public: template<typename T>
176  { return showFloorplan.Connect(_subscriber); }
177 
180  public: static void DisconnectShowFloorplan(
181  event::ConnectionPtr _subscriber)
182  { showFloorplan.Disconnect(_subscriber); }
183 
188  public: template<typename T>
189  static event::ConnectionPtr
191  { return triggerShowFloorplan.Connect(_subscriber); }
192 
196  public: static void DisconnectTriggerShowFloorplan(
197  event::ConnectionPtr _subscriber)
198  { triggerShowFloorplan.Disconnect(_subscriber); }
199 
203  public: template<typename T>
205  { return showElements.Connect(_subscriber); }
206 
209  public: static void DisconnectShowElements(
210  event::ConnectionPtr _subscriber)
211  { showElements.Disconnect(_subscriber); }
212 
217  public: template<typename T>
218  static event::ConnectionPtr
220  { return triggerShowElements.Connect(_subscriber); }
221 
225  public: static void DisconnectTriggerShowElements(
226  event::ConnectionPtr _subscriber)
227  { triggerShowElements.Disconnect(_subscriber); }
228 
232  public: template<typename T>
233  static event::ConnectionPtr
235  { return updateLevelWidget.Connect(_subscriber); }
236 
239  public: static void DisconnectUpdateLevelWidget(
240  event::ConnectionPtr _subscriber)
241  { updateLevelWidget.Disconnect(_subscriber); }
242 
246  public: template<typename T>
247  static event::ConnectionPtr
249  { return changeBuildingEditorZoom.Connect(_subscriber); }
250 
254  event::ConnectionPtr _subscriber)
255  { changeBuildingEditorZoom.Disconnect(_subscriber); }
256 
260  public: template<typename T>
262  { return saveBuildingEditor.Connect(_subscriber); }
263 
267  public: template<typename T>
268  static event::ConnectionPtr ConnectSaveAsBuildingEditor
269  (T _subscriber)
270  { return saveAsBuildingEditor.Connect(_subscriber); }
271 
274  public: static void DisconnectSaveBuildingEditor(
275  event::ConnectionPtr _subscriber)
276  { saveBuildingEditor.Disconnect(_subscriber); }
277 
280  public: static void DisconnectSaveAsBuildingEditor(
281  event::ConnectionPtr _subscriber)
282  { saveAsBuildingEditor.Disconnect(_subscriber); }
283 
287  public: template<typename T>
288  static event::ConnectionPtr
290  { return newBuildingEditor.Connect(_subscriber); }
291 
294  public: static void DisconnectNewBuildingEditor(
295  event::ConnectionPtr _subscriber)
296  { newBuildingEditor.Disconnect(_subscriber); }
297 
301  public: template<typename T>
303  { return exitBuildingEditor.Connect(_subscriber); }
304 
307  public: static void DisconnectExitBuildingEditor(
308  event::ConnectionPtr _subscriber)
309  { exitBuildingEditor.Disconnect(_subscriber); }
310 
313 
317  public: template<typename T>
318  static event::ConnectionPtr ConnectBuildingNameChanged
319  (T _subscriber)
320  { return buildingNameChanged.Connect(_subscriber); }
321 
324  public: static void ConnectBuildingNameChanged(
325  event::ConnectionPtr _subscriber)
326  { buildingNameChanged.Disconnect(_subscriber); }
327 
329  public: static event::EventT<void (std::string)>
331 
334 
337 
341 
344 
347 
350 
353 
356 
359 
362 
365 
368 
372 
375 
378 
381 
384 
387 
390  };
391  }
392  }
393 }
394 #endif
static event::EventT< void(double)> changeBuildingEditorZoom
The current zoom level has been changed.
Definition: BuildingEditorEvents.hh:374
static event::EventT< void()> newBuildingEditor
Make a new model.
Definition: BuildingEditorEvents.hh:383
static event::EventT< void()> addBuildingLevel
A new level has been added.
Definition: BuildingEditorEvents.hh:352
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:144
static event::ConnectionPtr ConnectNewBuildingModel(T _subscriber)
Connect a Gazebo event to the new model signal.
Definition: BuildingEditorEvents.hh:121
static event::ConnectionPtr ConnectTriggerShowFloorplan(T _subscriber)
Connect a Gazebo event to the trigger show floorplan signal.
Definition: BuildingEditorEvents.hh:190
static event::EventT< void()> showElements
Show or hide building elements.
Definition: BuildingEditorEvents.hh:364
static event::EventT< void()> triggerShowFloorplan
Trigger show floorplan.
Definition: BuildingEditorEvents.hh:361
static event::EventT< void()> triggerShowElements
Trigger show elements.
Definition: BuildingEditorEvents.hh:367
static event::ConnectionPtr ConnectSaveBuildingEditor(T _subscriber)
Connect a Gazebo event to the save signal.
Definition: BuildingEditorEvents.hh:261
static event::ConnectionPtr ConnectDeleteBuildingLevel(T _subscriber)
Connect a Gazebo event to the delete level signal.
Definition: BuildingEditorEvents.hh:162
static void DisconnectColorSelected(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the color selected signal.
Definition: BuildingEditorEvents.hh:71
static void DisconnectChangeBuildingEditorZoom(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the change zoom level signal.
Definition: BuildingEditorEvents.hh:253
static event::EventT< void(int)> changeBuildingLevel
The current level has been changed.
Definition: BuildingEditorEvents.hh:349
static void ConnectBuildingNameChanged(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the exit signal.
Definition: BuildingEditorEvents.hh:324
static void DisconnectUpdateLevelWidget(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the update level widget signal.
Definition: BuildingEditorEvents.hh:239
static event::EventT< void(std::string, std::string)> saveBuildingModel
A model has been saved with a name and a location.
Definition: BuildingEditorEvents.hh:340
static void DisconnectNewBuildingModel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the new model signal.
Definition: BuildingEditorEvents.hh:126
static event::EventT< void(std::string)> createBuildingEditorItem
An editor item is to be created.
Definition: BuildingEditorEvents.hh:330
static event::ConnectionPtr ConnectNewBuildingEditor(T _subscriber)
Connect a Gazebo event to the new signal.
Definition: BuildingEditorEvents.hh:289
static event::ConnectionPtr ConnectChangeBuildingLevel(T _subscriber)
Connect a Gazebo event to the change model signal.
Definition: BuildingEditorEvents.hh:135
static event::ConnectionPtr ConnectToggleEditMode(T _subscriber)
Connect a Gazebo event to the toggle edit mode signal.
Definition: BuildingEditorEvents.hh:38
static void DisconnectFinishBuildingModel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the finish model signal.
Definition: BuildingEditorEvents.hh:112
static void DisconnectSaveAsBuildingEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the save as signal.
Definition: BuildingEditorEvents.hh:280
static event::EventT< void()> finishBuildingModel
A model has been completed and uploaded onto the server.
Definition: BuildingEditorEvents.hh:343
static event::EventT< void(int, std::string)> updateLevelWidget
The levels have been changed.
Definition: BuildingEditorEvents.hh:371
static event::ConnectionPtr ConnectFinishBuildingModel(T _subscriber)
Connect a Gazebo event to the finish model signal.
Definition: BuildingEditorEvents.hh:107
static event::ConnectionPtr ConnectTextureSelected(T _subscriber)
Connect a Gazebo event to the texture selected signal.
Definition: BuildingEditorEvents.hh:80
static event::ConnectionPtr ConnectAddBuildingLevel(T _subscriber)
Connect a Gazebo event to the add level signal.
Definition: BuildingEditorEvents.hh:148
ConnectionPtr Connect(const boost::function< T > &_subscriber)
Connect a callback to this event.
Definition: Event.hh:577
static event::EventT< bool(std::string)> saveBuildingEditor
Save the model.
Definition: BuildingEditorEvents.hh:377
static event::EventT< void()> newBuildingModel
A new model has been started.
Definition: BuildingEditorEvents.hh:346
static event::ConnectionPtr ConnectShowFloorplan(T _subscriber)
Connect a Gazebo event to the show floorplan signal.
Definition: BuildingEditorEvents.hh:175
static event::ConnectionPtr ConnectExitBuildingEditor(T _subscriber)
Connect a Gazebo event to the exit signal.
Definition: BuildingEditorEvents.hh:302
static void DisconnectExitBuildingEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the exit signal.
Definition: BuildingEditorEvents.hh:307
static void DisconnectCreateBuildingEditorItem(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the create editor item signal.
Definition: BuildingEditorEvents.hh:57
static void DisconnectChangeBuildingLevel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the change level signal.
Definition: BuildingEditorEvents.hh:140
static event::ConnectionPtr ConnectColorSelected(T _subscriber)
Connect a Gazebo event to the color selected signal.
Definition: BuildingEditorEvents.hh:66
Definition: BuildingEditorEvents.hh:31
static void DisconnectShowElements(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the show elements signal.
Definition: BuildingEditorEvents.hh:209
static event::EventT< void()> deleteBuildingLevel
A level has been deleted.
Definition: BuildingEditorEvents.hh:355
static void DisconnectNewBuildingEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the new signal.
Definition: BuildingEditorEvents.hh:294
static event::EventT< void(QColor)> colorSelected
A color has been selected.
Definition: BuildingEditorEvents.hh:333
static event::ConnectionPtr ConnectCreateBuildingEditorItem(T _subscriber)
Connect a Gazebo event to the create editor item signal.
Definition: BuildingEditorEvents.hh:52
static void DisconnectTextureSelected(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the texture selected signal.
Definition: BuildingEditorEvents.hh:85
static event::EventT< void()> showFloorplan
Show or hide floorplan.
Definition: BuildingEditorEvents.hh:358
static event::ConnectionPtr ConnectSaveBuildingModel(T _subscriber)
Connect a Gazebo event to the save model signal.
Definition: BuildingEditorEvents.hh:93
static void DisconnectSaveBuildingModel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the save model signal.
Definition: BuildingEditorEvents.hh:98
static void DisconnectDeleteBuildingLevel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the delete level signal.
Definition: BuildingEditorEvents.hh:167
static event::EventT< void(std::string)> buildingNameChanged
Name was changed in the editor palette.
Definition: BuildingEditorEvents.hh:389
static void DisconnectTriggerShowElements(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the trigger show elements signal.
Definition: BuildingEditorEvents.hh:225
static event::ConnectionPtr ConnectChangeBuildingEditorZoom(T _subscriber)
Connect a Gazebo event to the change zoom signal.
Definition: BuildingEditorEvents.hh:248
static void DisconnectAddBuildingLevel(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the add level signal.
Definition: BuildingEditorEvents.hh:153
static event::ConnectionPtr ConnectShowElements(T _subscriber)
Connect a Gazebo event to the show elements signal.
Definition: BuildingEditorEvents.hh:204
static void DisconnectShowFloorplan(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the show floorplan signal.
Definition: BuildingEditorEvents.hh:180
static void DisconnectToggleEditMode(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the toggle edit mode signal.
Definition: BuildingEditorEvents.hh:43
static event::ConnectionPtr ConnectTriggerShowElements(T _subscriber)
Connect a Gazebo event to the trigger show elements signal.
Definition: BuildingEditorEvents.hh:219
static event::EventT< void(QString)> textureSelected
A texture has been selected.
Definition: BuildingEditorEvents.hh:336
static event::ConnectionPtr ConnectUpdateLevelWidget(T _subscriber)
Connect a Gazebo event to the update level widget signal.
Definition: BuildingEditorEvents.hh:234
static event::EventT< void()> exitBuildingEditor
Exit the editor mode with the option to save.
Definition: BuildingEditorEvents.hh:386
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
static event::EventT< bool(std::string)> saveAsBuildingEditor
Save the model as.
Definition: BuildingEditorEvents.hh:380
static event::EventT< void(bool)> toggleEditMode
Toggle if the edit mode was checked or not.
Definition: BuildingEditorEvents.hh:312
static void DisconnectSaveBuildingEditor(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the save signal.
Definition: BuildingEditorEvents.hh:274
static void DisconnectTriggerShowFloorplan(event::ConnectionPtr _subscriber)
Disconnect a Gazebo event from the trigger show floorplan signal.
Definition: BuildingEditorEvents.hh:196