0024990: StepWrite fails on the attached shape
authorika <ika@opencascade.com>
Thu, 10 Jul 2014 10:54:56 +0000 (14:54 +0400)
committerapn <apn@opencascade.com>
Thu, 10 Jul 2014 10:55:27 +0000 (14:55 +0400)
Add check to avoid exception
Test cases for issue CR24990

src/STEPControl/STEPControl_ActorWrite.cxx
tests/bugs/step/bug24990 [new file with mode: 0755]

index e67efaf..8ee57c7 100644 (file)
@@ -831,6 +831,10 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran
     FP->AddFail(start,"The Shape is not a SOLID, nor a SHELL, nor a FACE");
     return binder;
   }
+  else if (theShape.ShapeType() == TopAbs_COMPSOLID) {
+    FP->AddWarning(start, "COMPSOLID is not exported yet"); 
+    return binder;
+  }
   else RepItemSeq->Append (theShape);
 
   //    COMPUTING 3D TOLERANCE
@@ -1424,6 +1428,8 @@ Handle(Transfer_Binder)  STEPControl_ActorWrite::TransferSubShape (const Handle(
     FP->Bind (mapper,resbind);
     resprod=resbind; //KA - OCC7141(skl 10.11.2004)
   }
+  if (resprod.IsNull())
+    return resprod;
 
   // A new resbind may have been produced
 //  DeclareAndCast(Transfer_SimpleBinderOfTransient,restrans,resbind);
diff --git a/tests/bugs/step/bug24990 b/tests/bugs/step/bug24990
new file mode 100755 (executable)
index 0000000..449c583
--- /dev/null
@@ -0,0 +1,11 @@
+puts "============"
+puts "OCC24990"
+puts "============"
+puts ""
+#######################################################################
+# StepWrite fails on the attached shape
+#######################################################################
+
+restore [locate_data_file bug24990_StepWrite_Exception.brep] a 
+
+stepwrite m a