0024428: Implementation of LGPL license
[occt.git] / src / BOPAlgo / BOPAlgo_Builder.cxx
index 4fd40e0..21377ff 100644 (file)
@@ -1,24 +1,19 @@
 // Created by: Peter KURNEV
-// Copyright (c) 2010-2012 OPEN CASCADE SAS
+// Copyright (c) 2010-2014 OPEN CASCADE SAS
 // Copyright (c) 2007-2010 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
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and / or modify it
+// under the terms of the GNU Lesser General Public version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <BOPAlgo_Builder.ixx>
 
@@ -34,7 +29,7 @@
 //function : 
 //purpose  : 
 //=======================================================================
-  BOPAlgo_Builder::BOPAlgo_Builder()
+BOPAlgo_Builder::BOPAlgo_Builder()
 :
   BOPAlgo_BuilderShape(),
   myArguments(myAllocator),
   myImages(100, myAllocator),
   myShapesSD(100, myAllocator),
   mySplits(100, myAllocator),
-  myOrigins(100, myAllocator)
+  myOrigins(100, myAllocator),
+  myRunParallel(Standard_False)
 {
 }
 //=======================================================================
 //function : 
 //purpose  : 
 //=======================================================================
-  BOPAlgo_Builder::BOPAlgo_Builder(const Handle(NCollection_BaseAllocator)& theAllocator)
+BOPAlgo_Builder::BOPAlgo_Builder
+  (const Handle(NCollection_BaseAllocator)& theAllocator)
 :
   BOPAlgo_BuilderShape(theAllocator),
   myArguments(myAllocator),
   myImages(100, myAllocator), 
   myShapesSD(100, myAllocator),
   mySplits(100, myAllocator),
-  myOrigins(100, myAllocator)
+  myOrigins(100, myAllocator),
+  myRunParallel(Standard_False)
 {
 }
 //=======================================================================
 //function : ~
 //purpose  : 
 //=======================================================================
-  BOPAlgo_Builder::~BOPAlgo_Builder()
+BOPAlgo_Builder::~BOPAlgo_Builder()
 {
   if (myEntryPoint==1) {
     if (myPaveFiller) {
@@ -85,7 +83,7 @@
 //function : Clear
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::Clear()
+void BOPAlgo_Builder::Clear()
 {
   myArguments.Clear();
   myMapFence.Clear();
   myOrigins.Clear();
 }
 //=======================================================================
+//function : SetRunParallel
+//purpose  : 
+//=======================================================================
+void BOPAlgo_Builder::SetRunParallel(const Standard_Boolean theFlag)
+{
+  myRunParallel=theFlag;
+}
+//=======================================================================
+//function : RunParallel
+//purpose  : 
+//=======================================================================
+Standard_Boolean BOPAlgo_Builder::RunParallel()const
+{
+  return myRunParallel;
+}
+//=======================================================================
 //function : AddArgument
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::AddArgument(const TopoDS_Shape& theShape)
+void BOPAlgo_Builder::AddArgument(const TopoDS_Shape& theShape)
 {
   if (myMapFence.Add(theShape)) {
     myArguments.Append(theShape);
 //function : Arguments
 //purpose  : 
 //=======================================================================
-  const BOPCol_ListOfShape& BOPAlgo_Builder::Arguments()const
+const BOPCol_ListOfShape& BOPAlgo_Builder::Arguments()const
 {
   return myArguments;
 }
 //function : Images
 //purpose  : 
 //=======================================================================
-  const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Images()const
+const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Images()const
 {
   return myImages;
 }
 //function : Origins
 //purpose  : 
 //=======================================================================
-  const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::Origins()const
+const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::Origins()const
 {
   return myOrigins;
 }
 //function : ShapesSd
 //purpose  : 
 //=======================================================================
-  const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::ShapesSD()const
+const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::ShapesSD()const
 {
   return myShapesSD;
 }
 //function : Splits
 //purpose  : 
 //=======================================================================
-  const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Splits()const
+const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Splits()const
 {
   return mySplits;
 }
 //function : PPaveFiller
 //purpose  : 
 //=======================================================================
-  BOPAlgo_PPaveFiller BOPAlgo_Builder::PPaveFiller()
+BOPAlgo_PPaveFiller BOPAlgo_Builder::PPaveFiller()
 {
   return myPaveFiller;
 }
 //function : PDS
 //purpose  : 
 //=======================================================================
-  BOPDS_PDS BOPAlgo_Builder::PDS()
+BOPDS_PDS BOPAlgo_Builder::PDS()
 {
   return myDS;
 }
 // function: CheckData
 // purpose: 
 //=======================================================================
-  void BOPAlgo_Builder::CheckData()
+void BOPAlgo_Builder::CheckData()
 {
   Standard_Integer aNb;
   //
 //function : Prepare
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::Prepare()
+void BOPAlgo_Builder::Prepare()
 {
   myErrorStatus=0;
   //
 //function : Perform
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::Perform()
+void BOPAlgo_Builder::Perform()
 {
   myErrorStatus=0;
   //
 //function : PerformWithFiller
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
 {
   myEntryPoint=0;
   PerformInternal(theFiller);
 //function : PerformInternal
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
 {
   myErrorStatus=0;
   //
 //function : PostTreat
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::PostTreat()
+void BOPAlgo_Builder::PostTreat()
 {
   //BRepLib::SameParameter(myShape, 1.e-7, Standard_True);
-  BOPTools_AlgoTools::CorrectTolerances(myShape, 0.01);
+  BOPTools_AlgoTools::CorrectTolerances(myShape, 0.05);
   BOPTools_AlgoTools::CorrectShapeTolerances(myShape);
 }