]> OCCT Git - occt-copy.git/commitdiff
0025938: BRepBuilderAPI_Transform is not thread safe
authormsv <msv@opencascade.com>
Fri, 10 Apr 2015 12:43:21 +0000 (15:43 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 16 Apr 2015 07:29:09 +0000 (10:29 +0300)
ModifiedShape() method is made returning shape by value, not by reference.

src/BRepBuilderAPI/BRepBuilderAPI_GTransform.cdl
src/BRepBuilderAPI/BRepBuilderAPI_GTransform.cxx
src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cdl
src/BRepBuilderAPI/BRepBuilderAPI_ModifyShape.cxx
src/BRepBuilderAPI/BRepBuilderAPI_Transform.cdl
src/BRepBuilderAPI/BRepBuilderAPI_Transform.cxx
src/QABugs/QABugs_19.cxx
src/TNaming/TNaming.cxx

index bf4e94033ea6d9cf8dca0f8d6494f9ca4069a9c5..8dc08b02de745164cacf1914e99e741c2d580258 100644 (file)
@@ -110,16 +110,13 @@ is
     returns ListOfShape from TopTools
     is redefined virtual;
 
--- Modified by Sergey KHROMOV - Thu Mar 27 17:43:59 2003 Begin
     ModifiedShape(me; S: Shape from TopoDS)
        returns Shape from TopoDS
        ---Purpose: Returns the modified shape corresponding to <S>.
-       ---C++: return const&
        raises NoSuchObject from Standard
                -- if S is not the initial shape or a sub-shape
                -- of the initial shape.
     is redefined virtual;
--- Modified by Sergey KHROMOV - Thu Mar 27 17:44:02 2003 End
 
 fields
 
index 712a5325c67fe9b7ab5961fca350f23147d2f201..8129e48b215c09e4f48f3a6210e1e86aaf7c2e95 100644 (file)
@@ -98,7 +98,7 @@ const TopTools_ListOfShape& BRepBuilderAPI_GTransform::Modified
 //purpose  : 
 //=======================================================================
 
-const TopoDS_Shape& BRepBuilderAPI_GTransform::ModifiedShape
+TopoDS_Shape BRepBuilderAPI_GTransform::ModifiedShape
   (const TopoDS_Shape& S) const
 {
   const TopTools_DataMapOfShapeListOfShape &aMapModif = myHist.Modification();
index 89f6ddb7e319f2a87a0d05770688d8b10419b3d2..9fd3ebfe896278fed0b102fcd3fcbb965cb413ff 100644 (file)
@@ -122,7 +122,6 @@ is
        -- transformation has been applied. Raises NoSuchObject from Standard
        -- if S is not the initial shape or a sub-shape
        -- of the initial shape.
-       ---C++: return const&
        raises NoSuchObject from Standard
              
     is virtual;
index 8129b2f084a422c9b53ba07b84b5123209fc83b5..0c659b09184b0127b9c61c7de72509500c3a9d2c 100644 (file)
@@ -131,7 +131,7 @@ void BRepBuilderAPI_ModifyShape::DoModif (const TopoDS_Shape& S,
 //purpose  : 
 //=======================================================================
 
-const TopoDS_Shape& BRepBuilderAPI_ModifyShape::ModifiedShape
+TopoDS_Shape BRepBuilderAPI_ModifyShape::ModifiedShape
   (const TopoDS_Shape& S) const
 {
   return myModifier.ModifiedShape(S);
index de56765e4836f1663f5bfba17bf26b10713d04a5..09e953245edb3136cb412762e9f293f1da3840f4 100644 (file)
@@ -82,7 +82,6 @@ is
     ModifiedShape(me; S: Shape from TopoDS)
        returns Shape from TopoDS
        ---Purpose: Returns the modified shape corresponding to <S>.
-       ---C++: return const&
        raises NoSuchObject from Standard
                -- if S is not the initial shape or a sub-shape
                -- of the initial shape.
index 6dcfa5d073e0eaf077a85eeed35291841f320dc5..be66456add229d38c99051443f8f962db2db8ad7 100644 (file)
@@ -79,15 +79,13 @@ void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& S,
 //purpose  : 
 //=======================================================================
 
-const TopoDS_Shape& BRepBuilderAPI_Transform::ModifiedShape
+TopoDS_Shape BRepBuilderAPI_Transform::ModifiedShape
   (const TopoDS_Shape& S) const
 {  
   if (myUseModif) {
     return myModifier.ModifiedShape(S);
   }
-  static TopoDS_Shape SM;
-  SM = S.Moved (myLocation);
-  return SM;
+  return S.Moved (myLocation);
 }
 
 
index ad9b45d0031c6d49f5115a21d2cd20418110dc91..0ffdf446d158cdf63c0b40c9e0455dde497e8b36 100755 (executable)
@@ -311,7 +311,7 @@ static Standard_Boolean OCC23774Test(const TopoDS_Face& grossPlateFace, const To
     di << "Not Done1 " << "\n";
     return Standard_False;
   }
-  const TopoDS_Shape& step1ModifiedShape = transformer1.ModifiedShape(originalWire);
+  TopoDS_Shape step1ModifiedShape = transformer1.ModifiedShape(originalWire);
   
   BRepExtrema_DistShapeShape distShapeShape1(grossPlateFace,step1ModifiedShape,Extrema_ExtFlag_MIN);
   if(!distShapeShape1.IsDone())
@@ -329,7 +329,7 @@ static Standard_Boolean OCC23774Test(const TopoDS_Face& grossPlateFace, const To
     di << "Not Done1 \n";
     return Standard_False;
   }
-  const TopoDS_Shape& step2ModifiedShape = transformer1.ModifiedShape(step1ModifiedShape);
+  TopoDS_Shape step2ModifiedShape = transformer1.ModifiedShape(step1ModifiedShape);
 
   //This is identity matrix for values but for type is gp_Rotation ?!
   gp_Trsf2d mirror11 = mirror1;
index 685a606bc4b55af78ea40d9b46ee1522e94ee0f9..baf66c688f6f8b14cb77d66c6012794b97236d1a 100644 (file)
@@ -524,7 +524,7 @@ void TNaming::Replicate (const TopoDS_Shape& SH,
   TNaming_Builder Builder2 (L.FindChild(1,Standard_True)); 
   for (TopExp_Explorer exp(SH, SST); exp.More(); exp.Next()) {
     const TopoDS_Shape& oldSubShape = exp.Current();
-    const TopoDS_Shape& newSubShape = opeTrsf.ModifiedShape(oldSubShape);
+    TopoDS_Shape newSubShape = opeTrsf.ModifiedShape(oldSubShape);
     Builder2.Generated(oldSubShape, newSubShape);
   }
 }