29 #include "ui_editConstraintDialog.h" 32 #define M_PI 3.14159265358979323846 40 _ui =
new Ui_EditConstraintDialog();
48 _ui->roll->setValue(roll);
49 _ui->pitch->setValue(pitch);
50 _ui->yaw->setValue(yaw);
51 _ui->linear_sigma->setValue(linearSigma);
52 _ui->angular_sigma->setValue(angularSigma);
54 connect(
_ui->checkBox_radians, SIGNAL(stateChanged(
int)),
this, SLOT(
switchUnits()));
55 _ui->checkBox_radians->setChecked(
false);
65 double conversion = 180.0/
M_PI;
66 if(
_ui->checkBox_radians->isChecked())
68 conversion =
M_PI/180.0;
70 QVector<QDoubleSpinBox*> boxes;
71 boxes.push_back(
_ui->roll);
72 boxes.push_back(
_ui->pitch);
73 boxes.push_back(
_ui->yaw);
74 boxes.push_back(
_ui->angular_sigma);
75 for(
int i=0; i<boxes.size(); ++i)
77 double value = boxes[i]->value()*conversion;
78 if(
_ui->checkBox_radians->isChecked())
80 if(boxes[i]!=
_ui->angular_sigma)
82 boxes[i]->setMinimum(-
M_PI);
84 boxes[i]->setMaximum(
M_PI);
85 boxes[i]->setSuffix(
" rad");
86 boxes[i]->setSingleStep(0.01);
90 if(boxes[i]!=
_ui->angular_sigma)
92 boxes[i]->setMinimum(-180);
94 boxes[i]->setMaximum(180);
95 boxes[i]->setSuffix(
" deg");
96 boxes[i]->setSingleStep(1);
98 boxes[i]->setValue(value);
104 double conversion = 1.0f;
105 if(!
_ui->checkBox_radians->isChecked())
107 conversion =
M_PI/180.0;
109 return Transform(
_ui->x->value(),
_ui->y->value(),
_ui->z->value(),
_ui->roll->value()*conversion,
_ui->pitch->value()*conversion,
_ui->yaw->value()*conversion);
114 return _ui->linear_sigma->value();
118 double conversion = 1.0f;
119 if(!
_ui->checkBox_radians->isChecked())
121 conversion =
M_PI/180.0;
123 return _ui->angular_sigma->value()*conversion;
GLM_FUNC_DECL T roll(detail::tquat< T, P > const &x)
EditConstraintDialog(const Transform &constraint, double linearSigma=0, double angularSigma=0, QWidget *parent=0)
double getAngularVariance() const
virtual ~EditConstraintDialog()
double getLinearVariance() const
GLM_FUNC_DECL T pitch(detail::tquat< T, P > const &x)
Transform getTransform() const
Ui_EditConstraintDialog * _ui
GLM_FUNC_DECL T yaw(detail::tquat< T, P > const &x)