Salome HOME
Components are now available in VTK output of double arrays.
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 6 Nov 2014 14:33:17 +0000 (15:33 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 6 Nov 2014 14:33:17 +0000 (15:33 +0100)
src/MEDCoupling/MEDCouplingMemArray.cxx

index ad04057103ee6ea2a5f7b4206fd6af79621d16b4..685de65decd662bd4d9c853d0edc786345ca5f67 100644 (file)
@@ -1169,6 +1169,15 @@ void DataArrayDouble::writeVTK(std::ostream& ofs, int indent, const std::string&
   std::string idt(indent,' ');
   ofs.precision(17);
   ofs << idt << "<DataArray type=\"Float32\" Name=\"" << nameInFile << "\" NumberOfComponents=\"" << getNumberOfComponents() << "\"";
+  //
+  bool areAllEmpty(true);
+  for(std::vector<std::string>::const_iterator it=_info_on_compo.begin();it!=_info_on_compo.end();it++)
+    if(!(*it).empty())
+      areAllEmpty=false;
+  if(!areAllEmpty)
+    for(std::size_t i=0;i<_info_on_compo.size();i++)
+      ofs << " ComponentName" << i << "=\"" << _info_on_compo[i] << "\"";
+  //
   if(byteArr)
     {
       ofs << " format=\"appended\" offset=\"" << byteArr->getNumberOfTuples() << "\">";