[cgma-dev] r5764 - cgm/trunk/geom/OCC
janehu at mcs.anl.gov
janehu at mcs.anl.gov
Wed Oct 3 13:18:24 CDT 2012
Author: janehu
Date: 2012-10-03 13:18:24 -0500 (Wed, 03 Oct 2012)
New Revision: 5764
Modified:
cgm/trunk/geom/OCC/OCCCurve.cpp
cgm/trunk/geom/OCC/OCCCurve.hpp
cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed mcnp2cad/lat4,holes. This is a large test, at some point, the curve's loops failed to update, currently haven't figure out where the failed update takes place. I just added a preventive check, to remove stale pointers before doing actual calls. Passed cgm make check and short mcnp2cad tests. Still testing more. Now there are 40 tests passed and 7 failed.
Modified: cgm/trunk/geom/OCC/OCCCurve.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCurve.cpp 2012-10-02 16:43:17 UTC (rev 5763)
+++ cgm/trunk/geom/OCC/OCCCurve.cpp 2012-10-03 18:18:24 UTC (rev 5764)
@@ -122,6 +122,28 @@
}
}
+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 +777,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++)
{
DLIList<OCCCoEdge*> coedges = myLoopList.get_and_step()->coedges();
Modified: cgm/trunk/geom/OCC/OCCCurve.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCurve.hpp 2012-10-02 16:43:17 UTC (rev 5763)
+++ cgm/trunk/geom/OCC/OCCCurve.hpp 2012-10-03 18:18:24 UTC (rev 5764)
@@ -49,7 +49,7 @@
void set_myMarked( CubitBoolean marked) {myMarked = marked;}
More information about the cgma-dev
mailing list