JointInspector.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-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 
18 #ifndef _JOINT_INSPECTOR_HH_
19 #define _JOINT_INSPECTOR_HH_
20 
21 #include <string>
22 #include <vector>
23 
24 #include "gazebo/gui/qt.h"
26 #include "gazebo/util/system.hh"
27 
28 
29 namespace gazebo
30 {
31  namespace gui
32  {
33  class JointMaker;
34 
37  class GAZEBO_VISIBLE JointInspector : public QDialog
38  {
39  Q_OBJECT
40 
44  public: JointInspector(JointMaker::JointType _jointType,
45  QWidget *_parent = 0);
46 
48  public: ~JointInspector();
49 
52  public: math::Pose GetPose() const;
53 
57  public: math::Vector3 GetAxis(unsigned int _index) const;
58 
62  public: double GetLowerLimit(unsigned int _index) const;
63 
67  public: double GetUpperLimit(unsigned int _index) const;
68 
71  public: JointMaker::JointType GetType() const;
72 
75  public: std::string GetName() const;
76 
79  public: void SetName(const std::string &_name);
80 
83  public: void SetParent(const std::string &_parent);
84 
87  public: void SetChild(const std::string &_child);
88 
91  public: void SetPose(const math::Pose &_pose);
92 
96  public: void SetAxis(unsigned int _index, const math::Vector3 &_axis);
97 
101  public: void SetLowerLimit(unsigned int _index, double _lower);
102 
106  public: void SetUpperLimit(unsigned int _index, double _upper);
107 
110  public: void SetType(JointMaker::JointType _type);
111 
113  Q_SIGNALS: void Applied();
114 
116  private slots: void OnJointTypeChanged(int _index);
117 
119  private slots: void OnCancel();
120 
122  private slots: void OnApply();
123 
125  private slots: void OnOK();
126 
128  private: QLineEdit* jointNameLineEdit;
129 
131  private: QLabel* jointParentLabel;
132 
134  private: QLabel* jointChildLabel;
135 
137  private: QComboBox *jointTypeComboBox;
138 
140  private: QDoubleSpinBox *poseXSpinBox;
141 
143  private: QDoubleSpinBox *poseYSpinBox;
144 
146  private: QDoubleSpinBox *poseZSpinBox;
147 
149  private: QDoubleSpinBox *poseRollSpinBox;
150 
152  private: QDoubleSpinBox *posePitchSpinBox;
153 
155  private: QDoubleSpinBox *poseYawSpinBox;
156 
158  private: std::vector<QDoubleSpinBox *> axisXSpinBoxes;
159 
161  private: std::vector<QDoubleSpinBox *> axisYSpinBoxes;
162 
164  private: std::vector<QDoubleSpinBox *> axisZSpinBoxes;
165 
167  private: std::vector<QDoubleSpinBox *> lowerLimitSpinBoxes;
168 
170  private: std::vector<QDoubleSpinBox *> upperLimitSpinBoxes;
171 
173  private: JointMaker::JointType jointType;
174 
176  private: std::vector<QGroupBox *> axisGroupBoxes;
177  };
179  }
180 }
181 
182 #endif
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
JointType
Definition: JointMaker.hh:63
A class to inspect and modify joints.
Definition: JointInspector.hh:37
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48