[cgma-dev] r2480 - cgm/trunk/geom/OCC
janehu at mcs.anl.gov
janehu at mcs.anl.gov
Wed Dec 10 18:55:42 CST 2008
Author: janehu
Date: 2008-12-10 18:55:42 -0600 (Wed, 10 Dec 2008)
New Revision: 2480
Modified:
cgm/trunk/geom/OCC/OCCLoop.cpp
cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Trying to fix r_w test for 32-bit build.
Modified: cgm/trunk/geom/OCC/OCCLoop.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCLoop.cpp 2008-12-10 17:19:19 UTC (rev 2479)
+++ cgm/trunk/geom/OCC/OCCLoop.cpp 2008-12-11 00:55:42 UTC (rev 2480)
@@ -67,7 +67,18 @@
void OCCLoop::set_TopoDS_Wire(TopoDS_Wire loop)
{
+ if(loop.IsEqual(*myTopoDSWire))
+ return;
TopoDS_Wire* the_wire = new TopoDS_Wire(loop);
+ DLIList<OCCCoEdge *> coedges = this->coedges();
+ for(int i = 0; i < coedges.size(); i++)
+ {
+ OCCCoEdge *coedge = coedges.get_and_step();
+ Curve* curve = coedge->curve();
+ CAST_TO(curve, OCCCurve)->remove_loop(this);
+ this->remove_coedge(coedge);
+ delete coedge;
+ }
if(myTopoDSWire)
delete myTopoDSWire;
myTopoDSWire = the_wire;
Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp 2008-12-10 17:19:19 UTC (rev 2479)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp 2008-12-11 00:55:42 UTC (rev 2480)
@@ -1210,6 +1210,8 @@
BodySM* OCCQueryEngine::populate_topology_bridge(const TopoDS_CompSolid& aShape)
{
+ if(aShape.IsNull())
+ return (BodySM*)NULL;
OCCBody *body;
if (!OCCMap->IsBound(aShape))
{
@@ -1245,6 +1247,8 @@
Lump* OCCQueryEngine::populate_topology_bridge(const TopoDS_Solid& aShape,
CubitBoolean build_body)
{
+ if(aShape.IsNull())
+ return (Lump*)NULL;
//one OCCBody corresponds one OCCLump
OCCLump *lump;
OCCBody *body;
@@ -1289,6 +1293,8 @@
OCCShell* OCCQueryEngine::populate_topology_bridge(const TopoDS_Shell& aShape,
CubitBoolean standalone)
{
+ if(aShape.IsNull())
+ return (OCCShell*)NULL;
OCCShell *shell ;
CubitBoolean build_body = CUBIT_FALSE;
DLIList<OCCCoFace*> cofaces_old, cofaces_new;
@@ -1369,6 +1375,8 @@
Surface* OCCQueryEngine::populate_topology_bridge(const TopoDS_Face& aShape,
CubitBoolean build_body)
{
+ if(aShape.IsNull())
+ return (Surface*)NULL;
OCCSurface *surface = NULL;
GProp_GProps myProps;
BRepGProp::SurfaceProperties(aShape, myProps);
@@ -1423,6 +1431,8 @@
OCCLoop* OCCQueryEngine::populate_topology_bridge(const TopoDS_Wire& aShape,
CubitBoolean standalone)
{
+ if(aShape.IsNull())
+ return (OCCLoop*)NULL;
OCCLoop *loop ;
if (!OCCMap->IsBound(aShape))
{
@@ -1479,21 +1489,21 @@
//search through the curve loops
for(int i = 0; i < loops.size() ; i++)
{
- OCCLoop* loop = loops.get_and_step();
- if (!OCCMap->IsBound(*loop->get_TopoDS_Wire()))
+ OCCLoop* occ_loop = loops.get_and_step();
+ if (!OCCMap->IsBound(*occ_loop->get_TopoDS_Wire()))
{
- DLIList<OCCCoEdge*> coedge_list = loop->coedges();
+ DLIList<OCCCoEdge*> coedge_list = occ_loop->coedges();
for(int j = 0; j < coedge_list.size(); j++)
{
OCCCoEdge * test_coedge = coedge_list.get_and_step();
if (test_coedge->curve() == curve)
{
- loop->remove_coedge(test_coedge);
- occ_curve->remove_loop(loop);
+ occ_loop->remove_coedge(test_coedge);
+ occ_curve->remove_loop(occ_loop);
delete test_coedge;
}
}
- delete loop;
+ delete occ_loop;
}
}
//for the cylinder side face, there are 4 coedges, 2 of them are seam
@@ -1509,6 +1519,8 @@
break;
}
}
+
+ assert(occ_curve->loops().size() <2);
coedge = new OCCCoEdge( curve, loop, sense);
coedges_new.append(coedge);
occ_curve->add_loop(loop);
@@ -1532,6 +1544,8 @@
Curve* OCCQueryEngine::populate_topology_bridge(const TopoDS_Edge& aShape)
{
+ if(aShape.IsNull())
+ return (Curve*)NULL;
Curve *curve;
GProp_GProps myProps;
BRepGProp::LinearProperties(aShape, myProps);
@@ -1567,6 +1581,8 @@
Point* OCCQueryEngine::populate_topology_bridge(const TopoDS_Vertex& aShape)
{
+ if(aShape.IsNull())
+ return (Point*)NULL;
OCCPoint *point;
if (iTotalTBCreated == 0 || !OCCMap->IsBound(aShape))
{
More information about the cgma-dev
mailing list