Working on mingw now.

This commit is contained in:
Federico Ponchio 2006-10-18 08:32:03 +00:00
parent 804c4aaf1c
commit 6eb4a5b293
3 changed files with 14 additions and 11 deletions

View File

@ -218,7 +218,7 @@ namespace vcg
this->distance = distance;
}
inline bool operator<(const Neighbour &n)
inline bool operator<(const Neighbour &n) const
{
return distance<n.distance;
}
@ -426,7 +426,7 @@ public:
object_count = 0;
for (int i=0; i<leaves_count; i++)
{
voxel = Voxel(leaves[i]);
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
begin = voxel->begin;
end = voxel->end;
for ( ; begin<end; begin++)
@ -517,7 +517,7 @@ public:
object_count = 0;
for (int i=0; i<leaves_count; i++)
{
voxel = Voxel(leaves[i]);
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
begin = voxel->begin;
end = voxel->end;
for ( ; begin<end; begin++)
@ -554,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<max_distance);
@ -608,7 +608,7 @@ public:
float distance;
for (int i=0; i<leaves_count; i++)
{
voxel = Voxel(leaves[i]);
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
begin = voxel->begin;
end = voxel->end;
for ( ; begin<end; begin++)
@ -676,7 +676,7 @@ public:
object_count = 0;
for (int i=0; i<leaves_count; i++)
{
voxel = Voxel(leaves[i]);
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
begin = voxel->begin;
end = voxel->end;
for ( ; begin<end; begin++)

View File

@ -109,7 +109,7 @@ protected:
InnerNode() : Node() {};
InnerNode(NodePointer parent, int level) : Node(parent, level)
{
memset(&sons[0], NULL, 8*sizeof(Node*));
memset(&sons[0], 0, 8*sizeof(Node*));
}
inline NodePointer &Son(int sonIndex)

View File

@ -165,8 +165,9 @@ namespace vcg
for (VertexIterator iter=begin; iter!=end; iter++)
{
if (callback!=NULL && (++progress%step)==0 && (percentage=int((progress*100)/vertex_count))<100) (callback)(percentage, message);
octree_for_planes.GetKClosest(VertPointDistanceFunctor(), DummyObjectMarker(), k, iter->P(), 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; n<k; n++)
if (iPlane->index<nearest_planes[n]->index)
@ -348,4 +351,4 @@ namespace vcg
};//end of namespace vcg
#endif //end of VCG_SPACE_NORMAL_EXTRAPOLATION_H
#endif //end of VCG_SPACE_NORMAL_EXTRAPOLATION_H