| 87 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 88 | |
| 89 | TEST (ORROctreeTest, OctreeSphereIntersection) |
| 90 | { |
| 91 | float voxel_size = 0.02f; |
| 92 | float pair_width = 0.05f; |
| 93 | float frac_of_points_for_registration = 0.3f; |
| 94 | std::string object_name = "test_object"; |
| 95 | |
| 96 | ModelLibrary::Model new_model (*model_cloud, *model_cloud_normals, voxel_size, object_name, frac_of_points_for_registration); |
| 97 | |
| 98 | const ORROctree& octree = new_model.getOctree (); |
| 99 | const std::vector<ORROctree::Node*> &full_leaves = octree.getFullLeaves (); |
| 100 | list<ORROctree::Node*> inter_leaves; |
| 101 | |
| 102 | // Run through all full leaves |
| 103 | for ( const auto& leaf1 : full_leaves ) |
| 104 | { |
| 105 | const ORROctree::Node::Data* node_data1 = leaf1->getData (); |
| 106 | // Get all full leaves at the right distance to the current leaf |
| 107 | inter_leaves.clear (); |
| 108 | octree.getFullLeavesIntersectedBySphere (node_data1->getPoint (), pair_width, inter_leaves); |
| 109 | // Ensure that inter_leaves does not contain leaf1 |
| 110 | for ( const auto& leaf2 : inter_leaves ) |
| 111 | { |
| 112 | EXPECT_NE(leaf1, leaf2); |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 118 |
nothing calls this directly
no test coverage detected