[MOAB-dev] r4554 - MOAB/trunk/tools/vtkMOABReader

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Mar 9 00:11:03 CST 2011


Author: tautges
Date: 2011-03-09 00:11:03 -0600 (Wed, 09 Mar 2011)
New Revision: 4554

Modified:
   MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx
Log:
One more time, this time to avoid listing child sets twice.



Modified: MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx
===================================================================
--- MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx	2011-03-09 05:47:36 UTC (rev 4553)
+++ MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.cxx	2011-03-09 06:11:03 UTC (rev 4554)
@@ -104,7 +104,7 @@
   ErrorCode get_top_parent_sets(Range &top_sets);
   
   vtkMultiBlockDataSet *get_mbdataset(vtkMultiBlockDataSet *output,
-                                      EntityHandle eset, bool create_if_missing = false);
+                                      EntityHandle eset);
   
   ErrorCode get_category_name(EntityHandle eset, std::string &cat_name);
 
@@ -1029,8 +1029,11 @@
     ds->GetMetaData(blockI)->Set(vtkCompositeDataSet::NAME(), tag_name.c_str());
 
     for (Range::iterator rit = tag_sets.begin(); rit != tag_sets.end(); rit++) {
-      vtkMultiBlockDataSet *mb = get_mbdataset(tmb, *rit, true);
-      
+      vtkMultiBlockDataSet *mb = NULL;
+      ErrorCode rval = mbImpl->tag_get_data(vtkDSTag, &(*rit), 1, &mb);
+      if (MB_SUCCESS != rval) return rval;
+      if (!mb) mb = get_mbdataset(tmb, *rit);
+
         // get the UG from the multiblock
       assert(mb->GetNumberOfBlocks() > 0);
       vtkUnstructuredGrid *ug = vtkUnstructuredGrid::SafeDownCast(mb->GetBlock(0));
@@ -1056,11 +1059,19 @@
 ErrorCode vtkMOABReaderPrivate::recursive_process_set(vtkMultiBlockDataSet *output, EntityHandle eset)
 {
     // first make sure this set has a multiblock dataset
-  vtkMultiBlockDataSet *mb = get_mbdataset(output, eset, true);
-
+  vtkMultiBlockDataSet *mb = NULL;
+  bool created = false;
+  ErrorCode rval = mbImpl->tag_get_data(vtkDSTag, &eset, 1, &mb);
+  if (MB_SUCCESS != rval) return rval;
+  
+  if (!mb) {
+    mb = get_mbdataset(output, eset);
+    created = true;
+  }
+  
     // get children here, so we know whether to put multiblock dataset or UG into output
   Range children;
-  ErrorCode rval = mbImpl->get_child_meshsets(eset, children);
+  rval = mbImpl->get_child_meshsets(eset, children);
   assert(MB_SUCCESS == rval);
 
     // make this dataset a child of the one passed in
@@ -1074,35 +1085,30 @@


More information about the moab-dev mailing list