All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BuildingModelManip.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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/math/Pose.hh"
24 #include "gazebo/math/Vector3.hh"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  class BuildingMaker;
33 
36 
39  class GAZEBO_VISIBLE BuildingModelManip : public QObject
40  {
41  Q_OBJECT
42 
44  public: BuildingModelManip();
45 
47  public: virtual ~BuildingModelManip();
48 
51  public: std::string GetName() const;
52 
55  public: rendering::VisualPtr GetVisual() const;
56 
59  public: void SetName(const std::string &_name);
60 
63  public: void SetVisual(const rendering::VisualPtr &_visual);
64 
67  public: void SetMaker(BuildingMaker *_maker);
68 
71  public: BuildingModelManip *GetParent() const;
72 
75  public: void AttachManip(BuildingModelManip *_manip);
76 
79  public: void DetachManip(BuildingModelManip *_manip);
80 
83  public: void SetAttachedTo(BuildingModelManip *_parent);
84 
86  public: void DetachFromParent();
87 
91  public: BuildingModelManip *GetAttachedManip(unsigned int _index) const;
92 
97  public: unsigned int GetAttachedManipCount() const;
98 
101  public: bool IsAttached() const;
102 
110  public: void SetPose(double _x, double _y, double _z,
111  double _roll, double _pitch, double _yaw);
112 
117  public: void SetPosition(double _x, double _y, double _z);
118 
123  public: void SetRotation(double _roll, double _pitch, double _yaw);
124 
129  public: void SetSize(double _width, double _depth, double _height);
130 
139  private slots: void OnPoseChanged(double _x, double _y, double _z,
140  double _roll, double _pitch, double _yaw);
141 
150  private slots: void OnPoseOriginTransformed(double _x, double _y,
151  double _z, double _roll, double _pitch, double _yaw);
152 
158  private slots: void OnPositionChanged(double _x, double _y, double _z);
159 
165  private slots: void OnRotationChanged(double _roll, double _pitch,
166  double _yaw);
167 
173  private slots: void OnSizeChanged(double _width, double _depth,
174  double _height);
175 
179  private slots: void OnWidthChanged(double _width);
180 
184  private slots: void OnHeightChanged(double _height);
185 
189  private slots: void OnDepthChanged(double _depth);
190 
194  private slots: void OnPosXChanged(double _posX);
195 
199  private slots: void OnPosYChanged(double _posY);
200 
204  private slots: void OnPosZChanged(double _posZ);
205 
209  private slots: void OnYawChanged(double _yaw);
210 
212  private slots: void OnDeleted();
213 
215  private: std::string name;
216 
218  private: rendering::VisualPtr visual;
219 
221  private: math::Vector3 size;
222 
224  private: math::Pose pose;
225 
227  private: BuildingMaker *maker;
228 
230  private: std::vector<BuildingModelManip *> attachedManips;
231 
233  private: BuildingModelManip * parent;
234  };
236  }
237 }
238 #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:51
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:100
#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:39