21 #ifndef otbSimplifyPathFunctor_h
22 #define otbSimplifyPathFunctor_h
53 template <
class TInput,
class TOutput>
83 newPath->Initialize();
86 if (vertexList->Size() > 0)
92 newPath->AddVertex(beginIt.Value());
94 while (beginIt != beforeTheEndIt)
103 newPath->AddVertex(endIt.Value());
108 newPath->SetMetaDataDictionary(input->GetMetaDataDictionary());
120 while (segmentIt != end)
122 double crossProduct = (end.Value()[0] - begin.Value()[0]) * (segmentIt.Value()[1] - begin.Value()[1]) -
123 (end.Value()[1] - begin.Value()[1]) * (segmentIt.Value()[0] - begin.Value()[0]);
125 (end.Value()[0] - begin.Value()[0]) * (end.Value()[0] - begin.Value()[0]) + (end.Value()[1] - begin.Value()[1]) * (end.Value()[1] - begin.Value()[1]);
128 double distsq = crossProduct * crossProduct / lengthSeg;