21 #ifndef otbVectorDataTransformFilter_hxx
22 #define otbVectorDataTransformFilter_hxx
25 #include "itkProgressReporter.h"
26 #include <itkContinuousIndex.h>
28 #include "vcl_legacy_aliases.h"
36 template <
class TInputVectorData,
class TOutputVectorData>
44 m_Transform =
nullptr;
51 template <
class TInputVectorData,
class TOutputVectorData>
55 itk::Point<double, 2> point;
56 point = m_Transform->TransformPoint(pointCoord);
65 template <
class TInputVectorData,
class TOutputVectorData>
69 typedef typename LineType::VertexListType::ConstPointer VertexListConstPointerType;
70 typedef typename LineType::VertexListConstIteratorType VertexListConstIteratorType;
71 VertexListConstPointerType vertexList = line->GetVertexList();
72 VertexListConstIteratorType it = vertexList->Begin();
73 typename LineType::Pointer newLine = LineType::New();
74 while (it != vertexList->End())
76 itk::Point<double, 2> point;
77 itk::ContinuousIndex<double, 2> index;
78 typename LineType::VertexType pointCoord = it.Value();
79 point = m_Transform->TransformPoint(pointCoord);
82 if (!vnl_math_isnan(index[0]) && !vnl_math_isnan(index[1]))
83 newLine->AddVertex(index);
94 template <
class TInputVectorData,
class TOutputVectorData>
98 typedef typename PolygonType::VertexListType::ConstPointer VertexListConstPointerType;
99 typedef typename PolygonType::VertexListConstIteratorType VertexListConstIteratorType;
100 VertexListConstPointerType vertexList = polygon->GetVertexList();
101 VertexListConstIteratorType it = vertexList->Begin();
102 typename PolygonType::Pointer newPolygon = PolygonType::New();
103 while (it != vertexList->End())
105 itk::Point<double, 2> point;
106 itk::ContinuousIndex<double, 2> index;
107 typename PolygonType::VertexType pointCoord = it.Value();
108 point = m_Transform->TransformPoint(pointCoord);
111 if (!vnl_math_isnan(index[0]) && !vnl_math_isnan(index[1]))
112 newPolygon->AddVertex(index);
122 template <
class TInputVectorData,
class TOutputVectorData>
128 for (
typename PolygonListType::ConstIterator it = polygonList->Begin(); it != polygonList->End(); ++it)
130 newPolygonList->PushBack(this->ProcessPolygon(it.Get()));
132 return newPolygonList;
139 template <
class TInputVectorData,
class TOutputVectorData>
142 Superclass::GenerateOutputInformation();
143 this->AllocateOutputs();
149 outputPtr->SetProjectionRef(inputPtr->GetProjectionRef());
159 this->ProcessNode(inputPtr,inputPtr->GetRoot(),outputPtr,outputPtr->GetRoot());
static Stopwatch StartNew()
DurationType GetElapsedMilliseconds() const
TOutputVectorData::Pointer OutputVectorDataPointer
TInputVectorData::ConstPointer InputVectorDataPointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
#define otbMsgDevMacro(x)