[MOAB-dev] r1276 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Sep 14 12:33:37 CDT 2007


Author: kraftche
Date: 2007-09-14 12:33:37 -0500 (Fri, 14 Sep 2007)
New Revision: 1276

Modified:
   MOAB/trunk/MBCore.cpp
Log:
remove more static function variables

Modified: MOAB/trunk/MBCore.cpp
===================================================================
--- MOAB/trunk/MBCore.cpp	2007-09-14 16:05:59 UTC (rev 1275)
+++ MOAB/trunk/MBCore.cpp	2007-09-14 17:33:37 UTC (rev 1276)
@@ -302,7 +302,7 @@
                                     const MBEntityID id, 
                                     MBEntityHandle& handle) const
 {
-  static int err;
+  int err;
   handle = CREATE_HANDLE(type, id, err);
 
     //check to see if handle exists 
@@ -934,9 +934,6 @@
     // WARNING: This is very dependent on the ordering of the MBEntityType enum
   MBEntityType type = TYPE_FROM_HANDLE(entity_handle);
   
-  static std::vector<MBEntityHandle> tmp;
-  tmp.clear();
-  
   MBEntitySequence* seq = 0;
 
   if (type < MBVERTEX || type > MBENTITYSET)
@@ -946,16 +943,20 @@
   if (seq == 0 || status != MB_SUCCESS || !seq->is_valid_entity(entity_handle))
     return (status != MB_SUCCESS ? status : MB_ENTITY_NOT_FOUND);
 
-  status = static_cast<ElementEntitySequence*>(seq)->get_connectivity(entity_handle, tmp);
+  const MBEntityHandle* old_conn;
+  int len;
+  status = static_cast<ElementEntitySequence*>(seq)->get_connectivity(entity_handle, old_conn, len);
   if (status != MB_SUCCESS) return status;
+
+  aEntityFactory->notify_change_connectivity(
+    entity_handle, old_conn, connect, num_connect);
   
   status = static_cast<ElementEntitySequence*>(seq)->set_connectivity(entity_handle, 
                                                                       connect, num_connect);
-  if (status != MB_SUCCESS) return status;
+  if (status != MB_SUCCESS) 
+    aEntityFactory->notify_change_connectivity(
+      entity_handle, connect, old_conn, num_connect);
 
-  aEntityFactory->notify_change_connectivity(
-    entity_handle, &tmp[0], connect, num_connect);
-
   return status;
 }
 




More information about the moab-dev mailing list