LinkInspector.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_GUI_LINK_INSPECTOR_HH_
19 #define _GAZEBO_GUI_LINK_INSPECTOR_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include <ignition/math/Vector3.hh>
25 
26 #include "gazebo/gui/qt.h"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace gui
32  {
33  class CollisionConfig;
34  class LinkConfig;
35  class VisualConfig;
36 
37  // Forward declare private data.
38  class LinkInspectorPrivate;
39 
40  class GZ_GUI_VISIBLE LinkInspector : public QDialog
41  {
42  Q_OBJECT
43 
46  public: LinkInspector(QWidget *_parent = 0);
47 
49  public: ~LinkInspector();
50 
53  public: void SetName(const std::string &_name);
54 
57  public: std::string Name() const;
58 
61  public: LinkConfig *GetLinkConfig() const;
62 
65  public: VisualConfig *GetVisualConfig() const;
66 
69  public: CollisionConfig *GetCollisionConfig() const;
70 
73  public: void SetLinkId(const std::string &_id);
74 
76  public: void Open();
77 
80  protected: virtual void enterEvent(QEvent *_event);
81 
84  private: double ComputeVolume() const;
85 
89  private: ignition::math::Vector3d ComputeInertia(
90  const double _mass) const;
91 
94  // public: void SetName(const std::string &_name);
95 
97  Q_SIGNALS: void Applied();
98 
101  Q_SIGNALS: void Accepted();
102 
104  private slots: void OnRemove();
105 
107  private slots: void OnCancel();
108 
110  private slots: void OnOK();
111 
113  private slots: void OnConfigApplied();
114 
117  private slots: void OnDensityValueChanged(const double _value);
118 
121  private slots: void OnMassValueChanged(const double _value);
122 
126  private slots: void OnCollisionChanged(const std::string &_name,
127  const std::string &_type);
128 
130  private slots: void RestoreOriginalData();
131 
134  private: void keyPressEvent(QKeyEvent *_event);
135 
138  private: void closeEvent(QCloseEvent *_event);
139 
142  private: std::unique_ptr<LinkInspectorPrivate> dataPtr;
143  };
145  }
146 }
147 
148 #endif
Definition: LinkInspector.hh:40
A tab for configuring visual properties of a link.
Definition: VisualConfig.hh:68
A tab for configuring properties of a link.
Definition: LinkConfig.hh:38
A tab for configuring collision properties of a link.
Definition: CollisionConfig.hh:77