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

janehu at mcs.anl.gov janehu at mcs.anl.gov
Tue Feb 19 12:38:04 CST 2008


Author: janehu
Date: 2008-02-19 12:38:03 -0600 (Tue, 19 Feb 2008)
New Revision: 1601

Modified:
   cgm/trunk/geom/OCC/OCCBody.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
   cgm/trunk/geom/OCC/OCCShell.hpp
   cgm/trunk/geom/OCC/OCCSurface.cpp
Log:
Changed make_Surface to create topologically and geometrically identical surfaces, passed test.

Modified: cgm/trunk/geom/OCC/OCCBody.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.cpp	2008-02-18 22:41:20 UTC (rev 1600)
+++ cgm/trunk/geom/OCC/OCCBody.cpp	2008-02-19 18:38:03 UTC (rev 1601)
@@ -155,7 +155,7 @@
   {
     TopoDS_Face * face = mySheetSurface->get_TopoDS_Face();
     aBRepTrsf.Perform(*face);
-    OCCQueryEngine::update_entity_shape((GeometryEntity*)mySheetSurface, aBRepTrsf);
+    OCCQueryEngine::instance()->update_entity_shape(mySheetSurface, aBRepTrsf);
   }
   else
   {
@@ -192,7 +192,7 @@
   {
     TopoDS_Face * face = mySheetSurface->get_TopoDS_Face();
     aBRepTrsf.Perform(*face);
-    OCCQueryEngine::update_entity_shape(mySheetSurface, aBRepTrsf);
+    OCCQueryEngine::instance()->update_entity_shape(mySheetSurface, aBRepTrsf);
   }
   else
   {
@@ -223,7 +223,7 @@
   {
     TopoDS_Face * face = mySheetSurface->get_TopoDS_Face();
     aBRepTrsf.Perform(*face);
-    OCCQueryEngine::update_entity_shape(mySheetSurface, aBRepTrsf);
+    OCCQueryEngine::instance()->update_entity_shape(mySheetSurface, aBRepTrsf);
   }
   else
   {
@@ -274,7 +274,7 @@
   {
     TopoDS_Face * face = mySheetSurface->get_TopoDS_Face();
     aBRepTrsf.Perform(*face);
-    OCCQueryEngine::update_entity_shape(mySheetSurface, aBRepTrsf);
+    OCCQueryEngine::instance()->update_entity_shape(mySheetSurface, aBRepTrsf);
   }
   else
   {

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-02-18 22:41:20 UTC (rev 1600)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-02-19 18:38:03 UTC (rev 1601)
@@ -523,22 +523,6 @@
      return (Surface *)NULL;
   }
 
-  //Testing for number of Vertices.
-  DLIList<OCCCurve*> curve_list;
-  DLIList<OCCPoint*> point_list;
-  occ_surface->get_curves(curve_list);
-  for (int i = 0; i < curve_list.size(); i++)
-  {
-    curve_list.get_and_step()->get_points(point_list);
-    point_list.uniquify_unordered();
-  }
-
-  TopoDS_Face * Face = occ_surface->get_TopoDS_Face();
-  TopExp_Explorer Ex;
-  int count = 0;
-  for (Ex.Init(*Face, TopAbs_VERTEX); Ex.More(); Ex.Next())
-    count++;
-
   //Start of the codes
   double UMax, VMax, UMin, VMin;
   occ_surface->get_param_range_U(UMin, UMax);
@@ -641,36 +625,6 @@
   Surface *surface = OCCQueryEngine::instance()->populate_topology_bridge(
                                newFace, CUBIT_TRUE);
 
-/*
-  //get new parameters
-  asurface.Initialize(newFace);
-  U1 = asurface.FirstUParameter();
-  U2 = asurface.LastUParameter();
-  V1 = asurface.FirstVParameter();
-  V2 = asurface.LastVParameter();
-
-  //populate the bridges from the body
-  Handle_Geom_Surface HGeom_surface = BRep_Tool::Surface(newFace);
-
-  TopoDS_Shell topo_shell; 
-  topo_shell = BRepBuilderAPI_MakeShell(HGeom_surface, U1, U2, V1, V2);
- 
-  TopoDS_Solid topo_solid = BRepBuilderAPI_MakeSolid(topo_shell);
-  Lump *lump = 
-         OCCQueryEngine::instance()->populate_topology_bridge(topo_solid,
-                                                              CUBIT_TRUE);
-
-  if (lump == NULL)
-  {
-    PRINT_ERROR("In AcisModifyEngine::make_Surface\n"
-                "       Cannot make Surface object.\n");
-    return (Surface *)NULL;
-  }
-
-  DLIList<Surface*> surfs;
-  lump->surfaces( surfs );
-  Surface *surface = surfs.get();
-*/
   return surface;
 }
 

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2008-02-18 22:41:20 UTC (rev 1600)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2008-02-19 18:38:03 UTC (rev 1601)
@@ -1199,9 +1199,9 @@
 
       if(build_body)
       {
-        OCCShell* shell(NULL, surface);
-        OCCLump* lump(NULL, surface);
-        OCCBody* body(NULL, CUBIT_TRUE, surface);
+        OCCShell* shell = new OCCShell(NULL, surface);
+        OCCLump* lump = new OCCLump(NULL, surface);
+        OCCBody* body = new OCCBody(NULL, CUBIT_TRUE, surface);
         surface->set_body(body);
         surface->set_lump(lump);
         surface->set_shell(shell);

Modified: cgm/trunk/geom/OCC/OCCShell.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCShell.hpp	2008-02-18 22:41:20 UTC (rev 1600)
+++ cgm/trunk/geom/OCC/OCCShell.hpp	2008-02-19 18:38:03 UTC (rev 1601)
@@ -42,7 +42,7 @@
 {
 public:
   
-  OCCShell(TopoDS_Shell *theShell, OCCSurface surface = NULL);
+  OCCShell(TopoDS_Shell *theShell, OCCSurface* surface = NULL);
 
   virtual ~OCCShell() ;
     //- Destructor.

Modified: cgm/trunk/geom/OCC/OCCSurface.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCSurface.cpp	2008-02-18 22:41:20 UTC (rev 1600)
+++ cgm/trunk/geom/OCC/OCCSurface.cpp	2008-02-19 18:38:03 UTC (rev 1601)
@@ -669,6 +669,12 @@
 
 void OCCSurface::get_parents_virt( DLIList<TopologyBridge*>& parents )
 { 
+  if (myBody) //sheet body
+  {
+     parents.append(myBody);
+     return;
+  }
+
   OCCQueryEngine* oqe = (OCCQueryEngine*) get_geometry_query_engine();
   OCCBody * body = NULL;
   DLIList <OCCBody* > *bodies = oqe->BodyList;




More information about the cgma-dev mailing list