]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020766: EDF 1320 GEOM: Bad result of GEOM operations
authordmv <dmv@opencascade.com>
Thu, 11 Mar 2010 10:16:20 +0000 (10:16 +0000)
committerdmv <dmv@opencascade.com>
Thu, 11 Mar 2010 10:16:20 +0000 (10:16 +0000)
src/GEOMImpl/GEOMImpl_PipeDriver.cxx

index e35a5119c56c5c5099c8ae8c6dc27c05fd23256c..09042804c60c698fbc7fef641b9b622db6f2f18b 100644 (file)
@@ -51,6 +51,7 @@
 #include <GProp_GProps.hxx>
 #include <BRepGProp.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_Copy.hxx>
 
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
@@ -1964,7 +1965,12 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
   if (aType == PIPE_BASE_PATH)
   {
     Handle(GEOM_Function) aRefBase = aCI->GetBase();
-    TopoDS_Shape aShapeBase = aRefBase->GetValue();
+    TopoDS_Shape aShapeBase;
+
+    // Make copy to prevent modifying of base object 0020766 : EDF 1320
+    BRepBuilderAPI_Copy Copy(aRefBase->GetValue());
+    if( Copy.IsDone() )
+      aShapeBase = Copy.Shape();
 
     if (aShapeBase.IsNull()) {
       if(aCI) delete aCI;
@@ -2002,9 +2008,16 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
       if(aRefBase.IsNull())
         continue;
-      TopoDS_Shape aShapeBase = aRefBase->GetValue();
-      if(aShapeBase.IsNull())
+
+      if(aRefBase->GetValue().IsNull())
         continue;
+
+      // Make copy to prevent modifying of base object 0020766 : EDF 1320
+      TopoDS_Shape aShapeBase;
+      BRepBuilderAPI_Copy Copy(aRefBase->GetValue()));
+      if( Copy.IsDone() )
+        aShapeBase = Copy.Shape();
+
       TopAbs_ShapeEnum aTypeBase = aShapeBase.ShapeType();
 
       //if for section was specified face with a few wires then a few