[cgma-dev] r5765 - cgm/branches/merge-cubit13.1/geom/OCC

janehu at mcs.anl.gov janehu at mcs.anl.gov
Thu Oct 4 11:01:47 CDT 2012


Author: janehu
Date: 2012-10-04 11:01:47 -0500 (Thu, 04 Oct 2012)
New Revision: 5765

Modified:
   cgm/branches/merge-cubit13.1/geom/OCC/OCCCurve.cpp
   cgm/branches/merge-cubit13.1/geom/OCC/OCCCurve.hpp
   cgm/branches/merge-cubit13.1/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed lat4,holes problem by adding preventive check for curve's looplist, and remove stale pointers. Passed make check in related directories in cgm. cgm_apps/examples/facetdriver didn't build successfully.

Modified: cgm/branches/merge-cubit13.1/geom/OCC/OCCCurve.cpp
===================================================================
--- cgm/branches/merge-cubit13.1/geom/OCC/OCCCurve.cpp	2012-10-03 18:18:24 UTC (rev 5764)
+++ cgm/branches/merge-cubit13.1/geom/OCC/OCCCurve.cpp	2012-10-04 16:01:47 UTC (rev 5765)
@@ -122,6 +122,37 @@
   }
 }
 
+//-------------------------------------------------------------------------
+// Purpose       : Add and update looplist for the curve, if input loop is 
+//                 NULL, just update the looplist.
+// Special Notes :
+//
+// Creator       : Jane Hu
+//
+// Creation Date : 10/04/12
+//-------------------------------------------------------------------------
+void OCCCurve::add_loop(OCCLoop* loop) 
+{ 
+  //before add the loop into the looplist, check to make sure the 
+  //looplist is up-to-date
+  //It should be done somewhere else, however, in large mcnp2cad test, there's
+  //no way to check where the code forget to remove the out-dated loop.
+  for (int i = 0; i < myLoopList.size(); i++)
+  {
+    OCCLoop* myLoop = CAST_TO(myLoopList.get(), OCCLoop);
+
+    if(!myLoop) 
+      this->remove_loop(myLoopList.get());
+    else if(myLoop->get_TopoDS_Wire() < (void*) 0x1000)
+      this->remove_loop(myLoop);
+    else if(myLoop->coedges().size() == 0)
+      this->remove_loop(myLoop);
+    myLoopList.step();
+  }
+  if(loop != NULL)
+    myLoopList.append_unique(loop);
+}
+
 void OCCCurve::set_TopoDS_Edge(TopoDS_Edge edge)
 {
   if(myTopoDSEdge && edge.IsEqual(*myTopoDSEdge))
@@ -755,6 +786,9 @@
 
 void OCCCurve::get_parents_virt( DLIList<TopologyBridge*>& parents ) 
 { 
+   //check to see all myLoops are up-to-date.
+   add_loop(NULL);
+
    for(int i = 0; i < myLoopList.size(); i++) 
    {


More information about the cgma-dev mailing list