BuildingModelManip.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 #ifndef _GAZEBO_GUI_BUILDING_MODEL_MANIP_HH_
18 #define _GAZEBO_GUI_BUILDING_MODEL_MANIP_HH_
19 
20 #include <string>
21 
22 #include "gazebo/gui/qt.h"
23 
25 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace common
31  {
32  class Color;
33  }
34 
35  namespace gui
36  {
37  // Forward declare pointers.
38  class BuildingMaker;
39  // Forward declare private data.
40  class BuildingModelManipPrivate;
41 
44 
47  class GZ_GUI_VISIBLE BuildingModelManip : public QObject
48  {
49  Q_OBJECT
50 
52  public: BuildingModelManip();
53 
55  public: virtual ~BuildingModelManip();
56 
59  public: std::string Name() const;
60 
63  public: rendering::VisualPtr Visual() const;
64 
67  public: double Transparency() const;
68 
71  public: common::Color Color() const;
72 
75  public: std::string Texture() const;
76 
79  public: void SetName(const std::string &_name);
80 
83  public: void SetVisual(const rendering::VisualPtr &_visual);
84 
87  public: void SetMaker(BuildingMaker *_maker);
88 
96  public: void SetPose(double _x, double _y, double _z,
97  double _roll, double _pitch, double _yaw);
98 
103  public: void SetPosition(double _x, double _y, double _z);
104 
109  public: void SetRotation(double _roll, double _pitch, double _yaw);
110 
115  public: void SetSize(double _width, double _depth, double _height);
116 
119  public: void SetColor(QColor _color);
120 
123  public: void SetTexture(QString _texture);
124 
127  public: void SetTransparency(float _transparency);
128 
131  public: void SetVisible(bool _visible);
132 
135  public: void SetLevel(const int _level);
136 
139  public: int Level() const;
140 
144  Q_SIGNALS: void ColorChanged(const common::Color &_color);
145 
149  Q_SIGNALS: void TextureChanged(const std::string &_texture);
150 
159  private slots: void OnPoseChanged(double _x, double _y, double _z,
160  double _roll, double _pitch, double _yaw);
161 
170  private slots: void OnPoseOriginTransformed(double _x, double _y,
171  double _z, double _roll, double _pitch, double _yaw);
172 
178  private slots: void OnPositionChanged(double _x, double _y, double _z);
179 
185  private slots: void OnRotationChanged(double _roll, double _pitch,
186  double _yaw);
187 
193  private slots: void OnSizeChanged(double _width, double _depth,
194  double _height);
195 
199  private slots: void OnWidthChanged(double _width);
200 
204  private slots: void OnHeightChanged(double _height);
205 
209  private slots: void OnDepthChanged(double _depth);
210 
214  private slots: void OnPosXChanged(double _posX);
215 
219  private slots: void OnPosYChanged(double _posY);
220 
224  private slots: void OnPosZChanged(double _posZ);
225 
229  private slots: void OnYawChanged(double _yaw);
230 
234  private slots: void OnLevelChanged(int _level);
235 
239  private slots: void OnColorChanged(const common::Color &_color);
240 
244  private slots: void OnTextureChanged(const std::string &_texture);
245 
249  private slots: void OnTransparencyChanged(float _transparency);
250 
252  private slots: void OnDeleted();
253 
258  private: void OnChangeLevel(int _level);
259 
262  private: std::unique_ptr<BuildingModelManipPrivate> dataPtr;
263  };
265  }
266 }
267 #endif
Create and manage 3D visuals of a building.
Definition: BuildingMaker.hh:48
A convenient structure for storing level information.
Definition: EditorView.hh:45
Defines a color.
Definition: Color.hh:36
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
Manipulate a 3D visual associated to a 2D editor item.
Definition: BuildingModelManip.hh:47