21 #ifndef otbVectorDataAdapterFilter_hxx
22 #define otbVectorDataAdapterFilter_hxx
32 template <
class TInputVectorData,
class TOutputVectorData>
38 point[0] = pointCoord[0];
39 point[1] = pointCoord[1];
40 if (OutputPointType::PointDimension == 3)
42 point[2] = pointCoord[2];
50 template <
class TInputVectorData,
class TOutputVectorData>
54 typedef typename InputLineType::VertexListType::ConstPointer VertexListConstPointerType;
55 typedef typename InputLineType::VertexListConstIteratorType VertexListConstIteratorType;
56 VertexListConstPointerType vertexList = line->GetVertexList();
57 VertexListConstIteratorType it = vertexList->Begin();
58 typename OutputLineType::Pointer newLine = OutputLineType::New();
59 while (it != vertexList->End())
61 typename OutputLineType::VertexType index;
62 typename InputLineType::VertexType pointCoord = it.Value();
63 index[0] = pointCoord[0];
64 index[1] = pointCoord[1];
69 newLine->AddVertex(index);
79 template <
class TInputVectorData,
class TOutputVectorData>
83 typedef typename InputPolygonType::VertexListType::ConstPointer VertexListConstPointerType;
84 typedef typename InputPolygonType::VertexListConstIteratorType VertexListConstIteratorType;
85 VertexListConstPointerType vertexList = polygon->GetVertexList();
86 VertexListConstIteratorType it = vertexList->Begin();
87 typename OutputPolygonType::Pointer newPolygon = OutputPolygonType::New();
88 while (it != vertexList->End())
90 typename OutputPolygonType::VertexType index;
91 typename InputPolygonType::VertexType pointCoord = it.Value();
92 index[0] = pointCoord[0];
93 index[1] = pointCoord[1];
98 newPolygon->AddVertex(index);
107 template <
class TInputVectorData,
class TOutputVectorData>
113 for (
typename InputPolygonListType::ConstIterator it = polygonList->Begin(); it != polygonList->End(); ++it)
115 newPolygonList->PushBack(this->ProcessPolygon(it.Get()));
117 return newPolygonList;
InputPolygonListType::Pointer InputPolygonListPointerType
OutputLinePointerType ProcessLine(InputLinePointerType line) const override
InputLineType::Pointer InputLinePointerType
OutputPolygonPointerType ProcessPolygon(InputPolygonPointerType polygon) const override
InputDataNodeType::PointType InputPointType
OutputLineType::Pointer OutputLinePointerType
OutputPointType ProcessPoint(InputPointType point) const override
OutputPolygonListType::Pointer OutputPolygonListPointerType
InputPolygonType::Pointer InputPolygonPointerType
OutputDataNodeType::PointType OutputPointType
OutputPolygonListPointerType ProcessPolygonList(InputPolygonListPointerType polygonList) const override
OutputPolygonType::Pointer OutputPolygonPointerType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.