0027557: Unstable HLR tests
[occt.git] / src / HLRBRep / HLRBRep_Data.cxx
index d8e53fd..63e7ee0 100644 (file)
@@ -41,6 +41,8 @@
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 
 #include <stdio.h>
+IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_Data,MMgt_TShared)
+
 Standard_Integer nbOkIntersection;
 Standard_Integer nbPtIntersection;
 Standard_Integer nbSegIntersection;
@@ -772,7 +774,7 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
     Standard_Boolean withOutL = Standard_False;
     
     for (myFaceItr1.InitEdge(*fd);
-        myFaceItr1.MoreEdge() && !cut && !withOutL;
+        myFaceItr1.MoreEdge();
         myFaceItr1.NextEdge()) {
       if (myFaceItr1.Internal()) {
        withOutL = Standard_True;
@@ -806,7 +808,7 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
     fd->Side(FS.IsSide(tol,myToler*10));
     Standard_Boolean inverted = Standard_False;
     if (fd->WithOutL() && !fd->Side()) {
-      //inverted = OrientOutLine(face,*fd);
+      inverted = OrientOutLine(face,*fd);
       OrientOthEdge(face,*fd);
     }
     if (fd->Side()) {
@@ -826,12 +828,12 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
        myFEOutLine  = myFaceItr1.OutLine    ();
        myFEInternal = myFaceItr1.Internal   ();
        myFEDouble   = myFaceItr1.Double     ();
-       HLRBRep_EdgeData* ed = &(myEData(myFE));
+       HLRBRep_EdgeData* EDataFE1 = &(myEData(myFE));
        if (!myFEDouble &&
            (myFEOri == TopAbs_FORWARD ||
             myFEOri == TopAbs_REVERSED)) {
-         myFEGeom = &(ed->ChangeGeometry());
-         const HLRBRep_Curve& EC = ed->Geometry();
+         myFEGeom = &(EDataFE1->ChangeGeometry());
+         const HLRBRep_Curve& EC = EDataFE1->Geometry();
          p = EC.Parameter3d((EC.LastParameter () +
                              EC.FirstParameter()) / 2);
          if (HLRBRep_EdgeFaceTool::UVPoint(p,myFEGeom,iFaceGeom,pu,pv)) {
@@ -890,9 +892,9 @@ void HLRBRep_Data::Update (const HLRAlgo_Projector& P)
         myFaceItr1.MoreEdge();
         myFaceItr1.NextEdge()) {
       myFE = myFaceItr1.Edge();
-      HLRBRep_EdgeData* ed = &(myEData(myFE));
-      if (!fd->Simple()) ed->AutoIntersectionDone(Standard_False);
-      HLRAlgo::DecodeMinMax(ed->MinMax(),
+      HLRBRep_EdgeData* EDataFE2 = &(myEData(myFE));
+      if (!fd->Simple()) EDataFE2->AutoIntersectionDone(Standard_False);
+      HLRAlgo::DecodeMinMax(EDataFE2->MinMax(),
                            (Standard_Address)EdgeMin,
                            (Standard_Address)EdgeMax);
       if (myFaceItr1.BeginningOfWire())
@@ -1221,7 +1223,7 @@ void HLRBRep_Data::NextInterference ()
     if (myFEOri == TopAbs_FORWARD ||
        myFEOri == TopAbs_REVERSED) {
       // Edge from the boundary
-      if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && !myFEDouble) {
+      if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && !(myFEDouble && !myFEOutLine)) {
        // not a vertical edge and not a double Edge
        Standard_Address MinMaxFEdg = ((HLRBRep_EdgeData*)myFEData)->MinMax();
        //-- -----------------------------------------------------------------------
@@ -1985,7 +1987,7 @@ HLRBRep_Data::Classify (const Standard_Integer E,
     HLRAlgo::EncodeMinMax((Standard_Address)VertMin,
                          (Standard_Address)VertMax,
                          (Standard_Address)MinMaxVert);
-
+    /*
 #ifdef OCCT_DEBUG
        {
          Standard_Integer qwe,qwep8,q,q1,q2;
@@ -2025,6 +2027,7 @@ HLRBRep_Data::Classify (const Standard_Integer E,
          cout<<endl;
        }
  #endif
+    */
 
     if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
        ((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
@@ -2107,7 +2110,9 @@ HLRBRep_Data::Classify (const Standard_Integer E,
            
            do {
              gp_Pnt2d pnt2d(u,v);
-             if (myClassifier->Classify(pnt2d,0.0)!=TopAbs_OUT) {
+             if (myClassifier->Classify(pnt2d,Precision::PConfusion())
+                  != TopAbs_OUT)
+              {
                InsideRestriction = Standard_True;
                state = TopAbs_IN;
                Level++;