EditorItem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-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_GUI_BUILDING_EDITORITEM_HH_
19 #define _GAZEBO_GUI_BUILDING_EDITORITEM_HH_
20 
21 #include <string>
22 #include <memory>
23 
24 #include "gazebo/gui/qt.h"
25 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  // Forward declare private data.
33  class EditorItemPrivate;
34 
37 
40  class GZ_GUI_VISIBLE EditorItem : public QObject
41  {
42  Q_OBJECT
43 
45  public: EditorItem();
46 
48  public: ~EditorItem();
49 
52  public: virtual QVector3D GetSize() const;
53 
56  public: virtual QVector3D GetScenePosition() const;
57 
60  public: virtual double GetSceneRotation() const;
61 
64  public: virtual std::string GetType() const;
65 
68  public: virtual std::string GetName() const;
69 
71  public: int GetLevel() const;
72 
75  public: double GetLevelBaseHeight() const;
76 
79  public: virtual QColor Get3dColor() const;
80 
83  public: virtual QString Get3dTexture() const;
84 
87  public: virtual void SetName(const std::string &_name);
88 
91  public: void SetLevel(int _level);
92 
96  public: void SetLevelBaseHeight(double _height);
97 
100  public: void Set3dColor(QColor _color);
101 
104  public: void Set3dTexture(QString _texture);
105 
108  public: void Set3dTransparency(float _transparency);
109 
112  public: virtual void SetHighlighted(bool _highlighted);
113 
116  public: int ZValueIdle() const;
117 
120  public: int ZValueSelected() const;
121 
126  Q_SIGNALS: void SizeChanged(double _width, double _depth,
127  double _height);
128 
136  Q_SIGNALS: void PoseChanged(double _x, double _y, double _z,
137  double _roll, double _pitch, double _yaw);
138 
146  Q_SIGNALS: void PoseOriginTransformed(double _x, double _y, double _z,
147  double _roll, double _pitch, double _yaw);
148 
153  Q_SIGNALS: void PositionChanged(double _x, double _y, double _z);
154 
159  Q_SIGNALS: void RotationChanged(double _roll, double _pitch, double _yaw);
160 
163  Q_SIGNALS: void WidthChanged(double _width);
164 
167  Q_SIGNALS: void DepthChanged(double _depth);
168 
171  Q_SIGNALS: void HeightChanged(double _height);
172 
176  Q_SIGNALS: void PosXChanged(double _posX);
177 
181  Q_SIGNALS: void PosYChanged(double _posY);
182 
186  Q_SIGNALS: void PosZChanged(double _posZ);
187 
191  Q_SIGNALS: void YawChanged(double _yaw);
192 
195  Q_SIGNALS: void LevelChanged(int _level);
196 
200  Q_SIGNALS: void ColorChanged(QColor _color);
201 
205  Q_SIGNALS: void TextureChanged(QString _texture);
206 
210  Q_SIGNALS: void TransparencyChanged(float _transparency);
211 
213  Q_SIGNALS: void ItemDeleted();
214 
217  private slots: void OnColorChanged(QColor _color);
218 
221  private slots: void OnTextureChanged(QString _texture);
222 
224  protected: int zValueIdle;
225 
227  protected: int zValueSelected;
228 
230  protected: std::string editorType;
231 
233  protected: std::string name;
234 
236  protected: int level;
237 
240  protected: double levelBaseHeight;
241 
243  protected: QColor visual3dColor;
244 
246  protected: QString visual3dTexture;
247 
249  protected: float visual3dTransparency;
250 
253  protected: bool highlighted;
254 
256  protected: double itemScale;
257 
260  private: std::unique_ptr<EditorItemPrivate> dataPtr;
261  };
263  }
264 }
265 
266 #endif
int level
Level that this item is on.
Definition: EditorItem.hh:236
double levelBaseHeight
Vertical distance from the building's base to the base of the level this editor is in...
Definition: EditorItem.hh:240
Base class of an item in the editor.
Definition: EditorItem.hh:40
QColor visual3dColor
Color of the associated 3D visual.
Definition: EditorItem.hh:243
#define GZ_GUI_VISIBLE
Definition: system.hh:284
int zValueIdle
Z ordering of the rect item when idle (unselected.)
Definition: EditorItem.hh:224
int zValueSelected
Z ordering of the rect item when selected.
Definition: EditorItem.hh:227
std::string editorType
Type of editor item.
Definition: EditorItem.hh:230
bool highlighted
Flag to indicate whether this item is currently highlighted or not.
Definition: EditorItem.hh:253
QString visual3dTexture
Texture of the associated 3D visual.
Definition: EditorItem.hh:246
double itemScale
Scale for converting from pixel to metric units.
Definition: EditorItem.hh:256
std::string name
Name of editor item.
Definition: EditorItem.hh:233
float visual3dTransparency
Transparency of the associated 3D visual.
Definition: EditorItem.hh:249