17#include <mitkSurface.h>
23#include <mitkIGTException.h>
24#include <mitkIOUtil.h>
28#include <qfiledialog.h>
29#include <qmessagebox.h>
34 m_RealTimePlayer(
mitk::NavigationDataPlayer::New()),
35 m_SequentialPlayer(
mitk::NavigationDataSequentialPlayer::New()),
37 m_CurrentSequentialPointNumber(0),
38 m_Controls(new
Ui::QmitkIGTPlayerWidgetControls)
45 m_Controls->samplePositionHorizontalSlider->setVisible(
false);
62 connect( (QObject*) (
m_Controls->stopPushButton), SIGNAL(clicked()),
this, SLOT(
OnGoToEnd()) );
77 return m_Controls->splineModeCheckBox->isChecked();
87 QMessageBox::warning(
nullptr,
"IGTPlayer: Error",
"No valid input file was loaded. Please load input file first!");
96 unsigned int result = 0;
155 mitk::NavigationDataSet::Pointer navigationDataSet;
162 std::string errormessage =
"Error during start playing. Invalid or wrong file?";
163 QMessageBox::warning(
nullptr,
"IGTPlayer: Error", errormessage.c_str());
164 m_Controls->playPushButton->setChecked(
false);
179 std::string errormessage =
"Error during start playing. Invalid or wrong file?";
180 QMessageBox::warning(
nullptr,
"IGTPlayer: Error", errormessage.c_str());
181 m_Controls->playPushButton->setChecked(
false);
186 else if(isSequentialMode)
195 std::string errormessage =
"Error during start playing. Invalid or wrong file type?";
196 QMessageBox::warning(
nullptr,
"IGTPlayer: Error", errormessage.c_str());
197 m_Controls->playPushButton->setChecked(
false);
202 m_Controls->samplePositionHorizontalSlider->setMinimum(0);
206 m_Controls->samplePositionHorizontalSlider->setEnabled(
true);
235 m_Controls->playPushButton->setChecked(
false);
271 m_Controls->playPushButton->setChecked(
false);
296 msc = (msc - ms) / 1000;
298 int min = (msc-s) / 60;
342 std::vector<mitk::NavigationData::Pointer> navDatas;
365 mitk::PointSet::Pointer result = mitk::PointSet::New();
367 mitk::PointSet::PointType pointType;
384 pointType[0] = position[0];
385 pointType[1] = position[1];
386 pointType[2] = position[2];
388 result->InsertPoint(i,pointType);
398 throw std::out_of_range(
"Tool Index out of range!");
405 mitk::PointSet::PointType result;
413 else if(isSequentialMode)
416 result[0] = position[0];
417 result[1] = position[1];
418 result[2] = position[2];
439 QFile file(filename);
443 if ( filename.isEmpty() || ! file.exists() )
445 QMessageBox::warning(
nullptr,
"Warning", QString(
"Please enter valid path. Using previous path again."));
461 m_Controls->m_PlayerControlsGroupBox->setEnabled(
true);
486 m_Controls->playPushButton->setChecked(
false);
492 m_Controls->minLCDNumber->display(QString(
"00"));
493 m_Controls->secLCDNumber->display(QString(
"00"));
494 m_Controls->msecLCDNumber->display(QString(
"000"));
499 QComboBox* cBox =
m_Controls->trajectorySelectComboBox;
501 if(cBox->count() > 0)
507 if(!toolNames.isEmpty())
508 m_Controls->trajectorySelectComboBox->insertItems(0, toolNames);
516 return m_Controls->resolutionSpinBox->value();
524 m_Controls->trajectorySelectComboBox->clear();
536 m_Controls->samplePositionHorizontalSlider->setEnabled(
true);
540 m_Controls->samplePositionHorizontalSlider->setSliderPosition(0);
541 m_Controls->samplePositionHorizontalSlider->setDisabled(
true);
547 int currentSliderValue =
m_Controls->samplePositionHorizontalSlider->value();
551 auto snapshotNumber =
static_cast<unsigned int>(currentSliderValue);
554 m_Controls->sampleLCDNumber->display(currentSliderValue);
static void SetLastFileLoadPathByFileName(const QString &str)
static const QString GetLastFileLoadPath()
An object of this class represents an exception of the MITK-IGT module.
Data structure which stores streams of mitk::NavigationData for multiple tools.
mitk::Point3D PositionType
Type that holds the position part of the tracking data.