EditorItem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-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 _EDITOR_ITEM_HH_
19 #define _EDITOR_ITEM_HH_
20 
21 #include <string>
22 #include "gazebo/gui/qt.h"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
31 
34  class GZ_GUI_BUILDING_VISIBLE EditorItem : public QObject
35  {
36  Q_OBJECT
37 
39  public: EditorItem();
40 
42  public: ~EditorItem();
43 
46  public: virtual QVector3D GetSize() const;
47 
50  public: virtual QVector3D GetScenePosition() const;
51 
54  public: virtual double GetSceneRotation() const;
55 
58  public: virtual std::string GetType() const;
59 
62  public: virtual std::string GetName() const;
63 
65  public: int GetLevel() const;
66 
69  public: double GetLevelBaseHeight() const;
70 
73  public: virtual QColor Get3dColor() const;
74 
77  public: virtual QString Get3dTexture() const;
78 
81  public: virtual void SetName(const std::string &_name);
82 
85  public: void SetLevel(int _level);
86 
90  public: void SetLevelBaseHeight(double _height);
91 
94  public: void Set3dColor(QColor _color);
95 
98  public: void Set3dTexture(QString _texture);
99 
102  public: void Set3dTransparency(float _transparency);
103 
106  public: virtual void SetHighlighted(bool _highlighted);
107 
112  Q_SIGNALS: void SizeChanged(double _width, double _depth,
113  double _height);
114 
122  Q_SIGNALS: void PoseChanged(double _x, double _y, double _z,
123  double _roll, double _pitch, double _yaw);
124 
132  Q_SIGNALS: void PoseOriginTransformed(double _x, double _y, double _z,
133  double _roll, double _pitch, double _yaw);
134 
139  Q_SIGNALS: void PositionChanged(double _x, double _y, double _z);
140 
145  Q_SIGNALS: void RotationChanged(double _roll, double _pitch, double _yaw);
146 
149  Q_SIGNALS: void WidthChanged(double _width);
150 
153  Q_SIGNALS: void DepthChanged(double _depth);
154 
157  Q_SIGNALS: void HeightChanged(double _height);
158 
162  Q_SIGNALS: void PosXChanged(double _posX);
163 
167  Q_SIGNALS: void PosYChanged(double _posY);
168 
172  Q_SIGNALS: void PosZChanged(double _posZ);
173 
177  Q_SIGNALS: void YawChanged(double _yaw);
178 
181  Q_SIGNALS: void LevelChanged(int _level);
182 
186  Q_SIGNALS: void ColorChanged(QColor _color);
187 
191  Q_SIGNALS: void TextureChanged(QString _texture);
192 
196  Q_SIGNALS: void TransparencyChanged(float _transparency);
197 
199  Q_SIGNALS: void ItemDeleted();
200 
203  private slots: void OnColorChanged(QColor _color);
204 
207  private slots: void OnTextureChanged(QString _texture);
208 
210  public: int zValueIdle;
211 
213  public: int zValueSelected;
214 
216  protected: std::string editorType;
217 
219  protected: std::string name;
220 
222  protected: int level;
223 
226  protected: double levelBaseHeight;
227 
229  protected: QColor visual3dColor;
230 
232  protected: QString visual3dTexture;
233 
235  protected: float visual3dTransparency;
236 
239  protected: bool highlighted;
240 
242  protected: double itemScale;
243  };
245  }
246 }
247 
248 #endif
int level
Level that this item is on.
Definition: EditorItem.hh:222
double levelBaseHeight
Vertical distance from the building's base to the base of the level this editor is in...
Definition: EditorItem.hh:226
Base class of an item in the editor.
Definition: EditorItem.hh:34
QColor visual3dColor
Color of the associated 3D visual.
Definition: EditorItem.hh:229
int zValueIdle
Z ordering of the rect item when idle (unselected.)
Definition: EditorItem.hh:210
int zValueSelected
Z ordering of the rect item when selected.
Definition: EditorItem.hh:213
std::string editorType
Type of editor item.
Definition: EditorItem.hh:216
bool highlighted
Flag to indicate whether this item is currently highlighted or not.
Definition: EditorItem.hh:239
QString visual3dTexture
Texture of the associated 3D visual.
Definition: EditorItem.hh:232
double itemScale
Scale for converting from pixel to metric units.
Definition: EditorItem.hh:242
std::string name
Name of editor item.
Definition: EditorItem.hh:219
#define GZ_GUI_BUILDING_VISIBLE
Definition: system.hh:393
float visual3dTransparency
Transparency of the associated 3D visual.
Definition: EditorItem.hh:235