Reverted to version 1.10 to nullify dangerous marfr960's changes

This commit is contained in:
Paolo Cignoni 2006-10-02 09:28:45 +00:00
parent 8f509dd74d
commit 9f8cbf3f08
1 changed files with 12 additions and 30 deletions

View File

@ -24,15 +24,6 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.13 2006/09/07 09:25:49 marfr960
casted returned value type to avoid warning C4267
Revision 1.12 2006/08/29 15:38:36 pietroni
in GridDoRay function the RayIterator must be initialized with maximum distance
Revision 1.11 2006/08/23 15:17:46 marfr960
*** empty log message ***
Revision 1.10 2006/05/17 12:48:52 pietroni Revision 1.10 2006/05/17 12:48:52 pietroni
corrected bug in GridGetInBox function corrected bug in GridGetInBox function
@ -123,28 +114,21 @@ namespace vcg{
Point3i _ip; Point3i _ip;
Si.PToIP(_p,_ip); Si.PToIP(_p,_ip);
Si.Grid( _ip[0],_ip[1],_ip[2], first, last ); Si.Grid( _ip[0],_ip[1],_ip[2], first, last );
for(l=first;l!=last;++l)
if (first != last)
{ {
l = first;// - 1; ObjPtr elem=&(**l);
while (l != last) if (!elem->IsD())
{ {
//l++; if (_getPointDistance((**l), _p,_minDist, t_res)) // <-- NEW: use of distance functor
ObjPtr elem=&(**l);
if (!elem->IsD())
{ {
if (_getPointDistance((**l), _p,_minDist, t_res)) // <-- NEW: use of distance functor winner=elem;
{ _closestPt=t_res;
winner=elem; newradius=_minDist; //
_closestPt=t_res;
newradius=_minDist; //
}
_marker.Mark(elem);
} }
l++; _marker.Mark(elem);
} }
iboxdone=Box3i(_ip,_ip);
} }
iboxdone=Box3i(_ip,_ip);
} }
int ix,iy,iz; int ix,iy,iz;
@ -232,7 +216,7 @@ namespace vcg{
typename SPATIALINDEXING::ScalarType & _t) typename SPATIALINDEXING::ScalarType & _t)
{ {
typedef vcg::RayIterator<SPATIALINDEXING,OBJRAYISECTFUNCTOR,OBJMARKER> RayIteratorType; typedef vcg::RayIterator<SPATIALINDEXING,OBJRAYISECTFUNCTOR,OBJMARKER> RayIteratorType;
RayIteratorType RayIte=RayIteratorType(_Si,_rayIntersector,_maxDist); RayIteratorType RayIte=RayIteratorType(_Si,_rayIntersector);
RayIte.SetMarker(_marker); RayIte.SetMarker(_marker);
RayIte.Init(_ray); RayIte.Init(_ray);
@ -262,16 +246,14 @@ namespace vcg{
_objectPtrs.clear(); _objectPtrs.clear();
_distances.clear(); _distances.clear();
_points.clear(); _points.clear();
int i = 0;
while (!Cli.End()) while (!Cli.End())
{ {
_objectPtrs.push_back(&(*Cli)); _objectPtrs.push_back(&(*Cli));
_distances.push_back(Cli.Dist()); _distances.push_back(Cli.Dist());
_points.push_back(Cli.NearestPoint()); _points.push_back(Cli.NearestPoint());
++Cli; ++Cli;
i++;
} }
return (int)(_objectPtrs.size()); return (_objectPtrs.size());
} }
template <class SPATIALINDEXING,class OBJMARKER, class OBJPTRCONTAINER> template <class SPATIALINDEXING,class OBJMARKER, class OBJPTRCONTAINER>