ModelEditorPalette.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-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 
18 #ifndef _MODEL_EDITOR_PALETTE_HH_
19 #define _MODEL_EDITOR_PALETTE_HH_
20 
21 #include <string>
22 
24 #include "gazebo/common/Event.hh"
25 
27 #include "gazebo/gui/qt.h"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace rendering
33  {
34  }
35 
36  namespace gui
37  {
38  class ModelCreator;
39 
42 
45  class GAZEBO_VISIBLE ModelEditorPalette : public QWidget
46  {
47  Q_OBJECT
48 
51  public: ModelEditorPalette(QWidget *_parent = 0);
52 
54  public: ~ModelEditorPalette();
55 
58  public: void AddJoint(const std::string &_type);
59 
62  public: ModelCreator *GetModelCreator();
63 
67  private: bool OnKeyPress(const common::KeyEvent &_event);
68 
72  private slots: void OnItemSelection(QTreeWidgetItem *_item, int _column);
73 
75  private slots: void OnCylinder();
76 
78  private slots: void OnSphere();
79 
81  private slots: void OnBox();
82 
84  private slots: void OnCustom();
85 
87  private slots: void OnPartAdded();
88 
90  private slots: void OnStatic();
91 
93  private slots: void OnAutoDisable();
94 
96  private slots: void OnSave();
97 
99  private slots: void OnDiscard();
100 
102  private slots: void OnDone();
103 
105  private: QTreeWidget *modelTreeWidget;
106 
108  private: QTreeWidgetItem *modelSettingsItem;
109 
111  private: QTreeWidgetItem *modelItem;
112 
114  private: QTreeWidgetItem *pluginItem;
115 
117  private: QButtonGroup *partButtonGroup;
118 
120  private: ModelCreator *modelCreator;
121 
123  private: QPushButton *saveButton;
124 
126  private: bool saved;
127 
129  private: std::string saveLocation;
130 
132  private: std::string modelName;
133 
135  private: QCheckBox *staticCheck;
136 
139  private: QCheckBox *autoDisableCheck;
140  };
141  }
142 }
143 #endif
A palette of model items which can be added to the editor.
Definition: ModelEditorPalette.hh:45
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
Create and manage 3D visuals of a model with parts and joints.
Definition: ModelCreator.hh:50
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48