]> OCCT Git - occt.git/commitdiff
0022600: TBB has to be disabled in BRepMesh due to data races BRepMesh_FastDiscret...
authorKGV <>
Fri, 30 Sep 2011 06:42:58 +0000 (06:42 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:30:34 +0000 (19:30 +0400)
src/BRepMesh/BRepMesh_FastDiscret.cxx

index c2e3305eb0f68e5fb8adb5868e5fe2b06d44cd88..2bf48100f1799871a2434cb233d242ba8a4c4333 100755 (executable)
@@ -160,6 +160,7 @@ BRepMesh_FastDiscret::BRepMesh_FastDiscret(const Standard_Real    theDefle,
 }
 
 //=======================================================================
+<<<<<<< .working
 //function : BoxMaxDimension
 //purpose  : 
 //=======================================================================
@@ -206,6 +207,72 @@ Standard_Real BRepMesh_FastDiscret::RelativeEdgeDeflection(const TopoDS_Edge& th
 }
 
 //=======================================================================
+=======
+//function : SetParallel
+//purpose  :
+//=======================================================================
+void BRepMesh_FastDiscret::SetParallel (const Standard_Boolean theInParallel)
+{
+  myInParallel = theInParallel;
+}
+
+//=======================================================================
+//function : IsParallel
+//purpose  :
+//=======================================================================
+Standard_Boolean BRepMesh_FastDiscret::IsParallel() const
+{
+  return myInParallel;
+}
+
+//=======================================================================
+//function : BoxMaxDimension
+//purpose  : 
+//=======================================================================
+
+void BRepMesh_FastDiscret::BoxMaxDimension(const Bnd_Box& theBox, Standard_Real& theMaxDim)
+{
+  if(theBox.IsVoid())
+    return;
+  Standard_Real TXmin, TYmin, TZmin, TXmax, TYmax, TZmax;
+  theBox.Get(TXmin, TYmin, TZmin, TXmax, TYmax, TZmax);
+  theMaxDim = TXmax-TXmin;
+  const Standard_Real dy = TYmax-TYmin;
+  const Standard_Real dz = TZmax-TZmin;
+  if (dy > theMaxDim) theMaxDim = dy;
+  if (dz > theMaxDim) theMaxDim = dz;
+}
+
+//=======================================================================
+//function : RelativeEdgeDeflection
+//purpose  : 
+//=======================================================================
+
+Standard_Real BRepMesh_FastDiscret::RelativeEdgeDeflection(const TopoDS_Edge& theEdge,
+                                                                                                  const Standard_Real theDefle,
+                                                                                                    const Standard_Real theDTotale,
+                                                           Standard_Real& theDefCoef)
+{
+  theDefCoef = 1.;
+  Standard_Real defedge = theDefle;
+  if(theEdge.IsNull())
+    return defedge;
+
+  Bnd_Box B;
+  BRepBndLib::Add(theEdge, B);
+  BoxMaxDimension(B, defedge);
+            
+  // adjusted in relation to the total size:
+  theDefCoef = theDTotale/(2*defedge);
+  if (theDefCoef < 0.5) theDefCoef = 0.5;
+  if (theDefCoef > 2.) theDefCoef = 2.;
+  defedge = theDefCoef * defedge * theDefle;
+
+  return defedge;
+}
+
+//=======================================================================
+>>>>>>> .merge-right.r9139
 //function : Perform(shape)
 //purpose  : 
 //=======================================================================
@@ -284,6 +351,7 @@ void BRepMesh_FastDiscret::Add(const TopoDS_Face& theface,
   Handle(NCollection_IncAllocator) anAlloc = Handle(NCollection_IncAllocator)::DownCast(myAllocator);
   anAlloc->Reset(Standard_False);  
   myStructure=new BRepMesh_DataStructureOfDelaun(anAlloc);
+<<<<<<< .working
 
   Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
   BRepTools::UVBounds(theface, aXmin, aXmax, aYmin, aYmax);
@@ -292,6 +360,16 @@ void BRepMesh_FastDiscret::Add(const TopoDS_Face& theface,
   myStructure->Data().SetCellSize ( 14 * aTolU, 14 * aTolV );
   myStructure->Data().SetTolerance( aTolU, aTolV );
 
+=======
+
+  Standard_Real aUmin, aVmin, aUmax, aVmax;
+  BRepTools::UVBounds (theface, aUmin, aUmax, aVmin, aVmax);
+  Standard_Real aTolU = (aUmax - aUmin) * UVDEFLECTION;
+  Standard_Real aTolV = (aVmax - aVmin) * UVDEFLECTION;
+  myStructure->Data().SetCellSize ( 14 * aTolU, 14 * aTolV );
+  myStructure->Data().SetTolerance( aTolU, aTolV );
+
+>>>>>>> .merge-right.r9139
   BRepAdaptor_Surface  BS(face, Standard_False);
   Handle(BRepAdaptor_HSurface) gFace = new BRepAdaptor_HSurface(BS);