57 std::deque<KdNode> nodeQue;
59 std::size_t numberOfNodes;
65 static void queryNode(
KdNode* currentNode,
const geom::Envelope& queryEnv,
bool odd, KdNodeVisitor& visitor);
79 class BestMatchVisitor :
public KdNodeVisitor {
84 void visit(
KdNode* node)
override;
87 BestMatchVisitor(
const BestMatchVisitor& other) =
delete;
88 BestMatchVisitor& operator=(
const BestMatchVisitor& rhs) =
delete;
102 class AccumulatingVisitor :
public KdNodeVisitor {
104 explicit AccumulatingVisitor(std::vector<KdNode*>& p_nodeList) :
105 nodeList(p_nodeList) {};
106 void visit(
KdNode* node)
override { nodeList.push_back(node); }
109 AccumulatingVisitor(
const AccumulatingVisitor& other) =
delete;
110 AccumulatingVisitor& operator=(
const AccumulatingVisitor& rhs) =
delete;
114 std::vector<KdNode*>& nodeList;
127 static std::vector<geom::Coordinate>
toCoordinates(
const std::vector<KdNode*>& kdNodes);
140 static std::vector<geom::Coordinate>
toCoordinates(
const std::vector<KdNode*>& kdNodes,
bool includeRepeated);
148 explicit KdTree(
double p_tolerance) :
151 tolerance(p_tolerance)
154 bool isEmpty() {
return root ==
nullptr; }