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

iulian at mcs.anl.gov iulian at mcs.anl.gov
Tue Nov 9 14:55:07 CST 2010


Author: iulian
Date: 2010-11-09 14:55:07 -0600 (Tue, 09 Nov 2010)
New Revision: 4257

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
Log:
The surface and volume geometry sets in a model might not be contiguous in 
the database; A check is made when the obb tree is built; if the sets are
contiguous, the std::vector is used (faster). If the sets are not contiguous, a
local map is built between the geometry sets and the corresponding roots in the
obb trees. Its access time is O(logN), but N should be relatively small 
in general. (N is the number of geometry sets of dimension 2 or 3 in the model)


Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2010-11-09 16:34:38 UTC (rev 4256)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2010-11-09 20:55:07 UTC (rev 4257)
@@ -36,442 +36,479 @@
 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) 
-        : mdbImpl(impl), sense2Tag(0), senseNEntsTag(0), senseNSensesTag(0), 
-          obbTree(impl), oneVolRootSet(NULL)
-{
-  ErrorCode result = mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, 4, 
-                                           MB_TAG_SPARSE, geomTag, NULL);
-  if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) {
-    std::cerr << "Error: Failed to create geometry dimension tag." << std::endl;
-  }
-  
-  if (find_geoments) find_geomsets();
+GeomTopoTool::GeomTopoTool(Interface *impl, bool find_geoments) :
+   mdbImpl(impl), sense2Tag(0), senseNEntsTag(0), senseNSensesTag(0), obbTree(
+         impl), oneVolRootSet(NULL) , contiguous(true) {
+   ErrorCode result = mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, 4,
+         MB_TAG_SPARSE, geomTag, NULL);
+   if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) {
+      std::cerr << "Error: Failed to create geometry dimension tag."
+            << std::endl;
+   }
+
+   if (find_geoments)
+      find_geomsets();
 }
-  
-ErrorCode GeomTopoTool::set_sense( EntityHandle surface,
-                                     EntityHandle volume,
-                                     bool forward )
-{
-  ErrorCode rval;
-  if (!sense2Tag) {
-    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)
-      return rval;
-  }
-  
-  EntityHandle sense_data[2] = {0,0};
-  rval = mdbImpl->tag_get_data( sense2Tag, &surface, 1, sense_data );
-  if (MB_TAG_NOT_FOUND != rval && MB_SUCCESS != rval)
-    return MB_FAILURE;
-  


More information about the moab-dev mailing list