21 #ifndef otbConcatenateVectorDataFilter_hxx
22 #define otbConcatenateVectorDataFilter_hxx
30 template <
class TVectorData>
33 this->SetNumberOfRequiredInputs(2);
34 this->SetNumberOfRequiredOutputs(1);
36 m_Folder = DataNodeType::New();
39 m_Document = DataNodeType::New();
43 template <
class TVectorData>
46 this->Superclass::PrintSelf(os, indent);
49 template <
class TVectorData>
52 for (
unsigned idx = 0; idx < this->GetNumberOfIndexedInputs(); ++idx)
54 if (!this->GetInput(idx))
56 this->Superclass::SetNthInput(idx,
const_cast<VectorDataType*
>(vectorData));
60 this->Superclass::SetNthInput(this->GetNumberOfIndexedInputs(),
const_cast<VectorDataType*
>(vectorData));
63 template <
class TVectorData>
66 if (this->GetNumberOfInputs() < idx)
70 return static_cast<const VectorDataType*
>(this->Superclass::GetInput(idx));
73 template <
class TVectorData>
88 typename DataTreeType::Pointer outputTree = this->GetOutput()->GetDataTree();
89 typename TreeNodeType::Pointer inputRoot =
const_cast<TreeNodeType*
>(this->GetInput(0)->GetDataTree()->GetRoot());
91 outputTree->SetRoot(inputRoot);
93 typename DataNodeType::Pointer outputDocument = this->GetOutput()->GetDataTree()->GetRoot()->GetChild(0)->Get();
100 for (
unsigned int idx = 1; idx < this->GetNumberOfInputs(); ++idx)
105 ProcessNode(currentInputRoot, outputDocument);
110 template <
class TVectorData>
113 if (source ==
nullptr)
121 typename ChildrenListType::iterator it;
122 for (it = children.begin(); it != children.end(); ++it)
127 switch (dataNode->GetNodeType())
131 ProcessNode((*it), outputDocument);
136 ProcessNode((*it), outputDocument);
141 ProcessNode((*it), outputDocument);
146 this->GetOutput()->GetDataTree()->Add(dataNode, outputDocument);
151 this->GetOutput()->GetDataTree()->Add(dataNode, outputDocument);
156 this->GetOutput()->GetDataTree()->Add(dataNode, outputDocument);
161 ProcessNode((*it), outputDocument);
166 ProcessNode((*it), outputDocument);
171 ProcessNode((*it), outputDocument);
176 ProcessNode((*it), outputDocument);