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

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Wed Oct 26 12:39:44 CDT 2011


Author: janehu
Date: 2011-10-26 12:39:44 -0500 (Wed, 26 Oct 2011)
New Revision: 5201

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.hpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed mcnp2cad/tests/transform6 case, where two cylinders cross intersect each other and imprint code can't figure out the intersection loops. In this case, have to use boolean cut, common then unite operation, taking the advantage of unite keeps imprints property in OCC engine.

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2011-10-26 17:36:49 UTC (rev 5200)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2011-10-26 17:39:44 UTC (rev 5201)
@@ -2025,8 +2025,6 @@
     delete tool_boxes;
   while (tool_bodies_copy.size())
     delete tool_bodies_copy.pop();
-  if(!keep_old) //delete tool_bodies
-    OCCQueryEngine::instance()->delete_solid_model_entities(tool_body_list);
   return stat;
 }
 
@@ -2112,15 +2110,16 @@
       CubitBoolean has_changed;
       check_operation(cut_shape, from_shape, is_volume[i], has_changed, &cutter, keep_old);
 
-      CubitStatus stat;
+      int stat;
       if(!has_changed && !from_shape->IsNull())
       {
         stat = CUBIT_FAILURE;
         //Add imprint code here 
+        DLIList<TopoDS_Face*> face_list;
         if(imprint)
         {
-          stat = imprint_toposhapes(from_shape, tool_shape);
-          if(!stat)
+          stat = imprint_toposhapes(from_shape, tool_shape, face_list);
+          if(stat)
           {
             PRINT_ERROR("Can't do imprint operation on the body. \n");
             count++;
@@ -2183,18 +2182,20 @@
 //              TopoDS_Edge or above. 
 //              on_faces works only when tool_shape is an Edge, indicates that
 //              those edges only imprint on the on_faces.
+//              success return 0
+//              cylinder return 1
+//              fail     return 2
 // Author     : Jane HU
 // Date       : 03/08
 //===============================================================================
-CubitStatus OCCModifyEngine::imprint_toposhapes(TopoDS_Shape*& from_shape, 
+int OCCModifyEngine::imprint_toposhapes(TopoDS_Shape*& from_shape, 
                                              TopoDS_Shape* tool_shape,
-                                             DLIList<TopoDS_Face*>*on_faces)const
+                                             DLIList<TopoDS_Face*>&on_faces)const
 {
   int count = 0;   //number of imprinting
  


More information about the cgma-dev mailing list