EditorItem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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/Color.hh>
24 #include <ignition/math/Vector3.hh>
25 
26 #include "gazebo/gui/qt.h"
27 
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace gui
33  {
34  // Forward declare private data.
35  class EditorItemPrivate;
36 
39 
42  class GZ_GUI_VISIBLE EditorItem : public QObject
43  {
44  Q_OBJECT
45 
47  public: EditorItem();
48 
50  public: ~EditorItem();
51 
54  public: virtual ignition::math::Vector3d Size() const;
55 
58  public: virtual ignition::math::Vector3d ScenePosition() const;
59 
62  public: virtual double SceneRotation() const;
63 
66  public: virtual std::string ItemType() const;
67 
70  public: virtual std::string Name() const;
71 
73  public: int Level() const;
74 
77  public: double LevelBaseHeight() const;
78 
81  public: virtual ignition::math::Color Color3d() const;
82 
85  public: virtual std::string Texture3d() const;
86 
89  public: virtual void SetName(const std::string &_name);
90 
93  public: void SetLevel(const int _level);
94 
98  public: void SetLevelBaseHeight(const double _height);
99 
102  public: void SetColor3d(const ignition::math::Color &_color);
103 
106  public: void SetTexture3d(const std::string &_texture);
107 
110  public: void Set3dTransparency(const float _transparency);
111 
114  public: virtual void SetHighlighted(const bool _highlighted);
115 
118  public: int ZValueIdle() const;
119 
122  public: int ZValueSelected() const;
123 
128  Q_SIGNALS: void SizeChanged(const double _width, const double _depth,
129  const double _height);
130 
138  Q_SIGNALS: void PoseChanged(const double _x, const double _y,
139  const double _z, const double _roll, const double _pitch,
140  const double _yaw);
141 
149  Q_SIGNALS: void PoseOriginTransformed(const double _x, const double _y,
150  const double _z, const double _roll, const double _pitch,
151  const double _yaw);
152 
157  Q_SIGNALS: void PositionChanged(const double _x, const double _y,
158  const double _z);
159 
164  Q_SIGNALS: void RotationChanged(const double _roll, const double _pitch,
165  const double _yaw);
166 
169  Q_SIGNALS: void WidthChanged(const double _width);
170 
173  Q_SIGNALS: void DepthChanged(const double _depth);
174 
177  Q_SIGNALS: void HeightChanged(const double _height);
178 
182  Q_SIGNALS: void PosXChanged(const double _posX);
183 
187  Q_SIGNALS: void PosYChanged(const double _posY);
188 
192  Q_SIGNALS: void PosZChanged(const double _posZ);
193 
197  Q_SIGNALS: void YawChanged(const double _yaw);
198 
201  Q_SIGNALS: void LevelChanged(const int _level);
202 
206  Q_SIGNALS: void ColorChanged(const ignition::math::Color &_color);
207 
211  Q_SIGNALS: void TextureChanged(const std::string &_texture);
212 
216  Q_SIGNALS: void TransparencyChanged(const float _transparency);
217 
219  Q_SIGNALS: void ItemDeleted();
220 
223  private slots: void OnColorChanged(const ignition::math::Color &_color);
224 
227  private slots: void OnTextureChanged(const std::string &_texture);
228 
230  protected: int zValueIdle;
231 
233  protected: int zValueSelected;
234 
236  protected: std::string editorType;
237 
239  protected: std::string name;
240 
242  protected: int level;
243 
246  protected: double levelBaseHeight;
247 
249  protected: ignition::math::Color visual3dColor;
250 
252  protected: std::string visual3dTexture;
253 
255  protected: float visual3dTransparency;
256 
259  protected: bool highlighted;
260 
262  protected: double itemScale;
263 
266  private: std::unique_ptr<EditorItemPrivate> dataPtr;
267  };
269  }
270 }
271 
272 #endif
int zValueIdle
Z ordering of the rect item when idle (unselected.)
Definition: EditorItem.hh:230
Base class of an item in the editor.
Definition: EditorItem.hh:42
int level
Level that this item is on.
Definition: EditorItem.hh:242
std::string name
Name of editor item.
Definition: EditorItem.hh:239
bool highlighted
Flag to indicate whether this item is currently highlighted or not.
Definition: EditorItem.hh:259
ignition::math::Color visual3dColor
Color of the associated 3D visual.
Definition: EditorItem.hh:249
std::string visual3dTexture
Texture of the associated 3D visual.
Definition: EditorItem.hh:252
float visual3dTransparency
Transparency of the associated 3D visual.
Definition: EditorItem.hh:255
A convenient structure for storing level information.
Definition: EditorView.hh:45
double levelBaseHeight
Vertical distance from the building's base to the base of the level this editor is in...
Definition: EditorItem.hh:246
int zValueSelected
Z ordering of the rect item when selected.
Definition: EditorItem.hh:233
double itemScale
Scale for converting from pixel to metric units.
Definition: EditorItem.hh:262
std::string editorType
Type of editor item.
Definition: EditorItem.hh:236