ModelEditor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 GAZEBO_GUI_MODEL_MODELEDITOR_HH_
18 #define GAZEBO_GUI_MODEL_MODELEDITOR_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <sdf/sdf.hh>
24 
25 #include "gazebo/gui/qt.h"
26 #include "gazebo/gui/Editor.hh"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace gui
32  {
33  class TopToolbar;
34  class ModelEditorPrivate;
35 
38  class GZ_GUI_VISIBLE ModelEditor : public Editor
39  {
40  Q_OBJECT
41 
44  public: ModelEditor(MainWindow *_mainWindow);
45 
47  public: virtual ~ModelEditor();
48 
52  public: void AddItemToPalette(QWidget *_item,
53  const std::string &_category = "");
54 
57  public: void AddEntity(sdf::ElementPtr _sdf);
58 
61  private slots: void Save();
62 
65  private slots: void SaveAs();
66 
69  private slots: void New();
70 
73  private slots: void Exit();
74 
77  private slots: void OnEdit(bool _checked);
78 
80  private slots: void OnAddSelectedJoint();
81 
84  private slots: void OnAddJoint(const QString &_type);
85 
87  private slots: void OnJointAdded();
88 
91  private slots: void OnSchematicView(bool _show);
92 
94  private: void OnFinish();
95 
98  private: void ToggleMaterialScheme();
99 
101  private: void ToggleToolbar();
102 
106  private: void ToggleInsertWidget();
107 
109  private: void CreateMenus();
110 
114  private: void OnCreateEntity(const std::string &_type,
115  const std::string &_data);
116 
119  private: std::unique_ptr<ModelEditorPrivate> dataPtr;
120  };
121  }
122 }
123 #endif
Interface to the terrain editor.
Definition: ModelEditor.hh:38
Definition: MainWindow.hh:43
Base class for editors, such as BuildingEditor and TerrainEditor.
Definition: Editor.hh:35