35 #include <QPushButton>
50 RegistrationBaseWidget(services, parent,
"org_custusx_registration_method_plate_reference_landmarks",
"Plate Registration Reference landmarks"),
51 mPlateRegistrationButton(new QPushButton(
"Load registration points", this)),
52 mReferenceToolInfoLabel(new QLabel(
"", this))
54 connect(mPlateRegistrationButton, SIGNAL(clicked()),
this, SLOT(plateRegistrationSlot()));
57 QVBoxLayout* toptopLayout =
new QVBoxLayout(
this);
58 toptopLayout->addWidget(mReferenceToolInfoLabel);
59 toptopLayout->addWidget(mPlateRegistrationButton);
60 toptopLayout->addStretch();
62 this->internalUpdate();
70 void PlateRegistrationWidget::showEvent(QShowEvent* event)
74 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
76 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
81 void PlateRegistrationWidget::hideEvent(QHideEvent* event)
83 BaseWidget::hideEvent(event);
85 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
87 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
92 void PlateRegistrationWidget::landmarkUpdatedSlot()
97 void PlateRegistrationWidget::plateRegistrationSlot()
107 std::map<int, Vector3D> referencePoints = refTool->getReferencePoints();
108 if(referencePoints.empty())
110 reportDebug(
"No referenceppoints in reftool "+refTool->getName());
114 std::map<int, Vector3D>::iterator it = referencePoints.begin();
115 for(; it != referencePoints.end(); ++it)
124 LandmarkPropertyMap::iterator landmarkIt = map.begin();
125 for(; landmarkIt != map.end(); ++landmarkIt)
131 mPlateRegistrationButton->setDisabled(
true);
134 void PlateRegistrationWidget::internalUpdate()
138 QString labelText =
"";
139 if(!refTool || refTool->getReferencePoints().size()<1)
141 mPlateRegistrationButton->setDisabled(
true);
143 labelText.append(
"Configure the tracker to have <br>a reference frame that has at least <br>one reference point.");
146 mPlateRegistrationButton->setEnabled(
true);
148 labelText =
"<b>Reference tool selected:</b> <br>";
149 labelText.append(
"Tool name: <i>"+refTool->getName()+
"</i><br>");
150 labelText.append(
"Number of defined reference points: <i>"+
qstring_cast(refTool->getReferencePoints().size())+
"</i>");
153 mReferenceToolInfoLabel->setText(labelText);
QString qstring_cast(const T &val)
void landmarkAdded(QString uid)
VisualizationServicePtr visualizationService
TrackingServicePtr trackingService
std::map< QString, LandmarkProperty > LandmarkPropertyMap
PatientModelServicePtr patientModelService
void landmarkRemoved(QString uid)
void reportDebug(QString msg)
RegistrationServicePtr registrationService
boost::shared_ptr< class Tool > ToolPtr