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

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Thu Oct 14 11:58:41 CDT 2010


Author: janehu
Date: 2010-10-14 11:58:41 -0500 (Thu, 14 Oct 2010)
New Revision: 4220

Modified:
   cgm/trunk/geom/OCC/OCCLump.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
   cgm/trunk/geom/OCC/OCCSurface.cpp
Log:
Fixed bug for mcnp2cad/tests/sample1, to take care of the case when boolean unite operation is start with compounds.

Modified: cgm/trunk/geom/OCC/OCCLump.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCLump.cpp	2010-10-14 13:56:12 UTC (rev 4219)
+++ cgm/trunk/geom/OCC/OCCLump.cpp	2010-10-14 16:58:41 UTC (rev 4220)
@@ -468,7 +468,7 @@
       else if(M2.Extent() > 1)
       {
          shapes.Clear(); 
-         for(int jj = 0; jj < M2.Extent(); jj++) 
+         for(int jj = 1; jj <= M2.Extent(); jj++) 
            shapes.Append(M2(jj));
       }
     }

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2010-10-14 13:56:12 UTC (rev 4219)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2010-10-14 16:58:41 UTC (rev 4220)
@@ -3775,9 +3775,19 @@
        cut_shape.Nullify();
      has_changed = CUBIT_TRUE;
      TopExp_Explorer Ex;
+     int num_solid = 0;
      Ex.Init(*from_shape, TopAbs_SOLID);
-     TopoDS_Solid old_solid = TopoDS::Solid(Ex.Current()); 
-     OCCLump::update_OCC_entity(old_solid , cut_shape, op);
+     TopoDS_Solid old_solid;
+     for(; Ex.More(); Ex.Next())
+     {
+       num_solid ++;
+       old_solid = TopoDS::Solid(Ex.Current());
+     }
+     if(num_solid == 1)
+       OCCLump::update_OCC_entity(old_solid , cut_shape, op);
+     
+     else if(num_solid > 1)
+       OCCBody::update_OCC_entity(*from_shape, cut_shape, op);
    }
    else
    {

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2010-10-14 13:56:12 UTC (rev 4219)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2010-10-14 16:58:41 UTC (rev 4220)
@@ -1922,102 +1922,87 @@
   OCCBody *body = (OCCBody*)NULL;
   if (!OCCMap->IsBound(aShape))
     {
-      TopoDS_Compound *comsolid = new TopoDS_Compound;
-      *comsolid = aShape;


More information about the cgma-dev mailing list