From 97f3e98cd20a636a1b5c2499b08eb2341bdb2e36 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 2 Dec 2005 00:13:34 +0000 Subject: [PATCH] Added and removed typenames for gcc compiling. removed also some template arguments specifcation that gcc disliked... commented out GetInSphereFace and SetMesh that are probably never used and i didnt succeed in compile --- vcg/complex/trimesh/closest.h | 132 ++++++++++++++++++---------------- 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/vcg/complex/trimesh/closest.h b/vcg/complex/trimesh/closest.h index cc8b6b48..9c52e117 100644 --- a/vcg/complex/trimesh/closest.h +++ b/vcg/complex/trimesh/closest.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.17 2005/10/05 17:02:52 pietroni +corrected bugs on GEtKClosestVert and GetInSphereVert + Revision 1.16 2005/10/03 16:19:07 spinelli fixed some bugs @@ -140,20 +143,20 @@ namespace vcg { // UGrid, ma non sono riuscito a definirlo implicitamente template - typename MESH::FaceType * GetClosestFace( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, - const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist, - typename GRID::CoordType _closestPt,typename GRID::CoordType & _normf, + typename MESH::FaceType * GetClosestFace( MESH & mesh, GRID & gr, const typename GRID::CoordType & _p, + const typename GRID::ScalarType & _maxDist, typename GRID::ScalarType & _minDist, + typename GRID::CoordType _closestPt, typename GRID::CoordType & _normf, typename GRID::CoordType & _ip) { - typedef GRID::ScalarType ScalarType; + typedef typename GRID::ScalarType ScalarType; typedef Point3 Point3x; typedef FaceTmark MarkerFace; MarkerFace mf; mf.SetMesh(&mesh); - typedef vcg::face::PointDistanceFunctor FDistFunct; + vcg::face::PointDistanceFunctor FDistFunct; _minDist=_maxDist; - typename MESH::FaceType* bestf= gr.GetClosest(FDistFunct(),mf,_p,_maxDist,_minDist,_closestPt); + typename MESH::FaceType* bestf= gr.GetClosest(FDistFunct, mf, _p, _maxDist, _minDist, _closestPt); if(_maxDist> ScalarType(fabs(_minDist))) { @@ -178,12 +181,12 @@ namespace vcg { const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist, typename GRID::CoordType _closestPt,typename GRID::CoordType & _normf) { - Point3 _ip; + Point3 _ip; typedef FaceTmark MarkerFace; MarkerFace mf; mf.SetMesh(&mesh); - typedef vcg::face::PointDistanceFunctor FDistFunct; - return ( gr.GetClosest(FDistFunct(),mf,_p,_maxDist,_minDist,_closestPt) ); + vcg::face::PointDistanceFunctor FDistFunct; + return ( gr.GetClosest(FDistFunct,mf,_p,_maxDist,_minDist,_closestPt) ); } template @@ -191,21 +194,21 @@ namespace vcg { const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist, typename GRID::CoordType _closestPt) { - typedef GRID::ScalarType ScalarType; + typedef typename GRID::ScalarType ScalarType; typedef Point3 Point3x; typedef FaceTmark MarkerFace; MarkerFace mf; mf.SetMesh(&mesh); - typedef vcg::face::PointDistanceFunctor PDistFunct; + vcg::face::PointDistanceFunctor PDistFunct; _minDist=_maxDist; - return (gr.GetClosest(PDistFunct(),mf,_p,_maxDist,_minDist,_closestPt)); + return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt)); } template typename MESH::VertexType * GetClosestVertex( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p, const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist ) { - typedef GRID::ScalarType ScalarType; + typedef typename GRID::ScalarType ScalarType; typedef Point3 Point3x; typedef VertTmark MarkerVert; MarkerVert mv; @@ -213,7 +216,7 @@ namespace vcg { typedef vcg::vertex::PointDistanceFunctor VDistFunct; _minDist=_maxDist; Point3x _closestPt; - return (gr.GetClosest(VDistFunct(),mv,_p,_maxDist,_minDist,_closestPt)); + return (gr.GetClosest/**/(VDistFunct(),mv,_p,_maxDist,_minDist,_closestPt)); } template @@ -224,9 +227,9 @@ namespace vcg { typedef FaceTmark MarkerFace; MarkerFace mf; mf.SetMesh(&mesh); - typedef vcg::face::PointDistanceFunctor FDistFunct; - return (gr.GetKClosest - (FDistFunct(),mf,_k,_p,_maxDist,_objectPtrs,_distances,_points)); + vcg::face::PointDistanceFunctor FDistFunct; + return (gr.GetKClosest /**/ + (FDistFunct,mf,_k,_p,_maxDist,_objectPtrs,_distances,_points)); } template @@ -238,26 +241,26 @@ namespace vcg { MarkerVert mv; mv.SetMesh(&mesh); typedef vcg::vertex::PointDistanceFunctor VDistFunct; - return (gr.GetKClosest + return (gr.GetKClosest/* */ (VDistFunct(),mv,_k,_p,_maxDist,_objectPtrs,_distances,_points)); } - template - unsigned int GetInSphereFace(MESH & mesh, - GRID & gr, - const typename GRID::CoordType & _p, - const typename GRID::ScalarType & _r, - OBJPTRCONTAINER & _objectPtrs, - DISTCONTAINER & _distances, - POINTCONTAINER & _points) - { - typedef FaceTmark MarkerFace; - MarkerFace mf; - mf.SetMesh(&mesh); - typedef vcg::face::PointDistanceFunctor FDistFunct; - return (gr.GetInSphere - (FDistFunct(),mf,_p,_r,_maxDist,_objectPtrs,_distances,_points)); - } + //template + // unsigned int GetInSphereFace(MESH & mesh, + // GRID & gr, + // const typename GRID::CoordType & _p, + // const typename GRID::ScalarType & _r, + // OBJPTRCONTAINER & _objectPtrs, + // DISTCONTAINER & _distances, + // POINTCONTAINER & _points) + //{ + // typedef FaceTmark MarkerFace; + // MarkerFace mf; + // mf.SetMesh(&mesh); + // typedef vcg::face::PointDistanceFunctor F DistFunct; + // return (gr.GetInSphere/**/ + // (FDistFunct(),mf,_p,_r,_maxDist,_objectPtrs,_distances,_points)); + //} template unsigned int GetInSphereVertex(MESH & mesh, @@ -272,7 +275,7 @@ namespace vcg { MarkerVert mv; mv.SetMesh(&mesh); typedef vcg::vertex::PointDistanceFunctor VDistFunct; - return (gr.GetInSphere + return (gr.GetInSphere/**/ (VDistFunct(),mv,_p,_r,_objectPtrs,_distances,_points)); } @@ -285,7 +288,7 @@ namespace vcg { typedef FaceTmark MarkerFace; MarkerFace mf; mf.SetMesh(&mesh); - return(gr.GetInBox(mf,_bbox,_objectPtrs)); + return(gr.GetInBox/**/(mf,_bbox,_objectPtrs)); } template @@ -297,15 +300,15 @@ namespace vcg { typedef VertTmark MarkerVert; MarkerVert mv; mv.SetMesh(&mesh); - return(gr.GetInBox(mv,_bbox,_objectPtrs)); + return(gr.GetInBox/**/(mv,_bbox,_objectPtrs)); } template typename GRID::ObjPtr DoRay(MESH & mesh,GRID & gr, const Ray3 & _ray, const typename GRID::ScalarType & _maxDist, typename GRID::ScalarType & _t) { - typedef MESH::FaceType FaceType; - typedef MESH::ScalarType ScalarType; + typedef typename MESH::FaceType FaceType; + typedef typename MESH::ScalarType ScalarType; typedef FaceTmark MarkerFace; MarkerFace mf; mf.SetMesh(&mesh); @@ -318,56 +321,59 @@ namespace vcg { template class ClosestFaceIterator:public vcg::ClosestIterator > + vcg::face::PointDistanceFunctor, FaceTmark > { public: - typedef typename GRID GridType; - typedef typename MESH MeshType; - typedef typename FaceTmark MarkerFace; - typedef typename vcg::face::PointDistanceFunctor PDistFunct; - typedef typename vcg::ClosestIterator > ClosestBaseType; + typedef GRID GridType; + typedef MESH MeshType; + typedef FaceTmark MarkerFace; + typedef vcg::face::PointDistanceFunctor PDistFunct; + typedef vcg::ClosestIterator > ClosestBaseType; typedef typename MESH::FaceType FaceType; typedef typename MESH::ScalarType ScalarType; //ClosestFaceIterator(GridType &_Si):ClosestBaseType(_Si,PDistFunct()){} ClosestFaceIterator(GridType &_Si):ClosestBaseType(_Si,PDistFunct()){} - void SetMesh(MeshType *m) - {tm.SetMesh(m);} +// Commented out: it seems unuseful and make gcc complain. p. +// void SetMesh(MeshType *m) +// {tm.SetMesh(m);} }; template - class ClosestVertexIterator:public vcg::ClosestIterator > + class ClosestVertexIterator:public vcg::ClosestIterator > { public: - typedef typename GRID GridType; - typedef typename MESH MeshType; - typedef typename VertTmark MarkerVert; - typedef typename vcg::vertex::PointDistanceFunctor VDistFunct; - typedef typename vcg::ClosestIterator > ClosestBaseType; + typedef GRID GridType; + typedef MESH MeshType; + typedef VertTmark MarkerVert; + typedef vcg::vertex::PointDistanceFunctor VDistFunct; + typedef vcg::ClosestIterator > ClosestBaseType; ClosestVertexIterator(GridType &_Si):ClosestBaseType(_Si,VDistFunct()){} - void SetMesh(MeshType *m) - {tm.SetMesh(m);} +// Commented out: it seems unuseful and make gcc complain. p. +// void SetMesh(MeshType *m) +// {tm.SetMesh(m);} }; template - class TriRayIterator:public vcg::RayIterator,typename FaceTmark > + class TriRayIterator:public vcg::RayIterator,FaceTmark > { public: - typedef typename GRID GridType; - typedef typename MESH MeshType; - typedef typename FaceTmark MarkerFace; - typedef typename vcg::RayTriangleIntersectionFunctor FintFunct; - typedef typename vcg::RayIterator > RayBaseType; + typedef GRID GridType; + typedef MESH MeshType; + typedef FaceTmark MarkerFace; + typedef vcg::RayTriangleIntersectionFunctor FintFunct; + typedef vcg::RayIterator > RayBaseType; typedef typename MESH::FaceType FaceType; typedef typename MESH::ScalarType ScalarType; TriRayIterator(GridType &_Si):RayBaseType(_Si,FintFunct()){} - void SetMesh(MeshType *m) - {tm.SetMesh(m);} +// Commented out: it seems unuseful and make gcc complain. p. +// void SetMesh(MeshType *m) +// {tm.SetMesh(m);} };