本文整理汇总了C++中KDTree::deletePoint方法的典型用法代码示例。如果您正苦于以下问题:C++ KDTree::deletePoint方法的具体用法?C++ KDTree::deletePoint怎么用?C++ KDTree::deletePoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDTree
的用法示例。
在下文中一共展示了KDTree::deletePoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv){
KDTree<simplePoint3> tree;
std::vector<simplePoint3> pts{ {0,0,0},{1,1,1}, {-1, 3, 4}, {5, 6, 7}, {2, -6, 8}, {4, 5, -4},
{2, 3, 4},
{2, 5, 6}};
tree.buildTree(pts);
tree.dumpTreeInorder();
std::cout << "searching near 0,0,0.1" << std::endl;
auto closeNodes = tree.getPointsWithinCube({0, 0, 0.1}, 0.2);
std::cout << "found" << std::endl;
for(auto n : closeNodes){
tree.dumpNode(n);
}
std::cout << "searching near 0.5,0.5,0.5" << std::endl;
closeNodes = tree.getPointsWithinCube({0.5, 0.5, 0.5}, 0.7);
std::cout << "found" << std::endl;
for(auto n : closeNodes){
tree.dumpNode(n);
}
std::cout << "min, x: " << std::endl;
tree.dumpNode(tree.findMin(0));
std::cout << "min, y: " << std::endl;
tree.dumpNode(tree.findMin(1));
std::cout << "min, z: " << std::endl;
tree.dumpNode(tree.findMin(2));
for(auto i = 0; i < pts.size() -1; ++i){
std::cout << "deleting node " << i << std::endl;
tree.deletePoint(i);
tree.dumpTreeInorder();
}
std::cout << "inserting 2 points" << std::endl;
tree.insertPoint({1, 4, 5});
tree.dumpTreeInorder();
tree.insertPoint({3, 8, 6});
tree.dumpTreeInorder();
}