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 #include <ignition/math/Vector3.hh>
24 
25 #include "gazebo/common/Color.hh"
26 
27 #include "gazebo/gui/qt.h"
28 
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace gui
34  {
35  // Forward declare private data.
36  class EditorItemPrivate;
37 
40 
43  class GZ_GUI_VISIBLE EditorItem : public QObject
44  {
45  Q_OBJECT
46 
48  public: EditorItem();
49 
51  public: ~EditorItem();
52 
55  public: virtual ignition::math::Vector3d Size() const;
56 
59  public: virtual ignition::math::Vector3d ScenePosition() const;
60 
63  public: virtual double SceneRotation() const;
64 
67  public: virtual std::string ItemType() const;
68 
71  public: virtual std::string Name() const;
72 
74  public: int Level() const;
75 
78  public: double LevelBaseHeight() const;
79 
82  public: virtual common::Color Color3d() const;
83 
86  public: virtual std::string Texture3d() const;
87 
90  public: virtual void SetName(const std::string &_name);
91 
94  public: void SetLevel(const int _level);
95 
99  public: void SetLevelBaseHeight(const double _height);
100 
103  public: void SetColor3d(const common::Color &_color);
104 
107  public: void SetTexture3d(const std::string &_texture);
108 
111  public: void Set3dTransparency(const float _transparency);
112 
115  public: virtual void SetHighlighted(const bool _highlighted);
116 
119  public: int ZValueIdle() const;
120 
123  public: int ZValueSelected() const;
124 
129  Q_SIGNALS: void SizeChanged(const double _width, const double _depth,
130  const double _height);
131 
139  Q_SIGNALS: void PoseChanged(const double _x, const double _y,
140  const double _z, const double _roll, const double _pitch,
141  const double _yaw);
142 
150  Q_SIGNALS: void PoseOriginTransformed(const double _x, const double _y,
151  const double _z, const double _roll, const double _pitch,
152  const double _yaw);
153 
158  Q_SIGNALS: void PositionChanged(const double _x, const double _y,
159  const double _z);
160 
165  Q_SIGNALS: void RotationChanged(const double _roll, const double _pitch,
166  const double _yaw);
167 
170  Q_SIGNALS: void WidthChanged(const double _width);
171 
174  Q_SIGNALS: void DepthChanged(const double _depth);
175 
178  Q_SIGNALS: void HeightChanged(const double _height);
179 
183  Q_SIGNALS: void PosXChanged(const double _posX);
184 
188  Q_SIGNALS: void PosYChanged(const double _posY);
189 
193  Q_SIGNALS: void PosZChanged(const double _posZ);
194 
198  Q_SIGNALS: void YawChanged(const double _yaw);
199 
202  Q_SIGNALS: void LevelChanged(const int _level);
203 
207  Q_SIGNALS: void ColorChanged(const common::Color &_color);
208 
212  Q_SIGNALS: void TextureChanged(const std::string &_texture);
213 
217  Q_SIGNALS: void TransparencyChanged(const float _transparency);
218 
220  Q_SIGNALS: void ItemDeleted();
221 
224  private slots: void OnColorChanged(const common::Color &_color);
225 
228  private slots: void OnTextureChanged(const std::string &_texture);
229 
231  protected: int zValueIdle;
232 
234  protected: int zValueSelected;
235 
237  protected: std::string editorType;
238 
240  protected: std::string name;
241 
243  protected: int level;
244 
247  protected: double levelBaseHeight;
248 
251 
253  protected: std::string visual3dTexture;
254 
256  protected: float visual3dTransparency;
257 
260  protected: bool highlighted;
261 
263  protected: double itemScale;
264 
267  private: std::unique_ptr<EditorItemPrivate> dataPtr;
268  };
270  }
271 }
272 
273 #endif
int zValueIdle
Z ordering of the rect item when idle (unselected.)
Definition: EditorItem.hh:231
Base class of an item in the editor.
Definition: EditorItem.hh:43
int level
Level that this item is on.
Definition: EditorItem.hh:243
Forward declarations for the common classes.
Definition: Animation.hh:33
std::string name
Name of editor item.
Definition: EditorItem.hh:240
bool highlighted
Flag to indicate whether this item is currently highlighted or not.
Definition: EditorItem.hh:260
common::Color visual3dColor
Color of the associated 3D visual.
Definition: EditorItem.hh:250
std::string visual3dTexture
Texture of the associated 3D visual.
Definition: EditorItem.hh:253
float visual3dTransparency
Transparency of the associated 3D visual.
Definition: EditorItem.hh:256
A convenient structure for storing level information.
Definition: EditorView.hh:45
double levelBaseHeight
Vertical distance from the building&#39;s base to the base of the level this editor is in...
Definition: EditorItem.hh:247
Defines a color.
Definition: Color.hh:36
int zValueSelected
Z ordering of the rect item when selected.
Definition: EditorItem.hh:234
double itemScale
Scale for converting from pixel to metric units.
Definition: EditorItem.hh:263
std::string editorType
Type of editor item.
Definition: EditorItem.hh:237