Salome HOME
writeVTK for image grid
authorgeay <anthony.geay@cea.fr>
Mon, 28 Apr 2014 16:46:19 +0000 (18:46 +0200)
committergeay <anthony.geay@cea.fr>
Mon, 28 Apr 2014 16:46:19 +0000 (18:46 +0200)
src/MEDCoupling/MEDCouplingIMesh.cxx

index 6ef737b8ed5562ad42ef79d67a65af1972a0f1dd..43dd40d2cdb79ce2ba91379031d1be6c2c9336aa 100644 (file)
@@ -670,15 +670,15 @@ void MEDCouplingIMesh::unserialization(const std::vector<double>& tinyInfoD, con
 void MEDCouplingIMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const
 {
   checkCoherency();
 void MEDCouplingIMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const
 {
   checkCoherency();
-  std::ostringstream extent;
+  std::ostringstream extent,origin,spacing;
   for(int i=0;i<3;i++)
     {
       if(i<_space_dim)
   for(int i=0;i<3;i++)
     {
       if(i<_space_dim)
-        { extent << "0 " <<  _structure[i]-1 << " "; }
+        { extent << "0 " <<  _structure[i]-1 << " "; origin << _origin[i] << " "; spacing << _dxyz[i] << " "; }
       else
       else
-        { extent << "0 0 "; }
+        { extent << "0 0 "; origin << "0 "; spacing << "0 "; }
     }
     }
-  ofs << "  <" << getVTKDataSetType() << " WholeExtent=\"" << extent.str() << "\">\n";
+  ofs << "  <" << getVTKDataSetType() << " WholeExtent=\"" << extent.str() << "\" Origin=\"" << origin.str() << "\" Spacing=\"" << spacing.str() << "\">\n";
   ofs << "    <Piece Extent=\"" << extent.str() << "\">\n";
   ofs << "      <PointData>\n" << pointData << std::endl;
   ofs << "      </PointData>\n";
   ofs << "    <Piece Extent=\"" << extent.str() << "\">\n";
   ofs << "      <PointData>\n" << pointData << std::endl;
   ofs << "      </PointData>\n";