diff --git a/vcg/complex/trimesh/hole.h b/vcg/complex/trimesh/hole.h index e87b0925..5a47020f 100644 --- a/vcg/complex/trimesh/hole.h +++ b/vcg/complex/trimesh/hole.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.14 2006/11/07 15:13:56 zifnab1974 +Necessary changes for compilation with gcc 3.4.6. Especially the hash function is a problem + Revision 1.13 2006/11/07 11:47:11 cignoni gcc compiling issues @@ -1131,189 +1134,6 @@ namespace vcg { (*fi).ClearUserBit(UBIT); } } - - /* - Trivial Ear con preferred Normal - */ - template class TrivialEarN : public TrivialEar - { - public: - - using TrivialEar::e0; - using TrivialEar::e1; - using TrivialEar::quality; - TrivialEarN(){} - TrivialEarN(const face::Pos & ep) - { - this->e0=ep; - assert(this->e0.IsBorder()); - this->e1=this->e0; - this->e1.NextB(); - ComputeQuality(); - } - - - static typename MSH_TYPE::VertexType &PreferredNormal() - { - static typename MSH_TYPE::VertexType nn; - return nn; - } - - void ComputeQuality(){ - Point3d nn= -Normal( this->e0.VFlip()->P(), this->e0.v->P(), this->e1.v->P()); - this->quality = Distance(this->e0.VFlip()->P(),this->e1.v->P()); - if(nn*PreferredNormal() < -0.1) - this->quality*=1000000; - - }; - - }; - - /* 2d Triangulation Code */ - class Triangulate2D - { - - static double Area(const std::vector &contour) - { - int n = contour.size(); - - double A=0.0f; - - for(int p=n-1,q=0; q= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); - }; - - static bool Snip(const std::vector &contour,int u,int v,int w,int n,int *V) - { - int p; - double Ax, Ay, Bx, By, Cx, Cy, Px, Py; - const double epsilon =1e-2; - - Ax = contour[V[u]].X(); - Ay = contour[V[u]].Y(); - - Bx = contour[V[v]].X(); - By = contour[V[v]].Y(); - - Cx = contour[V[w]].X(); - Cy = contour[V[w]].Y(); - - if ( epsilon> (((Bx-Ax)*(Cy-Ay)) - ((By-Ay)*(Cx-Ax))) ) return false; - - for (p=0;p &contour,std::vector &result) - { - /* allocate and initialize list of Vertices in polygon */ - - int n = contour.size(); - double area=Area(contour); - if ( n < 3 ) return false; - - int *V = new int[n]; - - /* we want a counter-clockwise polygon in V */ - - if ( 0.0f < area ) for (int v=0; v2; ) - { - count--; - /* if we loop, it is probably a non-simple polygon */ - if( count<0) - { - CurrBest*=1.3; - count = 2*nv; - - if(CurrBest > sqrt(area)*2) - return false; - } - - /* three consecutive vertices in current polygon, */ - int u = v ; if (nv <= u) u = 0; /* previous */ - v = u+1; if (nv <= v) v = 0; /* new v */ - int w = v+1; if (nv <= w) w = 0; /* next */ - - if(Distance(contour[u],contour[w]) < CurrBest) - if ( Snip(contour,u,v,w,nv,V) ) - { - int a,b,c,s,t; - - /* true names of the vertices */ - a = V[u]; b = V[v]; c = V[w]; - - /* output Triangle */ - result.push_back( a ); - result.push_back( b ); - result.push_back( c ); - - m++; - - /* remove v from remaining polygon */ - for(s=v,t=v+1;t