BuildingModelManip.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 _BUILDING_MODEL_MANIP_HH_
18 #define _BUILDING_MODEL_MANIP_HH_
19 
20 #include <string>
21 #include <vector>
22 #include "gazebo/gui/qt.h"
23 #include "gazebo/common/Color.hh"
24 #include "gazebo/common/Event.hh"
25 #include "gazebo/math/Pose.hh"
26 #include "gazebo/math/Vector3.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace gui
33  {
34  class BuildingMaker;
35 
38 
41  class GAZEBO_VISIBLE BuildingModelManip : public QObject
42  {
43  Q_OBJECT
44 
46  public: BuildingModelManip();
47 
49  public: virtual ~BuildingModelManip();
50 
53  public: std::string GetName() const;
54 
57  public: rendering::VisualPtr GetVisual() const;
58 
61  public: double GetTransparency() const;
62 
65  public: common::Color GetColor() const;
66 
69  public: std::string GetTexture() const;
70 
73  public: void SetName(const std::string &_name);
74 
77  public: void SetVisual(const rendering::VisualPtr &_visual);
78 
81  public: void SetMaker(BuildingMaker *_maker);
82 
85  public: BuildingModelManip *GetParent() const;
86 
89  public: void AttachManip(BuildingModelManip *_manip);
90 
93  public: void DetachManip(BuildingModelManip *_manip);
94 
97  public: void SetAttachedTo(BuildingModelManip *_parent);
98 
100  public: void DetachFromParent();
101 
105  public: BuildingModelManip *GetAttachedManip(unsigned int _index) const;
106 
111  public: unsigned int GetAttachedManipCount() const;
112 
115  public: bool IsAttached() const;
116 
124  public: void SetPose(double _x, double _y, double _z,
125  double _roll, double _pitch, double _yaw);
126 
131  public: void SetPosition(double _x, double _y, double _z);
132 
137  public: void SetRotation(double _roll, double _pitch, double _yaw);
138 
143  public: void SetSize(double _width, double _depth, double _height);
144 
147  public: void SetColor(QColor _color);
148 
151  public: void SetTexture(QString _texture);
152 
155  public: void SetTransparency(float _transparency);
156 
159  public: void SetVisible(bool _visible);
160 
163  public: void SetLevel(const int _level);
164 
167  public: int GetLevel() const;
168 
172  Q_SIGNALS: void ColorChanged(QColor _color);
173 
177  Q_SIGNALS: void TextureChanged(QString _texture);
178 
187  private slots: void OnPoseChanged(double _x, double _y, double _z,
188  double _roll, double _pitch, double _yaw);
189 
198  private slots: void OnPoseOriginTransformed(double _x, double _y,
199  double _z, double _roll, double _pitch, double _yaw);
200 
206  private slots: void OnPositionChanged(double _x, double _y, double _z);
207 
213  private slots: void OnRotationChanged(double _roll, double _pitch,
214  double _yaw);
215 
221  private slots: void OnSizeChanged(double _width, double _depth,
222  double _height);
223 
227  private slots: void OnWidthChanged(double _width);
228 
232  private slots: void OnHeightChanged(double _height);
233 
237  private slots: void OnDepthChanged(double _depth);
238 
242  private slots: void OnPosXChanged(double _posX);
243 
247  private slots: void OnPosYChanged(double _posY);
248 
252  private slots: void OnPosZChanged(double _posZ);
253 
257  private slots: void OnYawChanged(double _yaw);
258 
262  private slots: void OnLevelChanged(int _level);
263 
267  private slots: void OnColorChanged(QColor _color);
268 
272  private slots: void OnTextureChanged(QString _texture);
273 
277  private slots: void OnTransparencyChanged(float _transparency);
278 
280  private slots: void OnDeleted();
281 
286  private: void OnChangeLevel(int _level);
287 
289  private: std::string name;
290 
292  private: rendering::VisualPtr visual;
293 
295  private: math::Vector3 size;
296 
298  private: math::Pose pose;
299 
301  private: BuildingMaker *maker;
302 
304  private: std::vector<BuildingModelManip *> attachedManips;
305 
307  private: BuildingModelManip *parent;
308 
310  private: double transparency;
311 
313  private: common::Color color;
314 
316  private: std::string texture;
317 
319  private: int level;
320 
322  private: std::vector<event::ConnectionPtr> connections;
323  };
325  }
326 }
327 #endif
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
Create and manage 3D visuals of a building.
Definition: BuildingMaker.hh:52
Defines a color.
Definition: Color.hh:39
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:102
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
Manipulate a 3D visual associated to a 2D editor item.
Definition: BuildingModelManip.hh:41