29 :
itk::ProcessObject(), m_Name(
"NavigationDataSource (no defined type)"), m_IsFrozen(false), m_ToolMetaDataCollection(
mitk::
NavigationToolStorage::New())
39 if (this->GetNumberOfIndexedOutputs() < 1)
42 return static_cast<NavigationData*
>(this->ProcessObject::GetPrimaryOutput());
48 if ( out ==
nullptr && this->ProcessObject::GetOutput(idx) != nullptr )
50 itkWarningMacro (<<
"Unable to convert output number " << idx <<
" to type " <<
typeid(
NavigationData ).name () );
57 DataObjectPointerArray outputs = this->GetOutputs();
58 for (DataObjectPointerArray::iterator it = outputs.begin(); it != outputs.end(); ++it)
59 if (navDataName == (static_cast<NavigationData*>(it->GetPointer()))->GetName())
60 return static_cast<NavigationData*>(it->GetPointer());
66 DataObjectPointerArray outputs = this->GetOutputs();
67 for (DataObjectPointerArray::size_type i = 0; i < outputs.size(); ++i)
68 if (navDataName == (static_cast<NavigationData*>(outputs.at(i).GetPointer()))->GetName())
70 throw std::invalid_argument(
"output name does not exist");
82 m_ServiceRegistration = context->RegisterService(
this, props);
86 if (m_ServiceRegistration !=
nullptr) m_ServiceRegistration.
Unregister();
87 m_ServiceRegistration = 0;
101 if ( idx >= this->GetNumberOfIndexedOutputs() )
103 itkExceptionMacro(<<
"Requested to graft output " << idx <<
104 " but this filter only has " << this->GetNumberOfIndexedOutputs() <<
" Outputs.");
109 itkExceptionMacro(<<
"Requested to graft output with a nullptr pointer object" );
112 itk::DataObject* output = this->
GetOutput(idx);
115 itkExceptionMacro(<<
"Requested to graft output that is a nullptr pointer" );
118 output->Graft( graft );
128 itkDebugMacro(
"MakeOutput(" << name <<
")");
129 if( this->IsIndexedOutputName(name) )
131 return this->
MakeOutput( this->MakeIndexFromOutputName(name) );
ServiceReference< I1 > GetReference(InterfaceType< I1 >) const
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
DataCollection - Class to facilitate loading/accessing structured data.
NavigationTool::Pointer GetToolMetaData(DataObjectPointerArraySizeType idx)
NavigationToolStorage::Pointer m_ToolMetaDataCollection
virtual void RegisterAsMicroservice()
Registers this object as a Microservice, making it available to every module and/or plugin...
static const std::string US_PROPKEY_ID
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
static const std::string US_INTERFACE_NAME
These Constants are used in conjunction with Microservices.
virtual void GraftNthOutput(unsigned int idx, itk::DataObject *graft)
Graft the specified DataObject onto this ProcessObject's output.
virtual void GraftOutput(itk::DataObject *graft)
Graft the specified DataObject onto this ProcessObject's output.
virtual void UnRegisterMicroservice()
Registers this object as a Microservice, making it available to every module and/or plugin...
static const std::string US_PROPKEY_ISACTIVE
itk::SmartPointer< const Self > ConstPointer
virtual std::string GetName()
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
DataObjectPointerArraySizeType GetOutputIndex(std::string navDataName)
return the index of the output with name navDataName, -1 if no output with that name was found ...
~NavigationDataSource() override
static const std::string US_PROPKEY_DEVICENAME
std::string GetMicroserviceID()
Returns the id that this device is registered with. The id will only be valid, if the NavigationDataS...
virtual mitk::PropertyList::ConstPointer GetParameters() const
Get all filter parameters as a PropertyList.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.