20 #include "mitkIGTException.h"
25 this->
SetName(
"Navigation Data Player Source");
35 Superclass::UpdateOutputInformation();
40 return m_NavigationDataSetIterator == m_NavigationDataSet->End();
45 m_NavigationDataSet = navigationDataSet;
46 m_NavigationDataSetIterator = navigationDataSet->Begin();
53 return m_NavigationDataSet.IsNull() ? 0 : m_NavigationDataSet->Size();
58 return m_NavigationDataSet.IsNull() ? 0 : m_NavigationDataSetIterator - m_NavigationDataSet->Begin();
63 if ( m_NavigationDataSet.IsNull() )
66 <<
"NavigationDataSet has to be set before initializing player.";
69 if (GetNumberOfOutputs() == 0)
71 int requiredOutputs = m_NavigationDataSet->GetNumberOfTools();
72 this->SetNumberOfRequiredOutputs(requiredOutputs);
74 for (
unsigned int n = this->GetNumberOfOutputs(); n < requiredOutputs; ++n)
76 DataObjectPointer newOutput = this->MakeOutput(n);
77 this->SetNthOutput(n, newOutput);
81 else if (GetNumberOfOutputs() != m_NavigationDataSet->GetNumberOfTools())
84 <<
"Number of tools cannot be changed in existing player. Please create "
85 <<
"a new player, if the NavigationDataSet has another number of tools now.";
94 for (
unsigned int index = 0; index < m_NavigationDataSet->GetNumberOfTools(); index++)
104 nd->SetPosition(position);
105 nd->SetOrientation(orientation);
106 nd->SetDataValid(
false);
itk::SmartPointer< Self > Pointer
virtual void UpdateOutputInformation() override
Used for pipeline update just to tell the pipeline that we always have to update. ...
virtual ~NavigationDataPlayerBase()
An object of this class represents an exception of the MITK-IGT module.
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
void GraftEmptyOutput()
Convenience method for subclasses. When there are no further mitk::NavigationData objects available...
void SetNavigationDataSet(NavigationDataSet::Pointer navigationDataSet)
Set mitk::NavigationDataSet for playing. Player is initialized by call to mitk::NavigationDataPlayerB...
unsigned int GetCurrentSnapshotNumber()
NavigationDataPlayerBase()
#define mitkThrowException(classname)
virtual void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
bool IsAtEnd()
This method checks if player arrived at end of file.
void InitPlayer()
Initializes the outputs of this NavigationDataSource. Aftwer calling this method, the first Navigatio...
unsigned int GetNumberOfSnapshots()
Getter for the size of the mitk::NavigationDataSet used in this object.
virtual void SetName(std::string _arg)
Sets the human readable name of this source. There is also a default name, but you can use this metho...