21 #ifndef otbVectorDataToVectorDataFilter_hxx
22 #define otbVectorDataToVectorDataFilter_hxx
25 #include "itkProgressReporter.h"
35 template <
class TInputVectorData,
class TOutputVectorData>
38 this->SetNumberOfRequiredInputs(1);
41 template <
class TInputVectorData,
class TOutputVectorData>
48 template <
class TInputVectorData,
class TOutputVectorData>
52 if (this->GetNumberOfInputs() < 1)
57 return static_cast<TInputVectorData*
>(this->itk::ProcessObject::GetInput(0));
60 template <
class TInputVectorData,
class TOutputVectorData>
63 Superclass::GenerateOutputInformation();
66 typename InputVectorDataType::ConstPointer input = this->GetInput();
67 output->SetMetaDataDictionary(input->GetMetaDataDictionary());
73 template <
class TInputVectorData,
class TOutputVectorData>
76 this->AllocateOutputs();
82 typename InputDataNodeType::Pointer inputRoot = inputPtr->GetRoot();
93 this->ProcessNode(inputPtr,inputRoot,outputPtr,outputPtr->GetRoot());
98 template <
class TInputVectorData,
class TOutputVectorData>
105 typedef typename InputVectorDataType::ChildrenListType InputChildrenListType;
106 InputChildrenListType children = inputVdata->GetChildrenList(source);
109 typename InputChildrenListType::const_iterator it = children.begin();
110 while (it != children.end())
114 newDataNode->SetNodeType((*it)->GetNodeType());
115 newDataNode->SetNodeId((*it)->GetNodeId());
116 newDataNode->SetMetaDataDictionary((*it)->GetMetaDataDictionary());
118 switch ((*it)->GetNodeType())
128 outputVdata->Add(newDataNode,destination);
129 ProcessNode(inputVdata,(*it),outputVdata,newDataNode);
134 outputVdata->Add(newDataNode,destination);
135 ProcessNode(inputVdata,(*it),outputVdata,newDataNode);
140 newDataNode->SetPoint(this->ProcessPoint((*it)->GetPoint()));
141 outputVdata->Add(newDataNode,destination);
146 newDataNode->SetLine(this->ProcessLine((*it)->GetLine()));
147 outputVdata->Add(newDataNode,destination);
152 newDataNode->SetPolygonExteriorRing(this->ProcessPolygon((*it)->GetPolygonExteriorRing()));
153 newDataNode->SetPolygonInteriorRings(this->ProcessPolygonList((*it)->GetPolygonInteriorRings()));
154 outputVdata->Add(newDataNode,destination);
159 outputVdata->Add(newDataNode,destination);
160 ProcessNode(inputVdata,(*it),outputVdata,newDataNode);
165 outputVdata->Add(newDataNode,destination);
166 ProcessNode(inputVdata,(*it),outputVdata,newDataNode);
171 outputVdata->Add(newDataNode,destination);
172 ProcessNode(inputVdata,(*it),outputVdata,newDataNode);
177 outputVdata->Add(newDataNode,destination);
178 ProcessNode(inputVdata,(*it),outputVdata,newDataNode);
189 template <
class TInputVectorData,
class TOutputVectorData>
192 Superclass::PrintSelf(os, indent);
static Stopwatch StartNew()
DurationType GetElapsedMilliseconds() const
TOutputVectorData::Pointer OutputVectorDataPointer
VectorDataToVectorDataFilter()
TInputVectorData::ConstPointer InputVectorDataPointer
void GenerateData(void) override
void GenerateOutputInformation(void) override
virtual void SetInput(const InputVectorDataType *input)
virtual void ProcessNode(InputVectorDataPointer inputVdata, InputDataNodePointerType source, OutputVectorDataPointer outputVdata, OutputDataNodePointerType destination) const
void PrintSelf(std::ostream &os, itk::Indent indent) const override
TInputVectorData InputVectorDataType
itk::SmartPointer< OutputDataNodeType > OutputDataNodePointerType
InputVectorDataType * GetInput(void)
itk::SmartPointer< InputDataNodeType > InputDataNodePointerType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
#define otbMsgDevMacro(x)