minor changes

This commit is contained in:
Nico Pietroni 2005-09-15 11:15:00 +00:00
parent 0f747b1967
commit 417bf69fc3
2 changed files with 12 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.7 2005/09/14 12:56:47 pietroni
used closest function from grid
Revision 1.6 2005/08/26 09:12:48 cignoni Revision 1.6 2005/08/26 09:12:48 cignoni
changed typedef A2UGridLink da 'GridStaticPtr<MESH::FaceContainer,double>::Link' a typedef 'GRID::Link' changed typedef A2UGridLink da 'GridStaticPtr<MESH::FaceContainer,double>::Link' a typedef 'GRID::Link'
@ -201,11 +204,11 @@ void Closest( MESH & mesh, const Point3<SCALAR> & p, GRID & gr, SCALAR & mdist,
// break; // break;
// vdist += vstep; // vdist += vstep;
//} //}
scalar error = gr.bbox.Diag(); scalar error = mdist;
typedef Tmark<MESH,MESH::FaceType> Marker; typedef Tmark<MESH,MESH::FaceType> Marker;
Marker t=Marker(mesh); Marker t=Marker(mesh);
MESH::FaceType* bestf= gr.GetClosest<Marker>(p,mdist,bestq,t); MESH::FaceType* bestf= gr.GetClosest<Marker>(p,error,bestq,t);
if(mdist > scalar(fabs(error))) if(mdist > scalar(fabs(error)))
{ {

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.21 2005/09/14 13:27:38 spinelli
minor changes
Revision 1.20 2005/09/14 12:57:52 pietroni Revision 1.20 2005/09/14 12:57:52 pietroni
canged template parameters for Closest Function (use of TempMark class) canged template parameters for Closest Function (use of TempMark class)
@ -342,6 +345,9 @@ namespace vcg {
int iy = int( dy ); int iy = int( dy );
int iz = int( dz ); int iz = int( dz );
if (!bbox.IsIn(p))
assert (0);///the grid has to be extended until the point
double voxel_min=voxel[0]; double voxel_min=voxel[0];
if (voxel_min<voxel[1]) voxel_min=voxel[1]; if (voxel_min<voxel[1]) voxel_min=voxel[1];
if (voxel_min<voxel[2]) voxel_min=voxel[2]; if (voxel_min<voxel[2]) voxel_min=voxel[2];