[cgma-dev] r4222 - cgm/trunk/geom/OCC

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Mon Oct 18 11:20:50 CDT 2010


Author: janehu
Date: 2010-10-18 11:20:49 -0500 (Mon, 18 Oct 2010)
New Revision: 4222

Modified:
   cgm/trunk/geom/OCC/OCCBody.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
Changes to correspond with body holding multiple volumes or shells or surfaces when treating Attributes.

Modified: cgm/trunk/geom/OCC/OCCBody.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.cpp	2010-10-16 01:35:04 UTC (rev 4221)
+++ cgm/trunk/geom/OCC/OCCBody.cpp	2010-10-18 16:20:49 UTC (rev 4222)
@@ -189,6 +189,11 @@
 
 void OCCBody::append_simple_attribute_virt(CubitSimpleAttrib *csa)
 { 
+  if (myTopoDSShape != NULL)
+  {
+    OCCAttribSet::append_attribute(csa, *myTopoDSShape);
+    return;
+  }
   int i = 0;
   for (i; i < mySheetSurfaces.size();i++)
   {
@@ -206,12 +211,15 @@
     TopoDS_Solid* solid = lump->get_TopoDS_Solid();
     OCCAttribSet::append_attribute(csa, *solid); 
   }
-  if (myTopoDSShape != NULL)
-    OCCAttribSet::append_attribute(csa, *myTopoDSShape);
 }
   
 void OCCBody::remove_simple_attribute_virt(CubitSimpleAttrib *csa)
 { 
+  if (myTopoDSShape != NULL)
+  {
+    OCCAttribSet::remove_attribute(csa, *myTopoDSShape);
+    return;
+  }
   for(int i = 0; i < myShells.size(); i++)
   {
     TopoDS_Shell* shell = myShells.get_and_step()->get_TopoDS_Shell();
@@ -228,8 +236,6 @@
     TopoDS_Solid* solid = lump->get_TopoDS_Solid();
     OCCAttribSet::remove_attribute(csa, *solid); 
   }
-  if (myTopoDSShape != NULL)
-    OCCAttribSet::remove_attribute(csa, *myTopoDSShape);
 }
 
 
@@ -238,6 +244,9 @@
   
 CubitStatus OCCBody::get_simple_attribute(DLIList<CubitSimpleAttrib*>& csa_list)
 { 
+  if (myTopoDSShape != NULL)
+    return OCCAttribSet::get_attributes(*myTopoDSShape,csa_list);
+
   for (int i=0; i < mySheetSurfaces.size();i++)


More information about the cgma-dev mailing list