Author: janehu Date: 2010-11-09 10:34:38 -0600 (Tue, 09 Nov 2010) New Revision: 4256 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/OCCLump.cpp cgm/trunk/geom/OCC/OCCLump.hpp cgm/trunk/geom/OCC/OCCModifyEngine.cpp cgm/trunk/geom/OCC/OCCPoint.cpp cgm/trunk/geom/OCC/OCCPoint.hpp cgm/trunk/geom/OCC/OCCQueryEngine.cpp cgm/trunk/geom/OCC/OCCSurface.cpp cgm/trunk/geom/OCC/OCCSurface.hpp Log: Changed attributes on single lump body to be held within body, when exporting, append it to its lump and when importing, add back to body. Should work the same way as CGM with ACIS. Fixed some momory leaking problems. All testcases passed under make check. Modified: cgm/trunk/geom/OCC/OCCBody.cpp =================================================================== --- cgm/trunk/geom/OCC/OCCBody.cpp 2010-11-08 17:20:37 UTC (rev 4255) +++ cgm/trunk/geom/OCC/OCCBody.cpp 2010-11-09 16:34:38 UTC (rev 4256) @@ -35,6 +35,7 @@ #include "OCCShell.hpp" #include "OCCLump.hpp" #include "OCCModifyEngine.hpp" +#include "OCCAttribSet.hpp" #include <TopExp.hxx> #include <TopTools_IndexedMapOfShape.hxx> @@ -194,23 +195,12 @@ OCCAttribSet::append_attribute(csa, *myTopoDSShape); return; } - int i = 0; - for (i; i < mySheetSurfaces.size();i++) - { - TopoDS_Face * face = mySheetSurfaces.get_and_step()->get_TopoDS_Face(); - OCCAttribSet::append_attribute(csa, *face); - } - for(i = 0; i < myShells.size(); i++) - { - TopoDS_Shell* shell = myShells.get_and_step()->get_TopoDS_Shell(); - OCCAttribSet::append_attribute(csa, *shell); - } - for(i = 0; i < myLumps.size(); i++) - { - OCCLump* lump = CAST_TO(myLumps.get_and_step(), OCCLump); - TopoDS_Solid* solid = lump->get_TopoDS_Solid(); - OCCAttribSet::append_attribute(csa, *solid); - } + DLIList<CubitString*> *string_list = csa->string_data_list(); + DLIList<double*> *doubles = csa->double_data_list(); + DLIList<int*> *ints = csa->int_data_list(); + CubitSimpleAttrib* csa_new = new CubitSimpleAttrib; + csa_new->initialize_from_lists_of_ptrs(string_list, doubles, ints); + csa_list.append_unique(csa_new); } void OCCBody::remove_simple_attribute_virt(CubitSimpleAttrib *csa) @@ -220,74 +210,50 @@ OCCAttribSet::remove_attribute(csa, *myTopoDSShape); return; } - for(int i = 0; i < myShells.size(); i++) + + if (csa == NULL) { - TopoDS_Shell* shell = myShells.get_and_step()->get_TopoDS_Shell();
participants (1)
-
jiangtao_ma@yahoo.com