[cgma-dev] r5272 - cgm/trunk/geom/OCC
jiangtao_ma at yahoo.com
jiangtao_ma at yahoo.com
Wed Dec 21 10:53:06 CST 2011
Author: janehu
Date: 2011-12-21 10:53:06 -0600 (Wed, 21 Dec 2011)
New Revision: 5272
Modified:
cgm/trunk/geom/OCC/OCCModifyEngine.cpp
cgm/trunk/geom/OCC/OCCModifyEngine.hpp
cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed the copy body with attribute bug reported by Rajeev. passed make check in cgm.
Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2011-12-21 16:50:25 UTC (rev 5271)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2011-12-21 16:53:06 UTC (rev 5272)
@@ -659,6 +659,7 @@
occ_surface->get_param_range_V(VMin, VMax);
TopoDS_Face *theFace = occ_surface->get_TopoDS_Face();
+
if( !theFace)
{
PRINT_ERROR("Cannot create an OCC surface from the given surface.\n"
@@ -1771,6 +1772,7 @@
return (BodySM *)NULL;
}
+ DLIList<CubitSimpleAttrib*> list;
TopoDS_Compound *theCS = occ_body->get_TopoDS_Shape();
if (theCS == NULL) //single lump or shell or surface body
@@ -1784,6 +1786,7 @@
TopoDS_Shape newShape = api_copy.ModifiedShape(*shell);
TopoDS_Shell newShell = TopoDS::Shell(newShape);
new_body = OCCQueryEngine::instance()->populate_topology_bridge(newShell, CUBIT_TRUE)->my_body();
+ copy_body_attributes((TopoDS_Shape)(*shell), api_copy);
}
DLIList<OCCSurface*> surfaces = occ_body->my_sheet_surfaces();
@@ -1791,15 +1794,16 @@
for(int i = 0 ; !new_body && i < surfaces.size(); i++)
{
- Surface* surface = make_Surface(surfaces.get_and_step());
- if (surface == NULL)
- {
- PRINT_ERROR("Cannot create an OCC sheet bodySM from the given bodySM.\n");
- return (BodySM *)NULL;
- }
-
+ OCCSurface *occ_surface = CAST_TO(surfaces.get_and_step(), OCCSurface);
+ TopoDS_Face *theFace = occ_surface->get_TopoDS_Face();
+ BRepBuilderAPI_Copy api_copy(*theFace);
+ TopoDS_Shape newShape = api_copy.ModifiedShape(*theFace);
+ TopoDS_Face newFace = TopoDS::Face(newShape);
+ Surface* surface = OCCQueryEngine::instance()->populate_topology_bridge(
+ newFace, CUBIT_TRUE );
OCCSurface* occ_surf = CAST_TO(surface, OCCSurface);
new_body = occ_surf->my_body();
+ copy_body_attributes((TopoDS_Shape)(*theFace) , api_copy);
}
More information about the cgma-dev
mailing list