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

hongjun at mcs.anl.gov hongjun at mcs.anl.gov
Fri Oct 15 10:59:14 CDT 2010


Hello, Jane

I am developing parallel meshing and I need to distribute OCC geometry to multiple processors.
Since I am using Body as a unit of geometry distribution, I want to store distribution information as attributes to Body entities.
So, I made several import/export functions from/to memory buffer in "OCCQueryTool".

However, they are changed for "export_solid_model" function not to export parent Body entity of single Volume lump geometry
and I lose the attribute information assigned to Body entity.

So, can you change for single volume geometry to be exported with its parent Body attribute information?
Otherwise, do I have to use Volume and Surface as a distribution unit and assign the distribution information to Volume entity? 

-----------------------------
Hong-Jun Kim
Post-doc researcher
9700 S. Cass Ave. B240/R2147
Argonne, IL 60439
630-252-4791
hongjun at mcs.anl.gov
-----------------------------
----- "jiangtao ma" <jiangtao_ma at yahoo.com> wrote:

> 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