From 5349e55fed18f348a3436de0f968a77b787a6b04 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 19 Jun 2014 15:01:54 +0000 Subject: [PATCH] Improved float/double consistency removing some wrong Point3f and substitued with MeshType::CoordType --- vcg/complex/algorithms/pointcloud_normal.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vcg/complex/algorithms/pointcloud_normal.h b/vcg/complex/algorithms/pointcloud_normal.h index 4099de65..180db38f 100644 --- a/vcg/complex/algorithms/pointcloud_normal.h +++ b/vcg/complex/algorithms/pointcloud_normal.h @@ -35,7 +35,7 @@ public: bool operator< (const WArc &a) const {return w &tree,vcg::CallBackPos * cb=0) + static void ComputeUndirectedNormal(MeshType &m, int nn, float maxDist, KdTree &tree,vcg::CallBackPos * cb=0) { tree.setMaxNofNeighbors(nn); int cnt=0; @@ -54,13 +54,13 @@ public: if(Distance(vi->cP(),m.vert[neightId].cP()) plane; FitPlaneToPointSet(ptVec,plane); vi->N()=plane.Direction(); } } - static void AddNeighboursToHeap( MeshType &m, VertexPointer vp, KdTree &tree, std::vector &heap) + static void AddNeighboursToHeap( MeshType &m, VertexPointer vp, KdTree &tree, std::vector &heap) { tree.doQueryK(vp->cP()); @@ -74,10 +74,10 @@ public: { heap.push_back(WArc(vp,&(m.vert[neightId]))); //std::push_heap(heap.begin(),heap.end()); - if(heap.back().w < 0.3f) - heap.pop_back(); - else - std::push_heap(heap.begin(),heap.end()); + if(heap.back().w < 0.3f) + heap.pop_back(); + else + std::push_heap(heap.begin(),heap.end()); } } } @@ -98,7 +98,7 @@ public: int fittingAdjNum; /// number of adjacent nodes used for computing the fitting plane int smoothingIterNum; /// number of itaration of a simple normal smoothing (use the same number of ajdacent of fittingAdjNjm) int coherentAdjNum; /// number of nodes used in the coherency pass - Point3f viewPoint; /// position of a viewpoint used to disambiguate direction + CoordType viewPoint; /// position of a viewpoint used to disambiguate direction bool useViewPoint; /// if the position of the viewpoint has to be used. }; @@ -107,7 +107,7 @@ public: tri::Allocator::CompactVertexVector(m); if(cb) cb(1,"Building KdTree..."); VertexConstDataWrapper DW(m); - KdTree tree(DW); + KdTree tree(DW); ComputeUndirectedNormal(m, p.fittingAdjNum, std::numeric_limits::max(), tree,cb);