diff --git a/vcg/space/index/octree.h b/vcg/space/index/octree.h index 534a49e8..4076f312 100644 --- a/vcg/space/index/octree.h +++ b/vcg/space/index/octree.h @@ -426,7 +426,7 @@ public: object_count = 0; for (int i=0; i::Voxel(leaves[i]); + voxel = TemplatedOctree::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; for ( ; begin::Voxel(leaves[i]); voxel = TemplatedOctree::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; @@ -555,7 +554,7 @@ public: NeighbourIterator last = neighbors.end(); if (sort_per_distance) std::partial_sort< NeighbourIterator >(first, first+object_count, last /*, DistanceCompare()*/ ); - else std::nth_element < NeighbourIterator >(first, first+object_count, last /*, DistanceCompare()*/ ); + else std::nth_element < NeighbourIterator >(first, first+object_count, last /*, DistanceCompare()*/ ); k_distance = neighbors[object_count-1].distance; } while (k_distance>sphere_radius && sphere_radius::Voxel(leaves[i]); + voxel = TemplatedOctree::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; for ( ; beginpObject, sphere_center, distance, closest_point)) continue; - object_count++; Mark(ref); if ((distance!=0.0f || allow_zero_distance) && distancepObject, closest_point, distance) ); + } } //end of for ( ; begin(first, first+object_count, last /*, DistanceCompare()*/ ); - else std::nth_element < NeighbourIterator >(first, first+object_count, last /*, DistanceCompare()*/ ); + if (sort_per_distance) std::partial_sort< NeighbourIterator >(first, last, last /*, DistanceCompare()*/ ); + else std::nth_element < NeighbourIterator >(first, last, last /*, DistanceCompare()*/ ); return CopyQueryResults(neighbors, object_count, objects, distances, points); };//end of GetInSphere @@ -677,7 +678,7 @@ public: object_count = 0; for (int i=0; i::Voxel(leaves[i]); + voxel = TemplatedOctree::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; for ( ; begin_level) + if (rendering_settings.minVisibleDepth>level) { for (int s=0; s<8; s++) if ((son=Son(n, s))!=0) @@ -712,7 +712,7 @@ public: else { vcg::glBoxWire(boundingBox); - if (_level