JointCreationDialog.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_JOINT_CREATION_DIALOG_HH_
19 #define _GAZEBO_GUI_JOINT_CREATION_DIALOG_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"
29 
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
34  namespace gui
35  {
36  // Forward declare private data.
37  class JointCreationDialogPrivate;
38 
41  class GZ_GUI_VISIBLE JointCreationDialog : public QDialog
42  {
43  Q_OBJECT
44 
48  public: JointCreationDialog(JointMaker *_jointMaker,
49  QWidget *_parent = 0);
50 
52  public: ~JointCreationDialog();
53 
56  public: void Open(const JointMaker::JointType _type);
57 
60  public: void UpdateRelativePose(const ignition::math::Pose3d &_pose);
61 
63  private slots: void OnLinkFromDialog();
64 
69  private slots: void OnVector3dFromDialog(const QString &_name,
70  const ignition::math::Vector3d &_pose);
71 
76  private slots: void OnPoseFromDialog(const QString &_name,
77  const ignition::math::Pose3d &_pose);
78 
83  private slots: void OnEnumChanged(const QString &_name,
84  const QString &_value);
85 
87  private slots: void OnResetAll();
88 
91  private slots: void OnAlign(const int _int);
92 
95  private slots: void UncheckAllAlign(const bool _blockSignals = false);
96 
99  private slots: void OnType(const int _typeInt);
100 
102  private slots: void OnSwap();
103 
105  private slots: void OnCancel();
106 
108  private slots: void OnCreate();
109 
112  public: void SetParent(const std::string &_linkName);
113 
116  public: void SetChild(const std::string &_linkName);
117 
119  private: void CheckLinksValid();
120 
123  private: bool CheckValid();
124 
129  private: void OnParentImpl(const std::string &_linkName);
130 
135  private: void OnChildImpl(const std::string &_linkName);
136 
137  // Documentation inherited
138  private: void keyPressEvent(QKeyEvent *_event);
139 
142  private: std::unique_ptr<JointCreationDialogPrivate> dataPtr;
143  };
145  }
146 }
147 
148 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
A class to inspect and modify joints.
Definition: JointCreationDialog.hh:41
Handles the creation of joints in the model editor.
Definition: JointMaker.hh:77
JointType
Definition: JointMaker.hh:83