ModelEditorPalette.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 
18 #ifndef GAZEBO_GUI_MODEL_MODELEDITORPALETTE_HH_
19 #define GAZEBO_GUI_MODEL_MODELEDITORPALETTE_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "gazebo/gui/qt.h"
26 
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace common
32  {
33  class KeyEvent;
34  }
35 
36  namespace gui
37  {
38  // Forward declare private data.
39  class ModelEditorPalettePrivate;
40 
43 
46  class GZ_GUI_VISIBLE ModelEditorPalette : public QWidget
47  {
48  Q_OBJECT
49 
52  public: explicit 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(const unsigned int _index, QWidget *_widget);
67 
70  public: void RemoveWidget(QWidget *_widget);
71 
74  public: void CreateJoint(const std::string &_type);
75 
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 
102  private: std::unique_ptr<ModelEditorPalettePrivate> dataPtr;
103  };
104  }
105 }
106 #endif
A palette of model items which can be added to the editor.
Definition: ModelEditorPalette.hh:46
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Create and manage 3D visuals of a model with links, nested models and joints.
Definition: ModelCreator.hh:60