19 mVerticalLayout =
new QVBoxLayout(
this);
21 mVerticalLayout->setMargin(0);
23 mVerticalLayout->addWidget(
new QLabel(
"Define the operating table up direction. See the preferences help page for more information."));
25 QHBoxLayout* buttonLayout =
new QHBoxLayout;
26 mVerticalLayout->addLayout(buttonLayout);
28 QPushButton* toolDefineGravityButton =
new QPushButton(
"Tool direction is down");
29 connect(toolDefineGravityButton, &QPushButton::clicked,
this, &OperatingTableWidget::onDefineDownWithTool);
30 buttonLayout->addWidget(toolDefineGravityButton);
32 QPushButton* definePatientAnteriorUpButton =
new QPushButton(
"Patient Anterior Up");
33 connect(definePatientAnteriorUpButton, &QPushButton::clicked,
this, &OperatingTableWidget::onDefinePatientAnteriorUp);
34 buttonLayout->addWidget(definePatientAnteriorUpButton);
36 QPushButton* definePatientPosteriorUpButton =
new QPushButton(
"Patient Posterior Up");
37 connect(definePatientPosteriorUpButton, &QPushButton::clicked,
this, &OperatingTableWidget::onDefinePatientPosteriorUp);
38 buttonLayout->addWidget(definePatientPosteriorUpButton);
40 QPushButton* definePatientSuperiorUpButton =
new QPushButton(
"Patient Superior Up");
41 connect(definePatientSuperiorUpButton, &QPushButton::clicked,
this, &OperatingTableWidget::onDefinePatientSuperiorUp);
42 buttonLayout->addWidget(definePatientSuperiorUpButton);
44 mLabel =
new QLabel(
"Table transformation matrix, rMot:");
45 mVerticalLayout->addWidget(mLabel);
47 mVerticalLayout->addWidget(mMatrixWidget);
56 mVerticalLayout->addStretch();
59 this, &OperatingTableWidget::backendChanged);
64 this->backendChanged();
70 void OperatingTableWidget::backendChanged()
72 mMatrixWidget->blockSignals(
true);
78 mMatrixWidget->blockSignals(
false);
85 void OperatingTableWidget::matrixWidgetChanged()
89 mServices->patient()->setOperatingTable(table);
92 void OperatingTableWidget::onDefineDownWithTool()
95 Vector3D toolUp = -Vector3D::UnitZ();
97 this->setNewUp(newUp);
99 void OperatingTableWidget::onDefinePatientAnteriorUp()
101 this->setNewUp(-Vector3D::UnitY());
103 void OperatingTableWidget::onDefinePatientPosteriorUp()
105 this->setNewUp(Vector3D::UnitY());
107 void OperatingTableWidget::onDefinePatientSuperiorUp()
109 this->setNewUp(Vector3D::UnitZ());
112 void OperatingTableWidget::setNewUp(
Vector3D newUp)
119 mServices->patient()->setOperatingTable(table);
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Transform3D createTransformRotationBetweenVectors(Vector3D from, Vector3D to)
Utility class for describing a bounded numeric range.
static CoordinateSystem reference()
static Vector3DPropertyPtr initialize(const QString &uid, QString name, QString help, Vector3D value, DoubleRange range, int decimals, QDomNode root=QDomNode())
Vector3D getVectorUp() const
Returns the table's up vector in R space.
Transform3D rMot
Transform from OT to reference space.
void operatingTableChanged()
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
boost::shared_ptr< class CoreServices > CoreServicesPtr
The OperatingTable class.
Namespace for all CustusX production code.