[MOAB-dev] r4840 - in MOAB/trunk/src: . moab

iulian at mcs.anl.gov iulian at mcs.anl.gov
Tue May 17 22:47:03 CDT 2011


Author: iulian
Date: 2011-05-17 22:47:02 -0500 (Tue, 17 May 2011)
New Revision: 4840

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
Log:
allow multiple models in a database
the modelSet is a regular moab set, and all its entities are geo sets 
corresponding to one full (topological)  model


Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2011-05-18 03:18:02 UTC (rev 4839)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2011-05-18 03:47:02 UTC (rev 4840)
@@ -37,9 +37,10 @@
 const char GEOM_SENSE_N_ENTS_TAG_NAME[] = "GEOM_SENSE_N_ENTS";
 const char GEOM_SENSE_N_SENSES_TAG_NAME[] = "GEOM_SENSE_N_SENSES";
 
-GeomTopoTool::GeomTopoTool(Interface *impl, bool find_geoments) :
+GeomTopoTool::GeomTopoTool(Interface *impl, bool find_geoments, EntityHandle modelRootSet) :
   mdbImpl(impl), sense2Tag(0), senseNEntsTag(0), senseNSensesTag(0),
-  geomTag(0), gidTag(0), obbTree(impl, NULL, true), contiguous(true), oneVolRootSet(0)
+  geomTag(0), gidTag(0), modelSet(modelRootSet), obbTree(impl, NULL, true),
+  contiguous(true), oneVolRootSet(0)
 {
 
   ErrorCode result = mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, 4,
@@ -70,6 +71,15 @@
       return result;
   }
 
+  // check if the geo set belongs to this model
+  if (modelSet)
+  {
+    if(!mdbImpl->contains_entities(modelSet, &this_set, 1 ))
+    {
+      // this g set does not belong to the current model
+      return -1;
+    }
+  }
   // get the data for those tags
   int dim;
   result = mdbImpl->tag_get_data(geomTag, &this_set, 1, &dim);
@@ -87,6 +97,16 @@
       return result;
   }
 
+  // check if the geo set belongs to this model
+  if (modelSet)
+  {
+    if(!mdbImpl->contains_entities(modelSet, &this_set, 1 ))
+    {
+      // this g set does not belong to the current model
+      return -1;
+    }
+  }
+
   // get the data for those tags
   int id;
   result = mdbImpl->tag_get_data(gidTag, &this_set, 1, &id);
@@ -133,7 +153,7 @@


More information about the moab-dev mailing list