JointInspector.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 
18 #ifndef _GAZEBO_GUI_JOINT_INSPECTOR_HH_
19 #define _GAZEBO_GUI_JOINT_INSPECTOR_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include <ignition/math/Pose3.hh>
25 #include <ignition/math/Vector3.hh>
26 
27 #include "gazebo/gui/qt.h"
28 #include "gazebo/msgs/msgs.hh"
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace gui
34  {
35  class JointMaker;
36 
37  // Forward declare private data.
38  class JointInspectorPrivate;
39 
42  class GZ_GUI_VISIBLE JointInspector : public QDialog
43  {
44  Q_OBJECT
45 
49  public: JointInspector(JointMaker *_jointMaker, QWidget *_parent = 0);
50 
52  public: ~JointInspector();
53 
56  public: void Update(ConstJointPtr _jointMsg);
57 
60  public: msgs::Joint *Data() const;
61 
64  public: void SetPose(const ignition::math::Pose3d &_pose);
65 
67  public: void Open();
68 
72  public: void SetJointId(const std::string &_id);
73 
76  protected: virtual void enterEvent(QEvent *_event);
77 
82  private slots: void OnEnumChanged(const QString &_name,
83  const QString &_value);
84 
89  private slots: void OnPoseChanged(const QString &_name,
90  const ignition::math::Pose3d &_value);
91 
96  private slots: void OnVector3dChanged(const QString &_name,
97  const ignition::math::Vector3d &_value);
98 
103  private slots: void OnStringChanged(const QString &_name,
104  const std::string &_value);
105 
108  private: void OnJointTypeChanged(const QString &_value);
109 
112  private: void OnLinksChanged(const QString &_linkName = "");
113 
115  private slots: void OnSwap();
116 
119  private slots: void OnLinkInserted(const std::string &_linkName);
120 
123  private slots: void OnLinkRemoved(const std::string &_linkName);
124 
126  Q_SIGNALS: void Applied();
127 
129  private slots: void OnRemove();
130 
132  private slots: void OnCancel();
133 
135  private slots: void OnOK();
136 
138  private slots: void RestoreOriginalData();
139 
142  private: void keyPressEvent(QKeyEvent *_event);
143 
146  private: bool CheckValid();
147 
150  private: void closeEvent(QCloseEvent *_event);
151 
154  private: std::unique_ptr<JointInspectorPrivate> dataPtr;
155  };
157  }
158 }
159 
160 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Handles the creation of joints in the model editor.
Definition: JointMaker.hh:76
A class to inspect and modify joints.
Definition: JointInspector.hh:42