0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BOPAlgo / BOPAlgo_MakerVolume.cxx
index b602d21..14f4832 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <BOPAlgo_MakerVolume.ixx>
-
-#include <NCollection_IncAllocator.hxx>
 
 #include <Bnd_Box.hxx>
-
-#include <TopoDS_Solid.hxx>
-
-#include <TopExp_Explorer.hxx>
-
-#include <BRepPrimAPI_MakeBox.hxx>
-
-#include <BOPCol_ListOfShape.hxx>
+#include <BOPAlgo_BuilderSolid.hxx>
+#include <BOPAlgo_MakerVolume.hxx>
+#include <BOPAlgo_PaveFiller.hxx>
 #include <BOPCol_DataMapOfShapeListOfShape.hxx>
-
+#include <BOPCol_ListOfShape.hxx>
 #include <BOPDS_DS.hxx>
-
-#include <BOPAlgo_PaveFiller.hxx>
-#include <BOPAlgo_BuilderSolid.hxx>
-
 #include <BOPTools.hxx>
 #include <BOPTools_AlgoTools.hxx>
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <NCollection_IncAllocator.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS_Solid.hxx>
 
 static
   void AddFace(const TopoDS_Shape& theF,
@@ -43,6 +35,29 @@ static
                      BOPCol_MapOfShape& aMFence,
                      BOPCol_ListOfShape& theLS);
 
+//=======================================================================
+//function : CheckData
+//purpose  : 
+//=======================================================================
+void BOPAlgo_MakerVolume::CheckData()
+{
+  if (myArguments.IsEmpty()) {
+    myErrorStatus = 100; // no arguments to process
+    return;
+  }
+  // myPaveFiller
+  if (!myPaveFiller) {
+    myErrorStatus = 101; 
+    return;
+  }
+  //
+  myErrorStatus = myPaveFiller->ErrorStatus();
+  if (myErrorStatus) {
+    myErrorStatus = 102; // PaveFiller is failed
+    return;
+  }
+}
+
 //=======================================================================
 //function : Perform
 //purpose  : 
@@ -84,6 +99,8 @@ void BOPAlgo_MakerVolume::Perform()
   }
   //
   pPF->SetRunParallel(myRunParallel);
+  pPF->SetProgressIndicator(myProgressIndicator);
+  pPF->SetFuzzyValue(myFuzzyValue);
   pPF->Perform();
   //
   myEntryPoint = 1;
@@ -219,7 +236,7 @@ void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces)
   //
   Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
   //
-  anExt = myBBox.SquareExtent() * 0.5;
+  anExt = sqrt(myBBox.SquareExtent()) * 0.5;
   myBBox.Enlarge(anExt);
   myBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
   //