| 69 | } |
| 70 | |
| 71 | PointViewSet FarthestPointSamplingFilter::run(PointViewPtr inView) |
| 72 | { |
| 73 | // Return empty PointViewSet if the input PointView has no points. |
| 74 | PointViewSet viewSet; |
| 75 | if (!inView->size()) |
| 76 | return viewSet; |
| 77 | |
| 78 | // Return inView if input PointView has fewer than count points. |
| 79 | if (inView->size() < m_count) |
| 80 | { |
| 81 | viewSet.insert(inView); |
| 82 | return viewSet; |
| 83 | } |
| 84 | |
| 85 | PointIdList ids = Segmentation::farthestPointSampling(*inView, m_count); |
| 86 | |
| 87 | PointViewPtr outView = inView->makeNew(); |
| 88 | for (auto const& id : ids) |
| 89 | outView->appendPoint(*inView, id); |
| 90 | viewSet.insert(outView); |
| 91 | return viewSet; |
| 92 | } |
| 93 | |
| 94 | } // namespace pdal |
nothing calls this directly
no test coverage detected