[cgma-dev] r4190 - in cgm/trunk: geom/OCC test

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Mon Oct 4 09:47:41 CDT 2010


Author: janehu
Date: 2010-10-04 09:47:41 -0500 (Mon, 04 Oct 2010)
New Revision: 4190

Modified:
   cgm/trunk/geom/OCC/OCCBody.cpp
   cgm/trunk/geom/OCC/OCCBody.hpp
   cgm/trunk/geom/OCC/OCCCurve.cpp
   cgm/trunk/geom/OCC/OCCCurve.hpp
   cgm/trunk/geom/OCC/OCCDrawTool.cpp
   cgm/trunk/geom/OCC/OCCLump.cpp
   cgm/trunk/geom/OCC/OCCLump.hpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCPoint.hpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.hpp
   cgm/trunk/geom/OCC/OCCShell.cpp
   cgm/trunk/geom/OCC/OCCShell.hpp
   cgm/trunk/geom/OCC/OCCSurface.cpp
   cgm/trunk/geom/OCC/OCCSurface.hpp
   cgm/trunk/test/Makefile.am
   cgm/trunk/test/makept.cpp
   cgm/trunk/test/modify.cpp
   cgm/trunk/test/r_w.cpp
Log:
Body now has compound structure: can hold multiple surfaces, shells and lumps. Single surface or shell or lump body will not have TopoDS_Coumpound pointer in Body, and boolean operation is working only on these kinds of bodies. The result of the boolean can be compound.
So far, it passes all 12 tests under CGM/test, and it passed two more tests in mcnp2cad: cone and fill1. Other tests are under investigation now.

Modified: cgm/trunk/geom/OCC/OCCBody.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.cpp	2010-10-04 13:09:41 UTC (rev 4189)
+++ cgm/trunk/geom/OCC/OCCBody.cpp	2010-10-04 14:47:41 UTC (rev 4190)
@@ -43,6 +43,7 @@
 #include "TopTools_ListIteratorOfListOfShape.hxx"
 #include "gp_Ax1.hxx"
 #include "gp_Ax2.hxx"
+#include "gp_GTrsf.hxx"
 #include "Bnd_Box.hxx"
 #include "BRepBndLib.hxx"
 #include "TopExp_Explorer.hxx"
@@ -52,75 +53,133 @@
 #include "BRepGProp.hxx"
 #include "Standard_Boolean.hxx"
 #include "LocOpe_SplitShape.hxx"
+#include "TopoDS_Compound.hxx"
 //-------------------------------------------------------------------------
 // Purpose       : A constructor with a list of lumps that are attached.
 //
 // Special Notes :
 //
 //-------------------------------------------------------------------------
-OCCBody::OCCBody(TopoDS_CompSolid *theShape, CubitBoolean isSheetBody,
-                 OCCSurface* surface, OCCShell* shell)
+OCCBody::OCCBody(TopoDS_Compound *theShape, 
+                 OCCSurface* surface, OCCShell* shell, Lump* lump)
 {
   myTopoDSShape = theShape;
-  IsSheetBody = isSheetBody; 
-  mySheetSurface = surface;
-  myShell = shell;
+  if (surface != NULL)
+    mySheetSurfaces.append(surface);
+  if( shell != NULL)
+    myShells.append(shell);
+  if (lump != NULL)
+    myLumps.append(lump);
   update_bounding_box();
+  if (myTopoDSShape && !myTopoDSShape->IsNull())
+    assert(myTopoDSShape->ShapeType() == TopAbs_COMPOUND);
 }
 
-void OCCBody::set_sheet_surface(OCCSurface* surface)
+TopoDS_Compound* OCCBody::get_TopoDS_Shape()
 {
-  IsSheetBody = CUBIT_TRUE;
-  mySheetSurface = surface;
-  if(surface == NULL)
-    IsSheetBody = CUBIT_FALSE;
+  if (myTopoDSShape && !myTopoDSShape->IsNull())


More information about the cgma-dev mailing list