diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.cpp b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.cpp index e862eba8f3..e59451d518 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.cpp +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.cpp @@ -1,96 +1,120 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Blueberry #include #include // Qmitk #include "QmitkNavigationDataPlayerView.h" #include "QmitkStdMultiWidget.h" -//mitk -#include -#include -#include - -// Qt -#include +// QT +#include -// vtk -#include +//mitk +#include +#include +#include +#include const std::string QmitkNavigationDataPlayerView::VIEW_ID = "org.mitk.views.navigationdataplayer"; QmitkNavigationDataPlayerView::QmitkNavigationDataPlayerView() : QmitkFunctionality() , m_Controls( 0 ) , m_MultiWidget( NULL ) - , m_Trajectory( NULL ) - , m_TrajectoryIndex( -1 ) - , m_ReloadData( true ) - , m_ShowTrajectory( false ) - , m_SplineMapper( NULL ) - , m_PointSetMapper( NULL ) { - m_TrajectoryPointSet = mitk::PointSet::New(); // PointSet for trajectory points } QmitkNavigationDataPlayerView::~QmitkNavigationDataPlayerView() { } void QmitkNavigationDataPlayerView::CreateQtPartControl( QWidget *parent ) { // build up qt view, unless already done if ( !m_Controls ) { // create GUI widgets from the Qt Designer's .ui file m_Controls = new Ui::QmitkNavigationDataPlayerViewControls; m_Controls->setupUi( parent ); this->CreateBundleWidgets( parent ); this->CreateConnections(); + + // make deselected Player invisible + m_Controls->m_TimedWidget->setVisible(false); } } void QmitkNavigationDataPlayerView::CreateBundleWidgets(QWidget* parent) { //m_PlayerWidget = new QmitkIGTPlayerWidget( parent ); // this bundle's ND player widget } void QmitkNavigationDataPlayerView::CreateConnections() { - //connect( m_PlayerWidget, SIGNAL(SignalPlayingStarted()), this, SLOT(OnCreatePlaybackVisualization()) ); + connect( m_Controls->m_RdbSequential, SIGNAL(released()), this, SLOT(OnSelectPlayer()) ); + connect( m_Controls->m_RdbTimeBased, SIGNAL(released()), this, SLOT(OnSelectPlayer()) ); + connect( m_Controls->m_BtnOpenFile, SIGNAL(released()), this, SLOT(OnOpenFile()) ); } void QmitkNavigationDataPlayerView::OnPlayingStarted() { } -mitk::Color QmitkNavigationDataPlayerView::GetColorCircleColor(int index) -{ - mitk::Color result; +void QmitkNavigationDataPlayerView::OnOpenFile(){ + mitk::NavigationDataSet::Pointer data; + mitk::NavigationDataReaderXML::Pointer reader = mitk::NavigationDataReaderXML::New(); + mitk::NavigationDataSequentialPlayer::Pointer seqPlayer = mitk::NavigationDataSequentialPlayer::New(); + + // FIXME Filter for correct Files + QString fileName = QFileDialog::getOpenFileName(NULL, "Open Navigation Data Set", "", ""); + data = reader->Read(fileName.toStdString()); - mitk::ColorSequenceCycleH colorCycle; + // Update Labels + m_Controls->m_LblFilePath->setText(fileName); + m_Controls->m_LblFrames->setText(QString::number(data->Size())); + m_Controls->m_LblTools->setText(QString::number(data->GetNumberOfTools())); - for(int i=0; i <= index; ++i) + if (m_Controls->m_RdbSequential->isChecked()) { - result = colorCycle.GetNextColor(); + mitk::NavigationDataSequentialPlayer::Pointer seqPlayer = mitk::NavigationDataSequentialPlayer::New(); + m_Controls->m_SequentialWidget->SetPlayer(seqPlayer); + } else { } +} + +void QmitkNavigationDataPlayerView::OnSelectPlayer(){ + if (m_Controls->m_RdbSequential->isChecked()) + { + m_Controls->m_SequentialWidget->setVisible(true); + m_Controls->m_TimedWidget->setVisible(false); + } else { + m_Controls->m_SequentialWidget->setVisible(false); + m_Controls->m_TimedWidget->setVisible(true); + } +} + +void QmitkNavigationDataPlayerView::OnSetRepeat(){ +} + +void QmitkNavigationDataPlayerView::OnSetMicroservice(){ +} - return result; +void QmitkNavigationDataPlayerView::OnSetDisplay(){ } \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h index 20457e0ce1..36b6dd3d01 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h @@ -1,107 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkNavigationDataPlayerView_h #define QmitkNavigationDataPlayerView_h #include //Qmitk #include #include #include #include // ui #include "ui_QmitkNavigationDataPlayerViewControls.h" //mitk #include "MitkIGTUIExports.h" #include #include /*! \brief QmitkNavigationDataPlayerView \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup Functionalities */ class QmitkNavigationDataPlayerView : public QmitkFunctionality { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; QmitkNavigationDataPlayerView(); virtual ~QmitkNavigationDataPlayerView(); virtual void CreateQtPartControl(QWidget *parent); /** \brief This method creates this bundle's SIGNAL and SLOT connections */ virtual void CreateConnections(); protected slots: /*! - \brief Cleans trajectory data before playing is started + \brief TODO */ void OnPlayingStarted(); + void OnOpenFile(); + void OnSelectPlayer(); + void OnSetRepeat(); + void OnSetMicroservice(); + void OnSetDisplay(); + protected: enum TrajectoryStyle { Points = 1, Splines = 2 }; void CreateBundleWidgets(QWidget* parent); Ui::QmitkNavigationDataPlayerViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; QmitkIGTPlayerWidget* m_PlayerWidget; ///< this bundle's playback widget - mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< this filter visualizes the navigation data - - std::vector m_RepresentationObjects; ///< vector for current visualization objects - - mitk::DataNode::Pointer m_Trajectory; ///< main trajectory visualization DataNode - mitk::PointSet::Pointer m_TrajectoryPointSet; ///< PointSet with all points for trajectory - int m_TrajectoryIndex; ///< trajectory tool index - - bool m_ReloadData; ///< flag needed for refresh of visualization if needed - bool m_ShowTrajectory; ///< flag needed for trajectory visualization - - mitk::SplineVtkMapper3D::Pointer m_SplineMapper; ///< spline trajectory mapper - mitk::PointSetVtkMapper3D::Pointer m_PointSetMapper; ///< standard trajectroy mapper - private: - /** - \brief Returns color from colorcycle with given index - */ - mitk::Color GetColorCircleColor(int index); }; #endif // _QMITKNAVIGATIONDATAPLAYERVIEW_H_INCLUDED \ No newline at end of file