MCPcopy Create free account
hub / github.com/PDAL/PDAL / run

Method run

filters/FarthestPointSamplingFilter.cpp:71–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71PointViewSet 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

Callers

nothing calls this directly

Calls 4

farthestPointSamplingFunction · 0.85
appendPointMethod · 0.80
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected