[cgma-dev] r1914 - in cgm/trunk/geom: . ACIS_SRC OCC facet

janehu at mcs.anl.gov janehu at mcs.anl.gov
Thu Jun 19 12:33:04 CDT 2008


Author: janehu
Date: 2008-06-19 12:33:03 -0500 (Thu, 19 Jun 2008)
New Revision: 1914

Modified:
   cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp
   cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.hpp
   cgm/trunk/geom/GeometryModifyEngine.hpp
   cgm/trunk/geom/GeometryModifyTool.cpp
   cgm/trunk/geom/GeometryModifyTool.hpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.hpp
   cgm/trunk/geom/facet/FacetModifyEngine.cpp
   cgm/trunk/geom/facet/FacetModifyEngine.hpp
Log:
OCC has a different method of making thick solids, namingly, by hollowing an existing solid. So added an argument on 'thicken' method as a virtual function for all engines.

Modified: cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.cpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -5941,6 +5941,7 @@
   return CUBIT_FAILURE;
 #else
   CubitStatus AcisModifyEngine::thicken( DLIList<BodySM*>& bodies,
+                                         DLIList<Surface*>& surfs_to_remove,
 					 DLIList<BodySM*>& new_body_list,
 					 double depth,
 					 bool both) const

Modified: cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.hpp
===================================================================
--- cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.hpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/ACIS_SRC/AcisModifyEngine.hpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -382,11 +382,13 @@
 
 
  virtual CubitStatus thicken( DLIList<BodySM*>& bodies, 
+                              DLIList<Surface*>& surfs_to_remove, 
                               DLIList<BodySM*>& new_bodies,
                               double depth, 
                               bool both = false) const;
 
     //- Thicken a sheet body into a solid
+    //- surfs_to_remove is a dummy input
     //R CubitStatus
     //R-the result of the thicken operation: Success or Failure
 

Modified: cgm/trunk/geom/GeometryModifyEngine.hpp
===================================================================
--- cgm/trunk/geom/GeometryModifyEngine.hpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/GeometryModifyEngine.hpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -412,6 +412,7 @@
 	  
 
       virtual CubitStatus thicken( DLIList<BodySM*>& bodies, 
+                                   DLIList<Surface*>& surfs_to_remove,
                                    DLIList<BodySM*>& new_body_list,
                                    double depth,
                                    bool both = false) const = 0;
@@ -419,7 +420,9 @@
     //R-the result of the thicken operation: Success or Failure
     //I bodies
     //I-DLIList<Body*>: a list of Body pointers that will be thicken
-    //O intersectBody, outsideBody, leftoversBody
+    //I- or for OCC: a list of solid BodySM's that will be hollowed into a 
+    //I- thick solid. 
+    //I- surfs_to_remove: the faces to be removed from the original solid (OCC).
     //O- new Bodies build by thicken operation on the list of  Body pointers.
     //- This function performs a thicken of sheet bodies and returns 
     //- the result through the output argument in_out_body. If the thicken

Modified: cgm/trunk/geom/GeometryModifyTool.cpp
===================================================================
--- cgm/trunk/geom/GeometryModifyTool.cpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/GeometryModifyTool.cpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -4155,10 +4155,12 @@
   return CUBIT_SUCCESS;
 }
 
-CubitStatus GeometryModifyTool::thicken( DLIList<Body*>& bodies,
-                                         DLIList<Body*>& new_bodies,
-                                         double depth,
-                                         bool both )
+CubitStatus GeometryModifyTool::
+        make_thick_solid( DLIList<Body*>& bodies,
+                          DLIList<RefFace*>& faces_to_remove,
+                          DLIList<Body*>& new_bodies,
+                          double depth,
+                          bool both )
 {
   if (bodies.size() <= 0)
   {
@@ -4186,10 +4188,24 @@
      return CUBIT_FAILURE;
   }
 
+  DLIList<Surface*> surfs_to_remove;
+  if(faces_to_remove.size() > 0)
+  {
+    GeometryModifyEngine* gme2 = common_modify_engine(faces_to_remove,
+						      surfs_to_remove);
+    if(gme2 != gme)
+    {
+       PRINT_ERROR("Performing THICKEN with volumes containing geometry\n"
+                   " from different modeling engines is not allowed.\n"
+                   "Delete uncommon geometry on these volumes before operation.\n\n");
+       return CUBIT_FAILURE;
+    }
+  }  
   DLIList<BodySM*> new_sms(count);
   DLIList<BodySM*> body_sms(count);
   CAST_LIST(bridge_list, body_sms, BodySM);
-  CubitStatus result = gme->thicken( body_sms, new_sms, depth, both);
+  
+  CubitStatus result = gme->thicken( body_sms, surfs_to_remove, new_sms, depth, both);
 
   // check for resued entities, they have been moved and we need to notify observers
   DLIList<RefEntity*> entities_to_update;

Modified: cgm/trunk/geom/GeometryModifyTool.hpp
===================================================================
--- cgm/trunk/geom/GeometryModifyTool.hpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/GeometryModifyTool.hpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -225,7 +225,8 @@
                     bool keep_old = false,
                     bool nonreg = false );
 
-  CubitStatus thicken( DLIList<Body*>& bodies,
+  CubitStatus make_thick_solid( DLIList<Body*>& bodies,
+                       DLIList<RefFace*>& faces_to_remove,
                        DLIList<Body*>& new_bodies,
                        double depth,
                        bool both = false );

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -3550,43 +3550,9 @@
     check_operation(new_shape, first_shape, first_is_volume, has_changed, &fuser);
  
     check_operation(new_shape,second_shape, is_volume[i], has_changed, &fuser);
-/*
-    BodySM* second_body = bodies.get_and_step();
-    if(second_body)
-    {
-      deleted_body = CAST_TO(second_body, OCCBody);
-      //delete the second body, keep lower entities.
-      DLIList<Lump*> lumps = deleted_body->lumps();
-      OCCQueryEngine::instance()->delete_solid_model_entities(lumps.get(),
-                                                              CUBIT_FALSE);
-      second_body = NULL;
-    }
-
-    TopExp_Explorer Ex;
-    TopTools_ListOfShape shapes; 
-    for (Ex.Init(*second_shape, TopAbs_FACE);Ex.More(); Ex.Next())
-    {
-      TopoDS_Face face =  TopoDS::Face(Ex.Current());
-      TopoDS_Shape nullshape;
-      if(fuser.IsDeleted(face))
-        OCCSurface::update_OCC_entity(face,nullshape, &fuser);
-      else
-      {
-        shapes.Assign(fuser.Modified(face));
-        if(shapes.Extent() > 1)
-        {
-           restore_first_shape = CUBIT_TRUE;
-           PRINT_WARNING("The unite boolean didn't work in opencascade.\n");
-           break;
-        }
-        else if(shapes.Extent() == 1)
-          OCCSurface::update_OCC_entity(face, shapes.First(), &fuser);
-      }
-    }
-*/
   }      
 
-  //ok, we're done wih all unites, construct new Body'
+  //ok, we're done with all unites, construct new Body'
   DLIList<TopologyBridge*> tbs;
   tbs += OCCQueryEngine::instance()->populate_topology_bridge(*first_shape);
 
@@ -3622,6 +3588,7 @@
 // Date       : 10/02
 //===============================================================================
 CubitStatus OCCModifyEngine::thicken(DLIList<BodySM*>& /*bodies*/, 
+                                     DLIList<Surface*>& surfs_to_remove,
                                        DLIList<BodySM*>& /*new_bodies*/,
                                        double /*depth*/,
                                        bool /*both*/) const

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.hpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.hpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -201,6 +201,7 @@
     bool keep_old = CUBIT_FALSE) const;
   
   virtual CubitStatus thicken(DLIList<BodySM*>& bodies, 
+                              DLIList<Surface*>& surfs_to_remove,
     DLIList<BodySM*>& new_bodies,
     double depth,
     bool both = CUBIT_FALSE) const ;

Modified: cgm/trunk/geom/facet/FacetModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/facet/FacetModifyEngine.cpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/facet/FacetModifyEngine.cpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -1745,6 +1745,7 @@
 // Date       : 10/02
 //===============================================================================
 CubitStatus FacetModifyEngine::thicken(DLIList<BodySM*>& /*bodies*/, 
+                                       DLIList<Surface*> & /*surfs*/,
                                        DLIList<BodySM*>& /*new_bodies*/,
                                        double /*depth*/,
                                        bool /*both*/) const

Modified: cgm/trunk/geom/facet/FacetModifyEngine.hpp
===================================================================
--- cgm/trunk/geom/facet/FacetModifyEngine.hpp	2008-06-19 01:46:26 UTC (rev 1913)
+++ cgm/trunk/geom/facet/FacetModifyEngine.hpp	2008-06-19 17:33:03 UTC (rev 1914)
@@ -216,6 +216,7 @@
     bool keep_old = CUBIT_FALSE) const;
   
   virtual CubitStatus thicken(DLIList<BodySM*>& bodies, 
+                              DLIList<Surface*>& surfs_to_remove,
     DLIList<BodySM*>& new_bodies,
     double depth,
     bool both = CUBIT_FALSE) const ;




More information about the cgma-dev mailing list