MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / queryNode

Function queryNode

openpgl/directional/dqt/Traversal.h:49–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47// returns node and rectangle which a given point falls into
48template <typename TNode>
49size_t queryNode(const TNode *nodes, Vector2 point, Rect<float> &rect)
50{
51 rect = {{0, 0}, {1, 1}};
52 size_t nodeIdx = 0;
53 const TNode *node = &nodes[nodeIdx];
54 while (node->offsetChildren > 0)
55 {
56 uint32_t c = rescaleChild(point);
57 rect = rect.child(c);
58 nodeIdx = node->offsetChildren + c;
59 node = &nodes[nodeIdx];
60 }
61 return nodeIdx;
62}
63
64// Generic traversal routine for quadtrees
65template <typename TNode, typename F1, typename F2>

Callers 2

pdfQuadtreeMethod · 0.85
splatFunction · 0.85

Calls 2

rescaleChildFunction · 0.85
childMethod · 0.80

Tested by

no test coverage detected