27 #include <QFileDialog>
28 #include <QMessageBox>
55 m_Controls =
new Ui::QmitkIGTConnectionWidgetControls;
64 connect( (QObject*)(
m_Controls->connectButton), SIGNAL(clicked()),
this, SLOT(
OnConnect()) );
77 QString fileName = QFileDialog::getOpenFileName(NULL,tr(
"Open Navigation tool storage"),
"/", tr(
"Toolfile (*.tfl)"));
87 m_Controls->connectButton->setText(
"Disconnect");
90 m_Controls->trackingDeviceConfigurationWidget->setEnabled(
false);
97 QMessageBox::warning(NULL,
"Warning",error);
110 MITK_ERROR<<
"Could not create TrackingDevice";
128 m_Controls->connectButton->setText(
"Connect");
130 m_Controls->trackingDeviceConfigurationWidget->setEnabled(
true);
140 std::string
filename = qFilename.toStdString();
145 if (tempStorage.IsNull())
153 if (tempStorage->GetToolCount()>0)
155 lastDevice = tempStorage->GetTool(0)->GetTrackingDeviceType();
159 m_ErrorMessage =
"Error: Didn't find a tool in the storage. Do you want to navigate without even an instrument?";
163 for (
int i=1; i<tempStorage->GetToolCount(); i++)
165 if (lastDevice!=tempStorage->GetTool(i)->GetTrackingDeviceType())
167 m_ErrorMessage =
"Error: Toolfile contains tools of different tracking devices which is not acceptable for this application.";
170 else lastDevice = tempStorage->GetTool(i)->GetTrackingDeviceType();
173 if (
m_TrackingDevice->GetType()!=tempStorage->GetTool(0)->GetTrackingDeviceType())
175 m_ErrorMessage =
"Tools are not compliant with this tracking device. Please use correct toolfile for specified device.";
183 m_ErrorMessage =
"Error: No DataStorage available! Make sure the widget is initialized with a DataStorage";
193 if (currentNode.IsNotNull())
itk::SmartPointer< Self > Pointer
static const std::string filename
std::string TrackingDeviceType
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.