[MOAB-dev] r5049 - MOAB/trunk/src

iulian at mcs.anl.gov iulian at mcs.anl.gov
Sat Jul 9 00:22:19 CDT 2011


Author: iulian
Date: 2011-07-09 00:22:18 -0500 (Sat, 09 Jul 2011)
New Revision: 5049

Modified:
   MOAB/trunk/src/FBEngine.cpp
Log:
use tags to do flood fill, instead of std::set
Also, the second set is iniSet+newTri-deleted-firstset, use range unite and
subtract
should run faster and more efficiently 


Modified: MOAB/trunk/src/FBEngine.cpp
===================================================================
--- MOAB/trunk/src/FBEngine.cpp	2011-07-07 20:48:10 UTC (rev 5048)
+++ MOAB/trunk/src/FBEngine.cpp	2011-07-09 05:22:18 UTC (rev 5049)
@@ -11,6 +11,7 @@
 #include <map>
 #include <set>
 #include <queue>
+#include <algorithm>
 #include "assert.h"
 
 #include "SmoothCurve.hpp"
@@ -1527,6 +1528,8 @@
   // mesh_edges
   for(unsigned int j=0; j<chainedEdges.size(); j++)
   {
+    // this will keep adding edges to the mesh_edges range
+    // when we get out, the mesh_edges will be in this range, but not ordered
     rval = _mbImpl->get_entities_by_type(chainedEdges[j], MBEDGE, mesh_edges);
     MBERRORR(rval, "can't get new polyline edges");
     if (debug_splits)
@@ -1538,10 +1541,32 @@
 
   // get a positive triangle adjacent to mesh_edge[0]
   // add to first triangles to the left, second triangles to the right of the mesh_edges ;
-  std::set<EntityHandle> firstSet;
-  std::set<EntityHandle> secondSet;
-  for (Range::iterator it = mesh_edges.begin(); it!=mesh_edges.end(); it++)
+
+  // create a temp tag, and when done, delete it
+  // default value: 0
+  // 3 to be deleted, pierced
+  // 1 first set
+  // 2 second set
+  // create the tag also for control points on the edges
+  int defVal = 0;
+  Tag separateTag;
+  rval = MBI->tag_get_handle("SEPARATE_TAG", 1, MB_TYPE_INTEGER, separateTag,
+                               MB_TAG_DENSE|MB_TAG_CREAT, &defVal );
+  MBERRORR(rval, "can't create temp tag for separation");
+  // the deleted triangles will get a value 3, from start
+  int delVal = 3;
+  for (Range::iterator it1=this->_piercedTriangles.begin();
+      it1!=_piercedTriangles.end(); it1++)
   {
+    EntityHandle trToDelete= *it1;
+    rval = _mbImpl->tag_set_data(separateTag, &trToDelete, 1, &delVal );
+    MBERRORR(rval, "can't set delete tag value");
+  }
+
+  // find a triangle that will be in the first range, positively oriented about the splitting edge


More information about the moab-dev mailing list