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 
94  private slots: void UncheckAllAlign();
95 
98  private slots: void OnType(const int _typeInt);
99 
101  private slots: void OnSwap();
102 
104  private slots: void OnCancel();
105 
107  private slots: void OnCreate();
108 
111  public: void SetParent(const std::string &_linkName);
112 
115  public: void SetChild(const std::string &_linkName);
116 
118  private: void CheckLinksValid();
119 
122  private: bool CheckValid();
123 
128  private: void OnParentImpl(const std::string &_linkName);
129 
134  private: void OnChildImpl(const std::string &_linkName);
135 
136  // Documentation inherited
137  private: void keyPressEvent(QKeyEvent *_event);
138 
141  private: std::unique_ptr<JointCreationDialogPrivate> dataPtr;
142  };
144  }
145 }
146 
147 #endif
#define GZ_GUI_VISIBLE
Definition: system.hh:284
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