BuildingModelManip.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 #ifndef GAZEBO_GUI_BUILDING_BUILDINGMODELMANIP_HH_
18 #define GAZEBO_GUI_BUILDING_BUILDINGMODELMANIP_HH_
19 
20 #include <string>
21 #include <ignition/math/Color.hh>
22 
23 #include "gazebo/gui/qt.h"
24 
26 
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace gui
32  {
33  // Forward declare pointers.
34  class BuildingMaker;
35  // Forward declare private data.
36  class BuildingModelManipPrivate;
37 
40 
43  class GZ_GUI_VISIBLE BuildingModelManip : public QObject
44  {
45  Q_OBJECT
46 
48  public: BuildingModelManip();
49 
51  public: virtual ~BuildingModelManip();
52 
55  public: std::string Name() const;
56 
59  public: rendering::VisualPtr Visual() const;
60 
63  public: double Transparency() const;
64 
67  public: ignition::math::Color Color() const;
68 
71  public: std::string Texture() const;
72 
75  public: void SetName(const std::string &_name);
76 
79  public: void SetVisual(const rendering::VisualPtr &_visual);
80 
83  public: void SetMaker(BuildingMaker *_maker);
84 
92  public: void SetPose(double _x, double _y, double _z,
93  double _roll, double _pitch, double _yaw);
94 
99  public: void SetPosition(double _x, double _y, double _z);
100 
105  public: void SetRotation(double _roll, double _pitch, double _yaw);
106 
111  public: void SetSize(double _width, double _depth, double _height);
112 
115  public: void SetColor(QColor _color);
116 
119  public: void SetTexture(QString _texture);
120 
123  public: void SetTransparency(float _transparency);
124 
127  public: void SetVisible(bool _visible);
128 
131  public: void SetLevel(const int _level);
132 
135  public: int Level() const;
136 
140  Q_SIGNALS: void ColorChanged(const ignition::math::Color &_color);
141 
145  Q_SIGNALS: void TextureChanged(const std::string &_texture);
146 
155  private slots: void OnPoseChanged(double _x, double _y, double _z,
156  double _roll, double _pitch, double _yaw);
157 
166  private slots: void OnPoseOriginTransformed(double _x, double _y,
167  double _z, double _roll, double _pitch, double _yaw);
168 
174  private slots: void OnPositionChanged(double _x, double _y, double _z);
175 
181  private slots: void OnRotationChanged(double _roll, double _pitch,
182  double _yaw);
183 
189  private slots: void OnSizeChanged(double _width, double _depth,
190  double _height);
191 
195  private slots: void OnWidthChanged(double _width);
196 
200  private slots: void OnHeightChanged(double _height);
201 
205  private slots: void OnDepthChanged(double _depth);
206 
210  private slots: void OnPosXChanged(double _posX);
211 
215  private slots: void OnPosYChanged(double _posY);
216 
220  private slots: void OnPosZChanged(double _posZ);
221 
225  private slots: void OnYawChanged(double _yaw);
226 
230  private slots: void OnLevelChanged(int _level);
231 
235  private slots: void OnColorChanged(const ignition::math::Color &_color);
236 
240  private slots: void OnTextureChanged(const std::string &_texture);
241 
245  private slots: void OnTransparencyChanged(float _transparency);
246 
248  private slots: void OnDeleted();
249 
254  private: void OnChangeLevel(int _level);
255 
258  private: std::unique_ptr<BuildingModelManipPrivate> dataPtr;
259  };
261  }
262 }
263 #endif
Create and manage 3D visuals of a building.
Definition: BuildingMaker.hh:48
A convenient structure for storing level information.
Definition: EditorView.hh:45
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
Manipulate a 3D visual associated to a 2D editor item.
Definition: BuildingModelManip.hh:43