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

Method addPoint

filters/private/hexer/BaseGrid.cpp:16–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14{}
15
16void BaseGrid::addPoint(Point& p)
17{
18 if (sampling())
19 {
20 handleSamplePoint(p);
21 return;
22 }
23 // find the hexagon that the point is contained within
24 HexId h = findHexagon(p);
25
26 // add the hexagon to the grid, and increment its count if it exists.
27 int count = increment(h);
28
29 // if the hexagon of interest has reached the density threshold, we see if it
30 // has neighbors at edge 0. If not, it's added to our list of possible starting points
31 // for path finding (m_possibleRoots). If the hexagon at edge 3 was in m_possibleRoots we
32 // remove it since it no longer has a non-dense neighbor at edge 0.
33 if (count == m_denseLimit)
34 {
35 HexId above = edgeHex(h, 0);
36 HexId below = edgeHex(h, 3);
37 if (!isDense(above))
38 addRoot(h);
39 removeRoot(below);
40 }
41}
42
43void BaseGrid::setHexes(const std::vector<HexId>& ids)
44{

Callers 1

findShapeMethod · 0.45

Calls 1

samplingFunction · 0.70

Tested by

no test coverage detected