[cgma-dev] r4488 - in cgm/trunk: itaps util

tautges at mcs.anl.gov tautges at mcs.anl.gov
Sat Feb 12 20:48:06 CST 2011


Author: tautges
Date: 2011-02-12 20:48:06 -0600 (Sat, 12 Feb 2011)
New Revision: 4488

Modified:
   cgm/trunk/itaps/iGeom_CGMA.cc
   cgm/trunk/util/GeometryDefines.h
Log:
Couple of fixes needed for some MeshKit tests, one of these fixes a long-standing
bug when reading multiple files through iGeom.

itaps/iGeom_CGMA.cc: run process_attribs only on entities read into the current iGeom_load,
  not on all entities.

util/GeometryDefines.h: removed OCC surface and curve types from this enum; this enum has to
  match what cubit uses, otherwise we're not compatible.




Modified: cgm/trunk/itaps/iGeom_CGMA.cc
===================================================================
--- cgm/trunk/itaps/iGeom_CGMA.cc	2011-02-11 00:44:56 UTC (rev 4487)
+++ cgm/trunk/itaps/iGeom_CGMA.cc	2011-02-13 02:48:06 UTC (rev 4488)
@@ -112,8 +112,8 @@
 #define gmt GeometryModifyTool::instance()
 
 const char *iGeom_entity_type_names[] = {"vertex", "curve", "surface", "body"};
+const char *cgm_type_names[] = {"vertex", "curve", "surface", "volume", "body"};
 
-
 // Implement RAII pattern for allocated arrays
 class iGeomArrayManager
 {
@@ -187,7 +187,7 @@
 iGeom_load_cub_geometry(const char *name, int* err) ;
 
 static iBase_ErrorType 
-process_attribs(iGeom_Instance instance) ;
+process_attribs(iGeom_Instance instance, DLIList<RefEntity*> &ref_list) ;
 
 static void
 iGeom_get_adjacent_entities( const RefEntity *from, 
@@ -368,6 +368,12 @@
                  int name_len,
                  int options_size )
 {
+    // pre-get all entities, so we can filter them out later; use cubit list
+    // 'cuz we need to get both volumes and bodies
+  DLIList<RefEntity*> ref_list;
+  for (int dim = 0; dim < 5; dim++)
+    gqt->ref_entity_list(cgm_type_names[dim], ref_list, false);
+
    // make sure we have a null-terminated string for file name
   std::string file_name( name, name_len );
   name = file_name.c_str();
@@ -435,9 +441,14 @@
     }
   }
 
+  DLIList<RefEntity*> ref_list_2;
+  for (int dim = 0; dim < 5; dim++)
+    gqt->ref_entity_list(cgm_type_names[dim], ref_list_2, false);
+
+  ref_list_2 -= ref_list;
+  
     // now process uncaught/unregistered attributes
-  iBase_ErrorType result;
-  result = process_attribs(instance);
+  iBase_ErrorType result = process_attribs(instance, ref_list_2);
 


More information about the cgma-dev mailing list