[MOAB-dev] r5283 - in MOAB/trunk: src src/moab test
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Thu Dec 29 10:41:06 CST 2011
Author: iulian
Date: 2011-12-29 10:40:59 -0600 (Thu, 29 Dec 2011)
New Revision: 5283
Modified:
MOAB/trunk/src/GeomTopoTool.cpp
MOAB/trunk/src/moab/GeomTopoTool.hpp
MOAB/trunk/test/crop_vol_test.cpp
Log:
modify the "duplicate_model" method in GeomTopoTool.
It can take as input a gentity (surface or volume, usually), to duplicate
the dependents of this gentity in a new GeomTopoTool. The new model will
have cleaner sense tags when exported to a new database.
Before this, variable length edge-face tags would have some values of 0,
corresponding to faces that were not extracted (trimmed off)
Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp 2011-12-23 18:56:36 UTC (rev 5282)
+++ MOAB/trunk/src/GeomTopoTool.cpp 2011-12-29 16:40:59 UTC (rev 5283)
@@ -1118,12 +1118,24 @@
return MB_SUCCESS;
}
-// this would be a deep copy, into a new geom topo tool
- // sets will be duplicated, but entities not
- // modelSet will be a new one
- // if the original set was null (root), a new model set will be created for
- // original model, and its entities will be the original g sets
-ErrorCode GeomTopoTool::duplicate_model(GeomTopoTool *& duplicate)
+
+/*
+ * This would create a deep copy, into a new geom topo tool
+ * sets will be duplicated, but entities not
+ * modelSet will be a new one
+ * if the original set was null (root), a new model set will be created for
+ * original model, and its entities will be the original g sets
+ * Scenario: split a face along a ground line, then write only one surface
+ * the common line has 2 faces in var len tag for sense edge; if we write only one
+ * surface to a new database, the var len tag of the edge will be extracted with 2 values, but
+ * only one value will make sense, the other will be zero.
+ *
+ * There is no workaround; we need to create a duplicate model that has only that surface
+ * and its children (and grand-children). Then the var len sense edge-face tags will have
+ * the right size.
+ *
+ */
+ErrorCode GeomTopoTool::duplicate_model(GeomTopoTool *& duplicate, EntityHandle geomSet)
{
// will
EntityHandle rootModelSet;
@@ -1140,6 +1152,19 @@
if (MB_SUCCESS != rval)
return rval;
}
+ // extract from the geomSet the dimension, children, and grand-children
+ Range depSets;// dependents of the geomSet, including the geomSet
+ // add in this range all the dependents of this, to filter the ones that need to be deep copied
+
+ if (geomSet)
+ {
+ rval = mdbImpl->get_child_meshsets(geomSet, depSets, 0); // 0 for numHops means that all
+ // dependents are returned, not only the direct children.
+ if (MB_SUCCESS != rval)
+ return rval;
+ depSets.insert(geomSet);
+ }
More information about the moab-dev
mailing list