Salome HOME
Porting to dev version of OCCT.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_ShellSolid.cxx
index 454f70fdd3b5f35519da48e2b5e0638ebfc84286..111d9911c4b039674658e34671d7036280a01b90 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -48,9 +48,9 @@
 
 #include <BOPTools_AlgoTools.hxx>
 
-#include <BOPCol_DataMapOfShapeListOfShape.hxx>
-#include <BOPCol_ListOfShape.hxx>
-#include <BOPInt_Context.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <IntTools_Context.hxx>
 #include <BOPDS_DS.hxx>
 #include <BOPAlgo_Builder.hxx>
 
@@ -95,7 +95,6 @@ GEOMAlgo_ShellSolidBuilder::~GEOMAlgo_ShellSolidBuilder()
 //=======================================================================
 void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
 {
-  myErrorStatus=0;
    //
   myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
   myDS=myPaveFiller->PDS();
@@ -103,57 +102,57 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
   //
   // 1. CheckData
   CheckData();
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   //
   // 2. Prepare
   Prepare();
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   //
   // 3. Fill Images
   // 3.1 Vertice
   FillImagesVertices();
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   //
   BuildResult(TopAbs_VERTEX);
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   // 3.2 Edges
   FillImagesEdges();
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   //
   BuildResult(TopAbs_EDGE);
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   } 
   //
   // 3.3 Wires
   FillImagesContainers(TopAbs_WIRE);
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   //
   BuildResult(TopAbs_WIRE);
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   
   // 3.4 Faces
   FillImagesFaces();
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
   //
   BuildResult(TopAbs_FACE);
-  if (myErrorStatus) {
+  if (HasErrors()) {
     return;
   }
 }
@@ -180,7 +179,6 @@ GEOMAlgo_ShellSolid::~GEOMAlgo_ShellSolid()
 //=======================================================================
 void GEOMAlgo_ShellSolid::Perform()
 {
-  myErrorStatus=0;
   //
   try {
     Standard_Integer aNbArgs, iRank, iErr, iBeg, iEnd, i, aNbSp;
@@ -201,14 +199,14 @@ void GEOMAlgo_ShellSolid::Perform()
       myErrorStatus=10;
       return;
     }
-    if(myDSFiller->ErrorStatus()) {
+    if(myDSFiller->HasErrors()) {
       myErrorStatus=11;
       return;
     }
     //
     const BOPDS_DS& aDS=myDSFiller->DS();
     BOPDS_DS* pDS=(BOPDS_DS*)&aDS;
-    const BOPCol_ListOfShape& aLS=pDS->Arguments();
+    const TopTools_ListOfShape& aLS=pDS->Arguments();
     //
     aNbArgs=aLS.Extent();
     if (aNbArgs!=2) {
@@ -231,73 +229,73 @@ void GEOMAlgo_ShellSolid::Perform()
       return;
     }
     //
-    Handle(BOPInt_Context) aCtx=myDSFiller->Context();
+    Handle(IntTools_Context) aCtx=myDSFiller->Context();
     const BOPDS_IndexRange& aRange=pDS->Range(iRank);
     aRange.Indices(iBeg, iEnd);
     const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
-    BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
+    //BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
     //
     //------------------------------ShellSolidBuilder
     GEOMAlgo_ShellSolidBuilder aSSB;
     //
     aSSB.PerformWithFiller(*myDSFiller);
-    iErr=aSSB.ErrorStatus();
+    iErr=aSSB.HasErrors();
     if (iErr) {
       myErrorStatus=15;
       return;
     }
     //
-    const BOPCol_DataMapOfShapeListOfShape& aImages=aSSB.Images();
+    const TopTools_DataMapOfShapeListOfShape& aImages=aSSB.Images();
     //
     //-------------------------------
     for (i=iBeg; i<=iEnd; ++i) {
       const TopoDS_Shape& aS=pDS->Shape(i);
       aType=aS.ShapeType();
       if (aType!=TopAbs_FACE) {
-       continue;
+        continue;
       }
       //
       aState=TopAbs_UNKNOWN;
       aF=*((TopoDS_Face*)&aS);
       //
       if (!aImages.IsBound(aS)) {
-       iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
-       if (iErr) {
-         myErrorStatus=16;
-         return;
-       }
-       //
-       aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
+        iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
+        if (iErr) {
+          myErrorStatus=16;
+          return;
+        }
+        //
+        aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
       }
       else {
-       const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
-       aNbSp=aLSp.Extent();
-       if (aNbSp>0) {
-         continue;
-       }
-       //
-       if (aNbSp==1) {
-         aF=*((TopoDS_Face*)&aLSp.First());
-       }
-       //
-       iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
-       if (iErr) {
-         myErrorStatus=16;
-         return;
-       }
-       //
-       aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
+        const TopTools_ListOfShape& aLSp=aImages.Find(aS);
+        aNbSp=aLSp.Extent();
+        if (aNbSp>0) {
+          continue;
+        }
+        //
+        if (aNbSp==1) {
+          aF=*((TopoDS_Face*)&aLSp.First());
+        }
+        //
+        iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
+        if (iErr) {
+          myErrorStatus=16;
+          return;
+        }
+        //
+        aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
       }
       //----------
       if (aState==TopAbs_ON) {
-       myLSON.Append(aF);
+        myLSON.Append(aF);
       }
       else if (aState==TopAbs_OUT) {
-       myLSOUT.Append(aF);
+        myLSOUT.Append(aF);
       }
       else if (aState==TopAbs_IN) {
-       myLSIN.Append(aF);
-      }        
+        myLSIN.Append(aF);
+      } 
       //----------
     }//for (i=iBeg; i<=iEnd; ++i) {