0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BOPAlgo / BOPAlgo_PaveFiller.cxx
index ca09c2d..1141abb 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <BOPAlgo_PaveFiller.ixx>
 
-#include <NCollection_BaseAllocator.hxx>
-
-#include <BOPInt_Context.hxx>
+#include <BOPAlgo_PaveFiller.hxx>
+#include <BOPAlgo_SectionAttribute.hxx>
+#include <BOPDS_Curve.hxx>
 #include <BOPDS_DS.hxx>
 #include <BOPDS_Iterator.hxx>
+#include <BOPDS_PaveBlock.hxx>
+#include <gp_Pnt.hxx>
+#include <IntTools_Context.hxx>
+#include <NCollection_BaseAllocator.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
 
 //=======================================================================
 //function : 
 //purpose  : 
 //=======================================================================
-  BOPAlgo_PaveFiller::BOPAlgo_PaveFiller()
+BOPAlgo_PaveFiller::BOPAlgo_PaveFiller()
 :
-  BOPAlgo_Algo()
+  BOPAlgo_Algo(),
+  myFuzzyValue(0.)
 {
   myDS=NULL;
   myIterator=NULL;
 //function : 
 //purpose  : 
 //=======================================================================
-  BOPAlgo_PaveFiller::BOPAlgo_PaveFiller(const Handle(NCollection_BaseAllocator)& theAllocator)
+BOPAlgo_PaveFiller::BOPAlgo_PaveFiller
+  (const Handle(NCollection_BaseAllocator)& theAllocator)
 :
-  BOPAlgo_Algo(theAllocator)
+  BOPAlgo_Algo(theAllocator),
+  myFuzzyValue(0.)
 {
   myDS=NULL;
   myIterator=NULL;
@@ -49,7 +60,7 @@
 //function : ~
 //purpose  : 
 //=======================================================================
-  BOPAlgo_PaveFiller::~BOPAlgo_PaveFiller()
+BOPAlgo_PaveFiller::~BOPAlgo_PaveFiller()
 {
   Clear();
 }
@@ -57,7 +68,7 @@
 //function : Clear
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_PaveFiller::Clear()
+void BOPAlgo_PaveFiller::Clear()
 {
   if (myIterator) {
     delete myIterator;
     delete myDS;
     myDS=NULL;
   }
-  myErrorStatus=2;
 }
 //=======================================================================
 //function : DS
 //purpose  : 
 //=======================================================================
-  const BOPDS_DS& BOPAlgo_PaveFiller::DS()
+const BOPDS_DS& BOPAlgo_PaveFiller::DS()
 {
   return *myDS;
 }
@@ -81,7 +91,7 @@
 //function : PDS
 //purpose  : 
 //=======================================================================
-  BOPDS_PDS BOPAlgo_PaveFiller::PDS()
+BOPDS_PDS BOPAlgo_PaveFiller::PDS()
 {
   return myDS;
 }
@@ -89,7 +99,7 @@
 //function : Context
 //purpose  : 
 //=======================================================================
-  Handle(BOPInt_Context) BOPAlgo_PaveFiller::Context()
+Handle(IntTools_Context) BOPAlgo_PaveFiller::Context()
 {
   return myContext;
 }
 //function : SectionAttribute
 //purpose  : 
 //=======================================================================
-  void  BOPAlgo_PaveFiller::SetSectionAttribute(const BOPAlgo_SectionAttribute& theSecAttr)
+void BOPAlgo_PaveFiller::SetSectionAttribute
+  (const BOPAlgo_SectionAttribute& theSecAttr)
 {
   mySectionAttribute = theSecAttr;
 }
 //function : SetArguments
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_PaveFiller::SetArguments(const BOPCol_ListOfShape& theLS)
+void BOPAlgo_PaveFiller::SetArguments(const BOPCol_ListOfShape& theLS)
 {
   myArguments=theLS;
 }
 //function : Arguments
 //purpose  : 
 //=======================================================================
-  const BOPCol_ListOfShape& BOPAlgo_PaveFiller::Arguments()const
+const BOPCol_ListOfShape& BOPAlgo_PaveFiller::Arguments()const
 {
   return myArguments;
 }
 //=======================================================================
+//function : SetFuzzyValue
+//purpose  : 
+//=======================================================================
+void BOPAlgo_PaveFiller::SetFuzzyValue(const Standard_Real theFuzz)
+{
+  myFuzzyValue = (theFuzz < 0.) ? 0. : theFuzz;
+}
+//=======================================================================
+//function : FuzzyValue
+//purpose  : 
+//=======================================================================
+Standard_Real BOPAlgo_PaveFiller::FuzzyValue() const
+{
+  return myFuzzyValue;
+}
+//=======================================================================
 // function: Init
 // purpose: 
 //=======================================================================
-  void BOPAlgo_PaveFiller::Init()
+void BOPAlgo_PaveFiller::Init()
 {
   myErrorStatus=0;
   //
   // 1.myDS 
   myDS=new BOPDS_DS(myAllocator);
   myDS->SetArguments(myArguments);
+  myDS->SetFuzzyValue(myFuzzyValue);
   myDS->Init();
   //
   // 2.myIterator 
   myIterator=new BOPDS_Iterator(myAllocator);
+  myIterator->SetRunParallel(myRunParallel);
   myIterator->SetDS(myDS);
   myIterator->Prepare();
   //
   // 3 myContext
-  myContext=new BOPInt_Context;
+  myContext=new IntTools_Context;
   //
   myErrorStatus=0;
 }
 // function: Perform
 // purpose: 
 //=======================================================================
-  void BOPAlgo_PaveFiller::Perform()
+void BOPAlgo_PaveFiller::Perform()
+{
+  myErrorStatus=0;
+  try { 
+    OCC_CATCH_SIGNALS
+    //
+    PerformInternal();
+  }
+  //
+  catch (Standard_Failure) {
+    myErrorStatus=11;
+  } 
+  //
+  myDS->SetDefaultTolerances();
+}
+//=======================================================================
+// function: PerformInternal
+// purpose: 
+//=======================================================================
+void BOPAlgo_PaveFiller::PerformInternal()
 {
   myErrorStatus=0;
   //
   Init();
   if (myErrorStatus) {
-   return; 
+    return; 
+  }
+  //
+  Prepare();
+  if (myErrorStatus) {
+    return; 
   }
   // 00
   PerformVV();
     return; 
   }
   //
-}
+  // 03
+  PerformVZ();
+  if (myErrorStatus) {
+    return;
+  }
+  // 13
+  PerformEZ();
+  if (myErrorStatus) {
+    return;
+  }
+  // 23
+  PerformFZ();
+  if (myErrorStatus) {
+    return;
+  }
+  // 33
+  PerformZZ();
+  if (myErrorStatus) {
+    return;
+  }
+}