Working on mingw now.
This commit is contained in:
parent
804c4aaf1c
commit
6eb4a5b293
|
|
@ -218,7 +218,7 @@ namespace vcg
|
||||||
this->distance = distance;
|
this->distance = distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator<(const Neighbour &n)
|
inline bool operator<(const Neighbour &n) const
|
||||||
{
|
{
|
||||||
return distance<n.distance;
|
return distance<n.distance;
|
||||||
}
|
}
|
||||||
|
|
@ -426,7 +426,7 @@ public:
|
||||||
object_count = 0;
|
object_count = 0;
|
||||||
for (int i=0; i<leaves_count; i++)
|
for (int i=0; i<leaves_count; i++)
|
||||||
{
|
{
|
||||||
voxel = Voxel(leaves[i]);
|
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
|
||||||
begin = voxel->begin;
|
begin = voxel->begin;
|
||||||
end = voxel->end;
|
end = voxel->end;
|
||||||
for ( ; begin<end; begin++)
|
for ( ; begin<end; begin++)
|
||||||
|
|
@ -517,7 +517,7 @@ public:
|
||||||
object_count = 0;
|
object_count = 0;
|
||||||
for (int i=0; i<leaves_count; i++)
|
for (int i=0; i<leaves_count; i++)
|
||||||
{
|
{
|
||||||
voxel = Voxel(leaves[i]);
|
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
|
||||||
begin = voxel->begin;
|
begin = voxel->begin;
|
||||||
end = voxel->end;
|
end = voxel->end;
|
||||||
for ( ; begin<end; begin++)
|
for ( ; begin<end; begin++)
|
||||||
|
|
@ -554,7 +554,7 @@ public:
|
||||||
NeighbourIterator last = neighbors.end();
|
NeighbourIterator last = neighbors.end();
|
||||||
|
|
||||||
if (sort_per_distance) std::partial_sort< NeighbourIterator >(first, first+object_count, last /*, DistanceCompare()*/ );
|
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;
|
k_distance = neighbors[object_count-1].distance;
|
||||||
}
|
}
|
||||||
while (k_distance>sphere_radius && sphere_radius<max_distance);
|
while (k_distance>sphere_radius && sphere_radius<max_distance);
|
||||||
|
|
@ -608,7 +608,7 @@ public:
|
||||||
float distance;
|
float distance;
|
||||||
for (int i=0; i<leaves_count; i++)
|
for (int i=0; i<leaves_count; i++)
|
||||||
{
|
{
|
||||||
voxel = Voxel(leaves[i]);
|
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
|
||||||
begin = voxel->begin;
|
begin = voxel->begin;
|
||||||
end = voxel->end;
|
end = voxel->end;
|
||||||
for ( ; begin<end; begin++)
|
for ( ; begin<end; begin++)
|
||||||
|
|
@ -676,7 +676,7 @@ public:
|
||||||
object_count = 0;
|
object_count = 0;
|
||||||
for (int i=0; i<leaves_count; i++)
|
for (int i=0; i<leaves_count; i++)
|
||||||
{
|
{
|
||||||
voxel = Voxel(leaves[i]);
|
voxel = OctreeTemplate< Voxel, SCALAR_TYPE >::Voxel(leaves[i]);
|
||||||
begin = voxel->begin;
|
begin = voxel->begin;
|
||||||
end = voxel->end;
|
end = voxel->end;
|
||||||
for ( ; begin<end; begin++)
|
for ( ; begin<end; begin++)
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ protected:
|
||||||
InnerNode() : Node() {};
|
InnerNode() : Node() {};
|
||||||
InnerNode(NodePointer parent, int level) : Node(parent, level)
|
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)
|
inline NodePointer &Son(int sonIndex)
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,9 @@ namespace vcg
|
||||||
for (VertexIterator iter=begin; iter!=end; iter++)
|
for (VertexIterator iter=begin; iter!=end; iter++)
|
||||||
{
|
{
|
||||||
if (callback!=NULL && (++progress%step)==0 && (percentage=int((progress*100)/vertex_count))<100) (callback)(percentage, message);
|
if (callback!=NULL && (++progress%step)==0 && (percentage=int((progress*100)/vertex_count))<100) (callback)(percentage, message);
|
||||||
|
VertPointDistanceFunctor vpdf;
|
||||||
octree_for_planes.GetKClosest(VertPointDistanceFunctor(), DummyObjectMarker(), k, iter->P(), max_distance, nearest_vertices, distances, nearest_points);
|
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
|
// for each vertex *iter, compute the centroid as avarege of the k-nearest vertices of *iter
|
||||||
Plane *plane = &tangent_planes[ std::distance(begin, 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);
|
if (callback!=NULL && (++progress%step)==0 && (percentage=int((progress*100)/vertex_count))<100) (callback)(percentage, message);
|
||||||
|
|
||||||
unsigned int kk = k;
|
unsigned int kk = k;
|
||||||
|
PlanePointDistanceFunctor ppdf;
|
||||||
|
DummyObjectMarker dom;
|
||||||
octree_for_plane.GetKClosest
|
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++)
|
for (int n=0; n<k; n++)
|
||||||
if (iPlane->index<nearest_planes[n]->index)
|
if (iPlane->index<nearest_planes[n]->index)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue