33 :
itk::ProcessObject(), m_Name(
"NavigationDataSource (no defined type)"), m_IsFrozen(false)
43 if (this->GetNumberOfIndexedOutputs() < 1)
46 return static_cast<NavigationData*
>(this->ProcessObject::GetPrimaryOutput());
52 if ( out == NULL && this->ProcessObject::GetOutput(idx) != NULL )
54 itkWarningMacro (<<
"Unable to convert output number " << idx <<
" to type " <<
typeid(
NavigationData ).name () );
61 DataObjectPointerArray outputs = this->GetOutputs();
62 for (DataObjectPointerArray::iterator it = outputs.begin(); it != outputs.end(); ++it)
63 if (navDataName == (static_cast<NavigationData*>(it->GetPointer()))->GetName())
64 return static_cast<NavigationData*>(it->GetPointer());
70 DataObjectPointerArray outputs = this->GetOutputs();
71 for (DataObjectPointerArray::size_type i = 0; i < outputs.size(); ++i)
72 if (navDataName == (static_cast<NavigationData*>(outputs.at(i).GetPointer()))->GetName())
74 throw std::invalid_argument(
"output name does not exist");
84 props[ US_PROPKEY_ID ] = uidGen.
GetUID();
85 props[ US_PROPKEY_DEVICENAME ] = m_Name;
86 m_ServiceRegistration = context->RegisterService(
this, props);
90 if (m_ServiceRegistration != NULL) m_ServiceRegistration.Unregister();
91 m_ServiceRegistration = 0;
95 return this->m_ServiceRegistration.GetReference().GetProperty(US_PROPKEY_ID).ToString();
100 this->GraftNthOutput(0, graft);
105 if ( idx >= this->GetNumberOfIndexedOutputs() )
107 itkExceptionMacro(<<
"Requested to graft output " << idx <<
108 " but this filter only has " << this->GetNumberOfIndexedOutputs() <<
" Outputs.");
113 itkExceptionMacro(<<
"Requested to graft output with a NULL pointer object" );
116 itk::DataObject* output = this->GetOutput(idx);
119 itkExceptionMacro(<<
"Requested to graft output that is a NULL pointer" );
122 output->Graft( graft );
132 itkDebugMacro(
"MakeOutput(" << name <<
")");
133 if( this->IsIndexedOutputName(name) )
135 return this->MakeOutput( this->MakeIndexFromOutputName(name) );
itk::SmartPointer< Self > Pointer
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
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
virtual itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
virtual mitk::PropertyList::ConstPointer GetParameters() const
Get all filter parameters as a PropertyList.
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
virtual ~NavigationDataSource()
itk::SmartPointer< const Self > ConstPointer
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 ...
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...
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.