[MOAB-dev] r4317 - in MOAB/trunk: src src/io test/io

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri Dec 3 12:09:10 CST 2010


Author: tautges
Date: 2010-12-03 12:09:10 -0600 (Fri, 03 Dec 2010)
New Revision: 4317

Added:
   MOAB/trunk/test/io/read_cgm_test.cpp
Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/io/ReadCGM.cpp
   MOAB/trunk/test/io/Makefile.am
Log:
Removed the deinitialize of CGM from ~ReadCGM.  Still not entirely satisfied
with this, since it leaves CGM initialized, but don't have a good long-term 
solution yet.

Also fix a few places in GeomTopoTool that couldn't handle tags already created,
and added a cgm reader test that tests multiple reads.

Passes make check.




Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2010-12-03 17:16:42 UTC (rev 4316)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2010-12-03 18:09:10 UTC (rev 4317)
@@ -63,7 +63,7 @@
       rval = mdbImpl->tag_create(GEOM_SENSE_2_TAG_NAME, 2
             * sizeof(EntityHandle), MB_TAG_SPARSE, MB_TYPE_HANDLE, sense2Tag,
             0, true);
-      if (MB_SUCCESS != rval)
+      if (MB_SUCCESS != rval && (MB_ALREADY_ALLOCATED != rval || !sense2Tag))
          return rval;
    }
 
@@ -87,12 +87,12 @@
    if (!senseNEntsTag) {
       rval = mdbImpl->tag_create_variable_length(GEOM_SENSE_N_ENTS_TAG_NAME,
             MB_TAG_SPARSE, MB_TYPE_HANDLE, senseNEntsTag);
-      if (MB_SUCCESS != rval)
+      if (MB_SUCCESS != rval && (MB_ALREADY_ALLOCATED != rval || !senseNEntsTag))
          return rval;
 
       rval = mdbImpl->tag_create_variable_length(GEOM_SENSE_N_SENSES_TAG_NAME,
             MB_TAG_SPARSE, MB_TYPE_INTEGER, senseNSensesTag);
-      if (MB_SUCCESS != rval)
+      if (MB_SUCCESS != rval && (MB_ALREADY_ALLOCATED != rval || !senseNSensesTag))
          return rval;
    }
 
@@ -334,7 +334,7 @@
    Tag geom_tag;
    ErrorCode result = mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, 4,
          MB_TAG_SPARSE, geom_tag, NULL);
-   if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result)
+   if (MB_SUCCESS != result && (MB_ALREADY_ALLOCATED != result || !geom_tag))
       return result;
 
    // get all sets with this tag
@@ -360,7 +360,7 @@
       EntityHandle dum_val = 0;
       result = mdbImpl->tag_create("__owner_tag", sizeof(EntityHandle),
             MB_TAG_DENSE, MB_TYPE_HANDLE, owner_tag, &dum_val);
-      if (MB_SUCCESS != result)
+      if (MB_SUCCESS != result && (MB_ALREADY_ALLOCATED != result || !owner_tag))
          continue;
       Range dp1ents;
       std::vector<EntityHandle> owners;

Modified: MOAB/trunk/src/io/ReadCGM.cpp
===================================================================
--- MOAB/trunk/src/io/ReadCGM.cpp	2010-12-03 17:16:42 UTC (rev 4316)
+++ MOAB/trunk/src/io/ReadCGM.cpp	2010-12-03 18:09:10 UTC (rev 4317)


More information about the moab-dev mailing list