LinkInspector.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 GAZEBO_GUI_MODEL_LINKINSPECTOR_HH_
18 #define GAZEBO_GUI_MODEL_LINKINSPECTOR_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <ignition/math/Vector3.hh>
24 
25 #include "gazebo/gui/qt.h"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  class CollisionConfig;
33  class LinkConfig;
34  class VisualConfig;
35 
36  // Forward declare private data.
37  class LinkInspectorPrivate;
38 
39  class GZ_GUI_VISIBLE LinkInspector : public QDialog
40  {
41  Q_OBJECT
42 
45  public: explicit LinkInspector(QWidget *_parent = 0);
46 
48  public: ~LinkInspector();
49 
52  public: void SetName(const std::string &_name);
53 
56  public: std::string Name() const;
57 
60  public: LinkConfig *GetLinkConfig() const;
61 
64  public: VisualConfig *GetVisualConfig() const;
65 
68  public: CollisionConfig *GetCollisionConfig() const;
69 
72  public: void SetLinkId(const std::string &_id);
73 
75  public: void Open();
76 
79  public: void SetShowCollisions(const bool _show);
80 
83  public: void SetShowVisuals(const bool _show);
84 
87  public: void SetShowLinkFrame(const bool _show);
88 
91  protected: virtual void enterEvent(QEvent *_event);
92 
95  private: double ComputeVolume() const;
96 
100  private: ignition::math::Vector3d ComputeInertia(
101  const double _mass) const;
102 
105  // public: void SetName(const std::string &_name);
106 
108  Q_SIGNALS: void Opened();
109 
111  Q_SIGNALS: void Applied();
112 
115  Q_SIGNALS: void Accepted();
116 
120  Q_SIGNALS: void ShowCollisions(const bool _show);
121 
125  Q_SIGNALS: void ShowVisuals(const bool _show);
126 
130  Q_SIGNALS: void ShowLinkFrame(const bool _show);
131 
133  private slots: void OnRemove();
134 
137  private slots: void OnShowCollisions(const bool _show);
138 
141  private slots: void OnShowVisuals(const bool _show);
142 
145  private slots: void OnShowLinkFrame(const bool _show);
146 
148  private slots: void OnCancel();
149 
151  private slots: void OnOK();
152 
154  private slots: void OnConfigApplied();
155 
158  private slots: void OnDensityValueChanged(const double _value);
159 
162  private slots: void OnMassValueChanged(const double _value);
163 
167  private slots: void OnCollisionChanged(const std::string &_name,
168  const std::string &_type);
169 
171  private slots: void RestoreOriginalData();
172 
175  private: void keyPressEvent(QKeyEvent *_event);
176 
179  private: void closeEvent(QCloseEvent *_event);
180 
183  private: std::unique_ptr<LinkInspectorPrivate> dataPtr;
184  };
186  }
187 }
188 
189 #endif
Definition: LinkInspector.hh:39
Forward declarations for the common classes.
Definition: Animation.hh:26
A tab for configuring visual properties of a link.
Definition: VisualConfig.hh:71
gui
Definition: KeyEventHandler.hh:29
A tab for configuring properties of a link.
Definition: LinkConfig.hh:39
A tab for configuring collision properties of a link.
Definition: CollisionConfig.hh:77