[cgma-dev] r4201 - cgm/trunk/geom/OCC

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Thu Oct 7 10:43:20 CDT 2010


Author: janehu
Date: 2010-10-07 10:43:19 -0500 (Thu, 07 Oct 2010)
New Revision: 4201

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
Fixed mcnp2cad/INP-rec test case.

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2010-10-06 23:00:40 UTC (rev 4200)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2010-10-07 15:43:19 UTC (rev 4201)
@@ -2518,33 +2518,45 @@
 		{
 		  TopoDS_Compound old_csolid = TopoDS::Compound(*from_shape);
 		  OCCBody::update_OCC_entity(old_csolid, new_from_shape, &splitor);
-		  from_shape->Nullify();
-		  delete from_shape;
-		  from_shape = new TopoDS_Shape(new_from_shape);
+                  if(!from_shape->IsNull())
+                  {
+		    from_shape->Nullify();
+		    delete from_shape;
+                  }
+                  from_shape = new TopoDS_Shape(new_from_shape);
 		}
 
 	      else if(from_shape->TShape()->ShapeType() == TopAbs_SOLID)
 		{
 		  TopoDS_Solid old_solid = TopoDS::Solid(*from_shape);
 		  OCCLump::update_OCC_entity(old_solid, new_from_shape, &splitor);
-		  from_shape->Nullify();
-		  delete from_shape;
+                  if(!from_shape->IsNull())
+                  {
+                    from_shape->Nullify();
+                    delete from_shape;
+                  }
 		  from_shape = new TopoDS_Shape(new_from_shape);
 		}
 	      else if(from_shape->TShape()->ShapeType() == TopAbs_SHELL)
 		{
 		  TopoDS_Shell old_shell = TopoDS::Shell(*from_shape);
 		  OCCShell::update_OCC_entity(old_shell,new_from_shape, &splitor);
-		  from_shape->Nullify();
-		  delete from_shape;
+                  if(!from_shape->IsNull())
+                  {
+                    from_shape->Nullify();
+                    delete from_shape;
+                  }
 		  from_shape = new TopoDS_Shape(new_from_shape);
 		}
 	      else if(from_shape->TShape()->ShapeType() == TopAbs_FACE)
 		{
 		  TopoDS_Face old_face = TopoDS::Face(*from_shape);
 		  OCCSurface::update_OCC_entity(old_face,new_from_shape, &splitor);
-		  from_shape->Nullify();
-		  delete from_shape;


More information about the cgma-dev mailing list