insane
This commit is contained in:
parent
2425729a72
commit
b4927aba4c
@ -25,15 +25,14 @@ ostream& operator<<(ostream &os, KdTree::Point const &point) {
|
||||
return os;
|
||||
}
|
||||
|
||||
KdTree::Node::Node(Point const &position, vtkIdType id): position{position}, id{id} {}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
void KdTree::fill(std::vector<Tuple> &points) {
|
||||
nodes.resize(points.size());
|
||||
|
||||
for(std::size_t i = 0; i < points.size(); ++i) {
|
||||
nodes[i].position = points[i].first;
|
||||
nodes[i].index = points[i].second;
|
||||
}
|
||||
nodes.reserve(points.size());
|
||||
for(std::size_t i = 0; i < points.size(); ++i)
|
||||
nodes.push_back({points[i].first, points[i].second});
|
||||
|
||||
root = fillRec(0, points.size(), 0);
|
||||
}
|
||||
|
@ -30,8 +30,10 @@ public:
|
||||
|
||||
private:
|
||||
struct Node {
|
||||
Node(Point const &position, vtkIdType id);
|
||||
|
||||
Point position;
|
||||
vtkIdType index;
|
||||
vtkIdType id;
|
||||
|
||||
Node *leftChild;
|
||||
Node *rightChild;
|
||||
|
Loading…
Reference in New Issue
Block a user