ModelEditorPalette.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2016 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 
18 #ifndef _GAZEBO_MODEL_EDITOR_PALETTE_HH_
19 #define _GAZEBO_MODEL_EDITOR_PALETTE_HH_
20 
21 #include <map>
22 #include <string>
23 
25 #include "gazebo/common/Event.hh"
26 
28 #include "gazebo/gui/qt.h"
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace rendering
34  {
35  }
36 
37  namespace gui
38  {
39  class ModelCreator;
40 
43 
46  class GZ_GUI_VISIBLE ModelEditorPalette : public QWidget
47  {
48  Q_OBJECT
49 
52  public: ModelEditorPalette(QWidget *_parent = 0);
53 
55  public: ~ModelEditorPalette();
56 
60  public: void AddItem(QWidget *_item,
61  const std::string &_category = "Other");
62 
66  public: void InsertWidget(unsigned int _index, QWidget *_widget);
67 
70  public: void RemoveWidget(QWidget *_widget);
71 
74  public: void CreateJoint(const std::string &_type);
75 
78  public: ModelCreator *GetModelCreator();
79 
83  private: bool OnKeyPress(const common::KeyEvent &_event);
84 
86  private slots: void OnCylinder();
87 
89  private slots: void OnSphere();
90 
92  private slots: void OnBox();
93 
95  private slots: void OnCustom();
96 
98  private slots: void OnLinkAdded();
99 
101  private: QButtonGroup *linkButtonGroup;
102 
104  private: ModelCreator *modelCreator;
105 
107  private: QVBoxLayout *otherItemsLayout;
108 
110  private: std::map<std::string, QGridLayout *> categories;
111 
113  private: QSplitter *splitter;
114  };
115  }
116 }
117 #endif
A palette of model items which can be added to the editor.
Definition: ModelEditorPalette.hh:46
#define GZ_GUI_VISIBLE
Definition: system.hh:284
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Create and manage 3D visuals of a model with links and joints.
Definition: ModelCreator.hh:58