LinkConfig.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-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 
18 #ifndef _GAZEBO_LINK_CONFIG_HH_
19 #define _GAZEBO_LINK_CONFIG_HH_
20 
21 #include <string>
22 
23 #include "gazebo/math/Pose.hh"
24 #include "gazebo/msgs/msgs.hh"
25 #include "gazebo/gui/qt.h"
26 
27 namespace gazebo
28 {
29  namespace gui
30  {
31  class ConfigWidget;
32 
35 
38  class GZ_GUI_VISIBLE LinkConfig : public QWidget
39  {
40  Q_OBJECT
41 
43  public: LinkConfig();
44 
46  public: virtual ~LinkConfig();
47 
50  public: void Update(ConstLinkPtr _linkMsg);
51 
54  public: msgs::Link *GetData() const;
55 
58  public: void SetPose(const ignition::math::Pose3d &_pose);
59 
62  public: void SetMass(const double _mass);
63 
66  public: double Mass() const;
67 
70  public: void SetDensity(const double _density);
71 
74  public: double Density() const;
75 
83  public: void SetInertiaMatrix(const double _ixx, const double _iyy,
84  const double _izz, const double _ixy, const double _ixz,
85  const double _iyz);
86 
89  public: void SetInertialPose(const ignition::math::Pose3d &_pose);
90 
93  public: const ConfigWidget *LinkConfigWidget() const;
94 
96  public: void Init();
97 
99  public slots: void RestoreOriginalData();
100 
102  Q_SIGNALS: void Applied();
103 
106  Q_SIGNALS: void DensityValueChanged(const double _value);
107 
110  Q_SIGNALS: void MassValueChanged(const double _value);
111 
114  private slots: void OnDensityValueChanged(const double _value);
115 
118  private slots: void OnMassValueChanged(const double _value);
119 
124  private slots: void OnPoseChanged(const QString &_name,
125  const ignition::math::Pose3d &_value);
126 
128  private: ConfigWidget *configWidget;
129 
132  private: msgs::Link originalDataMsg;
133  };
135  }
136 }
137 #endif
A widget generated from a google protobuf message.
Definition: ConfigWidget.hh:193
A tab for configuring properties of a link.
Definition: LinkConfig.hh:38
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.