16#include "mitkIGTException.h"
21 this->SetName(
"Navigation Data Player Source");
31 Superclass::UpdateOutputInformation();
36 return m_NavigationDataSetIterator == m_NavigationDataSet->End();
41 m_NavigationDataSet = navigationDataSet;
42 m_NavigationDataSetIterator = navigationDataSet->Begin();
49 return m_NavigationDataSet.IsNull() ? 0 : m_NavigationDataSet->Size();
54 return m_NavigationDataSet.IsNull() ? 0 : m_NavigationDataSetIterator - m_NavigationDataSet->Begin();
59 if ( m_NavigationDataSet.IsNull() )
62 <<
"NavigationDataSet has to be set before initializing player.";
65 if (GetNumberOfOutputs() == 0)
67 unsigned int requiredOutputs = m_NavigationDataSet->GetNumberOfTools();
68 this->SetNumberOfRequiredOutputs(requiredOutputs);
70 for (
unsigned int n = this->GetNumberOfOutputs(); n < requiredOutputs; ++n)
72 DataObjectPointer newOutput = this->MakeOutput(n);
73 this->SetNthOutput(n, newOutput);
77 else if (GetNumberOfOutputs() != m_NavigationDataSet->GetNumberOfTools())
80 <<
"Number of tools cannot be changed in existing player. Please create "
81 <<
"a new player, if the NavigationDataSet has another number of tools now.";
90 for (
unsigned int index = 0; index < m_NavigationDataSet->GetNumberOfTools(); index++)
95 mitk::NavigationData::Pointer nd = mitk::NavigationData::New();
100 nd->SetPosition(position);
101 nd->SetOrientation(orientation);
102 nd->SetDataValid(
false);
An object of this class represents an exception of the MITK-IGT module.
~NavigationDataPlayerBase() override
unsigned int GetCurrentSnapshotNumber()
unsigned int GetNumberOfSnapshots()
Getter for the size of the mitk::NavigationDataSet used in this object.
bool IsAtEnd()
This method checks if player arrived at end of file.
void UpdateOutputInformation() override
Used for pipeline update just to tell the pipeline that we always have to update.
NavigationDataPlayerBase()
void SetNavigationDataSet(NavigationDataSet::Pointer navigationDataSet)
Set mitk::NavigationDataSet for playing. Player is initialized by call to mitk::NavigationDataPlayerB...
void GraftEmptyOutput()
Convenience method for subclasses. When there are no further mitk::NavigationData objects available,...
void InitPlayer()
Initializes the outputs of this NavigationDataSource. Aftwer calling this method, the first Navigatio...
void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
mitk::Point3D PositionType
Type that holds the position part of the tracking data.