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

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Thu Sep 15 11:49:01 CDT 2011


Author: janehu
Date: 2011-09-15 11:49:01 -0500 (Thu, 15 Sep 2011)
New Revision: 5162

Modified:
   cgm/trunk/geom/OCC/OCCAttribSet.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed testcase failure for testgeom_occ, modify and operation for trunk cgm on occ6.3.

Modified: cgm/trunk/geom/OCC/OCCAttribSet.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCAttribSet.cpp	2011-09-15 15:16:30 UTC (rev 5161)
+++ cgm/trunk/geom/OCC/OCCAttribSet.cpp	2011-09-15 16:49:01 UTC (rev 5162)
@@ -64,6 +64,9 @@
 
 void OCCAttribSet::append_attribute( CubitSimpleAttrib* csa, TopoDS_Shape& shape )
 {
+  if(shape.IsNull())
+    return;
+
   //Add attributes on child of myLabel
   //1. add shape attribute, first check to make sure there's no shape attribute
   CubitBoolean found = CUBIT_FALSE;

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2011-09-15 15:16:30 UTC (rev 5161)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2011-09-15 16:49:01 UTC (rev 5162)
@@ -1869,6 +1869,9 @@
                                       int &current_id /*Out*/)
 {
   //add the shape into map
+  if(sh.IsNull())
+    return;
+
   if(!OCCMap->IsBound(sh) ||
      OccToCGM->find(OCCMap->Find(sh)) == OccToCGM->end())
   {
@@ -3785,7 +3788,10 @@
   if(it_lab != Shape_Label_Map->end())
   {
      TDF_Label aLabel = (*it_lab).second;
-     Handle_TDataXtd_Shape attr_shape = TDataXtd_Shape::Set(aLabel, new_shape);
+     if (!new_shape.IsNull())
+       Handle_TDataXtd_Shape attr_shape = TDataXtd_Shape::Set(aLabel, new_shape);
+     else
+       Shape_Label_Map->erase(it_lab);
   }
 
   //update CGM-OCC map












More information about the cgma-dev mailing list