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

hongjun at mcs.anl.gov hongjun at mcs.anl.gov
Fri Apr 23 11:18:45 CDT 2010


Author: hongjun
Date: 2010-04-23 11:18:45 -0500 (Fri, 23 Apr 2010)
New Revision: 3807

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
Log:
o Obb tree construction function for geometry is added
o Tree roots for surfaces and volumes are constructed 


Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2010-04-23 16:16:18 UTC (rev 3806)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2010-04-23 16:18:45 UTC (rev 3807)
@@ -33,6 +33,18 @@
 // be listed for both the forward and reverse slots.
 const char GEOM_SENSE_TAG_NAME[] = "GEOM_SENSE_2";
 
+GeomTopoTool::GeomTopoTool(Interface *impl, bool find_geoments) 
+  : mdbImpl(impl), obbTree(impl), sense2Tag(0), 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();
+}
+  
 ErrorCode GeomTopoTool::set_sense( EntityHandle surface,
                                      EntityHandle volume,
                                      bool forward )
@@ -90,16 +102,10 @@
 
 ErrorCode GeomTopoTool::find_geomsets(Range *ranges) 
 {
-  //Tag geom_tag;
-  ErrorCode result = mdbImpl->tag_create(GEOM_DIMENSION_TAG_NAME, 4, 
-                                           MB_TAG_SPARSE, geomTag, NULL);
-  if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result)
-    return result;
-  
     // get all sets with this tag
   Range geom_sets;
-  result = mdbImpl->get_entities_by_type_and_tag(0, MBENTITYSET, &geomTag, NULL, 1,
-                                                 geom_sets);
+  ErrorCode result = mdbImpl->get_entities_by_type_and_tag(0, MBENTITYSET, &geomTag, NULL, 1,
+							   geom_sets);
   if (MB_SUCCESS != result || geom_sets.empty()) 
     return result;
 
@@ -114,14 +120,16 @@
   return MB_SUCCESS;
 }
 
-ErrorCode GeomTopoTool::construct_obb_trees()
+ErrorCode GeomTopoTool::construct_obb_trees(bool make_one_vol)
 {
+  ErrorCode rval;
+


More information about the moab-dev mailing list