45 BaseWidget(parent,
"virtual_camera_rotation_widget",
"Virtual Camera Rotation"),
46 mVerticalLayout(new QVBoxLayout(this)),
47 mToolSelector(toolSelector)
49 QLabel *title =
new QLabel(tr(
"Virtual Camera Rotation"));
50 title->setStyleSheet(
"font-weight: bold");
51 mVerticalLayout->addWidget(title,0,Qt::AlignLeft);
54 mVerticalLayout->addWidget(
new QLabel(
"<font color=red>Caution: sMt is changed directly by this control.</font>"));
56 QLabel *labelRot =
new QLabel(tr(
"Rotate (360 deg)"));
57 mRotateDial =
new QDial;
58 mRotateDial->setMinimum(-180);
59 mRotateDial->setMaximum(180);
60 mRotateDial->setNotchesVisible(
true);
62 mVerticalLayout->addWidget(labelRot,0,Qt::AlignLeft);
63 mVerticalLayout->addWidget(mRotateDial,0,Qt::AlignRight);
65 this->setLayout(mVerticalLayout);
67 connect(mRotateDial, &QDial::valueChanged,
this, &VirtualCameraRotationWidget::toolRotationChanged);
68 connect(mToolSelector.get(), SIGNAL(changed()),
this, SLOT(toolCalibrationChanged()));
78 return "virtual_camera_rotation_widget";
81 void VirtualCameraRotationWidget::toolCalibrationChanged()
87 mRotateDial->blockSignals(
true);
89 mDecomposition.
reset(tool->getCalibration_sMt());
92 mRotateDial->setValue(zAngle);
94 mRotateDial->blockSignals(
false);
97 void VirtualCameraRotationWidget::toolRotationChanged()
104 double zAngleUpdated = mRotateDial->value()*
M_PI/180;
106 angles(2) = zAngleUpdated;
109 tool->setCalibration_sMt(M);
112 ToolPtr VirtualCameraRotationWidget::getTool()
114 ToolPtr tool = mToolSelector->getTool();
117 ToolPtr baseTool = tool->getBaseTool();
124 QString VirtualCameraRotationWidget::defaultWhatsThis()
const
127 "<h3>VirtualCameraRotationWidget.</h3>"
128 "<p>Rotates virtual camera (calibration).</p>"