[MOAB-dev] r4273 - MOAB/trunk/src/io

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed Nov 17 13:45:27 CST 2010


Author: iulian
Date: 2010-11-17 13:45:27 -0600 (Wed, 17 Nov 2010)
New Revision: 4273

Modified:
   MOAB/trunk/src/io/WriteVtk.cpp
Log:
ticket 173
if a tag has a default value, write that instead of 0


Modified: MOAB/trunk/src/io/WriteVtk.cpp
===================================================================
--- MOAB/trunk/src/io/WriteVtk.cpp	2010-11-17 16:45:04 UTC (rev 4272)
+++ MOAB/trunk/src/io/WriteVtk.cpp	2010-11-17 19:45:27 UTC (rev 4273)
@@ -25,6 +25,7 @@
 
 #include "WriteVtk.hpp"
 #include "VtkUtil.hpp"
+#include "SysUtil.hpp"
 
 #include <fstream>
 #include <iostream>
@@ -505,6 +506,13 @@
     // the entities that actually have the tag set.
   std::vector<T> data;
   data.resize( n * vals_per_tag, 0 );
+  // if there is a default value for the tag, set the actual default value
+  T def_value[vals_per_tag];
+  rval = mbImpl-> tag_get_default_value( tag, &(def_value[0]));
+  if (MB_SUCCESS==rval)
+  {
+     SysUtil::setmem(&(data[0]), &(def_value[0]), size, n);
+  }
   Range::const_iterator t = tagged.begin();
   typename std::vector<T>::iterator d = data.begin();
   for (Range::const_iterator i = entities.begin(); 



























More information about the moab-dev mailing list