diff --git a/vcg/space/index/octree.h b/vcg/space/index/octree.h index 1e587dda..edbc3730 100644 --- a/vcg/space/index/octree.h +++ b/vcg/space/index/octree.h @@ -218,7 +218,7 @@ namespace vcg this->distance = distance; } - inline bool operator<(const Neighbour &n) + inline bool operator<(const Neighbour &n) const { return distance::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; for ( ; begin::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; for ( ; begin(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]); begin = voxel->begin; end = voxel->end; for ( ; begin::Voxel(leaves[i]); begin = voxel->begin; end = voxel->end; for ( ; beginP(), max_distance, nearest_vertices, distances, nearest_points); + VertPointDistanceFunctor vpdf; + DummyObjectMarker dom; + octree_for_planes.GetKClosest(vpdf, dom, k, iter->P(), max_distance, nearest_vertices, distances, nearest_points); // for each vertex *iter, compute the centroid as avarege of the k-nearest vertices of *iter Plane *plane = &tangent_planes[ std::distance(begin, iter) ]; @@ -216,8 +217,10 @@ namespace vcg if (callback!=NULL && (++progress%step)==0 && (percentage=int((progress*100)/vertex_count))<100) (callback)(percentage, message); unsigned int kk = k; + PlanePointDistanceFunctor ppdf; + DummyObjectMarker dom; octree_for_plane.GetKClosest - (PlanePointDistanceFunctor(), DummyObjectMarker(), kk, iPlane->center, max_distance, nearest_planes, distances, nearest_points, true, false); + (ppdf, dom, kk, iPlane->center, max_distance, nearest_planes, distances, nearest_points, true, false); for (int n=0; nindexindex) @@ -348,4 +351,4 @@ namespace vcg };//end of namespace vcg -#endif //end of VCG_SPACE_NORMAL_EXTRAPOLATION_H \ No newline at end of file +#endif //end of VCG_SPACE_NORMAL_EXTRAPOLATION_H