diff --git a/vcg/complex/algorithms/create/resampler.h b/vcg/complex/algorithms/create/resampler.h index 685b0692..5d517f5f 100644 --- a/vcg/complex/algorithms/create/resampler.h +++ b/vcg/complex/algorithms/create/resampler.h @@ -40,7 +40,7 @@ namespace tri { /*@{*/ /*@{*/ /** Class Resampler. - This is class reasmpling a mesh using marching cubes methods + This is class reasmpling a mesh using marching cubes methods @param OLD_MESH_TYPE (Template Parameter) Specifies the type of mesh to be resampled @param NEW_MESH_TYPE (Template Parameter) Specifies the type of output mesh. */ @@ -139,18 +139,18 @@ template 0) // we Not are in the middle of the face so the face normal is NOT reliable. - { + { closestNormV = (f->V(0)->cN())*pip[0] + (f->V(1)->cN())*pip[1] + (f->V(2)->cN())*pip[2] ; signBest = dir.dot(closestNormV) ; } @@ -205,7 +205,7 @@ template 0) positiveCnt ++; } - if(positiveCnt<=MultiSample/2) distSum = -distSum; + if(positiveCnt<=MultiSample/2) distSum = -distSum; return field_value(true, distSum/MultiSample); } @@ -294,7 +294,7 @@ template 0); -#ifndef NO_QT +#ifdef QT_VERSION if(flippedTot>0) qDebug("Flipped %i values in %i times",flippedTot,flippedTimes); #endif @@ -338,11 +338,11 @@ template siz.Y(); j++) + for (int j=0; j<=this->siz.Y(); j++) { - if (cb) cb((100*j)/this->siz.Y(),"Marching "); + if (cb) cb((100*j)/this->siz.Y(),"Marching "); ProcessSlice(extractor);//find cells where there is the isosurface and examine it - NextSlice(); + NextSlice(); } extractor.Finalize(); typename New_Mesh::VertexIterator vi; @@ -493,14 +493,14 @@ template siz.X(); - VertexIndex pos=-1; + VertexIndex pos=-1; if (p1.Y()==CurrentSlice) { if ((pos=_x_cs[index])==-1) @@ -525,21 +525,21 @@ template =0); + assert(pos>=0); v = &_newM->vert[pos]; } ///if there is a vertex in y axis of a cell return the vertex or create it void GetYIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer &v) { - assert(p1.X() == p2.X()); + assert(p1.X() == p2.X()); assert(p1.Y()+1 == p2.Y()); assert(p1.Z() == p2.Z()); int i = p1.X(); // (p1.X() - _bbox.min.X())/_cell_size.X(); int z = p1.Z(); // (p1.Z() - _bbox.min.Z())/_cell_size.Z(); VertexIndex index = i+z*this->siz.X(); - VertexIndex pos=-1; + VertexIndex pos=-1; if ((pos=_y_cs[index])==-1) { _y_cs[index] = (VertexIndex) _newM->vert.size(); @@ -548,14 +548,14 @@ template vert[ pos ]; v->P()=Interpolate(p1,p2,1); } - assert(pos>=0); - v = &_newM->vert[pos]; + assert(pos>=0); + v = &_newM->vert[pos]; } ///if there is a vertex in z axis of a cell return the vertex or create it void GetZIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer &v) { - assert(p1.X() == p2.X()); + assert(p1.X() == p2.X()); assert(p1.Y() == p2.Y()); assert(p1.Z()+1 == p2.Z()); @@ -563,7 +563,7 @@ template siz.X(); - VertexIndex pos=-1; + VertexIndex pos=-1; if (p1.Y()==CurrentSlice) { if ((pos=_z_cs[index])==-1) @@ -588,7 +588,7 @@ template =0); + assert(pos>=0); v = &_newM->vert[pos]; }