19mitk::NavigationData::Pointer output = mitk::NavigationData::New();
20this->SetNumberOfRequiredOutputs(1);
21this->SetNthOutput(0, output.GetPointer());
32 this->SetInput(0, nd);
39 this->RemoveInput(idx);
41 this->ProcessObject::SetNthInput(idx,
const_cast<NavigationData*
>(nd));
42 this->CreateOutputsForAllInputs();
48 if (this->GetNumberOfInputs() < 1)
51 return static_cast<const NavigationData*
>(this->ProcessObject::GetInput(0));
57 if (this->GetNumberOfInputs() < 1)
60 return static_cast<const NavigationData*
>(this->ProcessObject::GetInput(idx));
66 const DataObjectPointerArray& inputs =
const_cast<Self*
>(
this)->GetInputs();
67 for (DataObjectPointerArray::const_iterator it = inputs.begin(); it != inputs.end(); ++it)
68 if (std::string(navDataName) == (
static_cast<NavigationData*
>(it->GetPointer()))->GetName())
76 DataObjectPointerArray outputs = this->GetInputs();
77 for (DataObjectPointerArray::size_type i = 0; i < outputs.size(); ++i)
78 if (navDataName == (
static_cast<NavigationData*
>(outputs.at(i).GetPointer()))->GetName())
80 throw std::invalid_argument(
"output name does not exist");
85 for (DataObjectPointerArraySizeType i = 0; i < UpstreamFilter->GetNumberOfOutputs(); i++)
87 this->SetInput(i, UpstreamFilter->
GetOutput(i));
94 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
95 bool isModified =
false;
96 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedOutputs(); ++idx){
97 if (this->GetOutput(idx) ==
nullptr)
99 mitk::NavigationData::Pointer newOutput = mitk::NavigationData::New();
100 this->SetNthOutput(idx, newOutput);
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
DataObjectPointerArraySizeType GetInputIndex(std::string navDataName)
return the index of the input with name navDataName, throw std::invalid_argument exception if that na...
virtual void ConnectTo(mitk::NavigationDataSource *UpstreamFilter)
Connects the input of this filter to the outputs of the given NavigationDataSource.
void CreateOutputsForAllInputs()
Create an output for each input.
virtual void SetInput(const NavigationData *nd)
Set the input of this filter.
const NavigationData * GetInput(void) const
Get the input of this filter.
NavigationDataToNavigationDataFilter()
~NavigationDataToNavigationDataFilter() override