From: ageay Date: Fri, 8 Feb 2013 13:56:41 +0000 (+0000) Subject: VTK writing of cartesian mesh X-Git-Tag: V6_main_FINAL~368 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=449c2b01289e10b01731d3f68b9979d08e865566;p=tools%2Fmedcoupling.git VTK writing of cartesian mesh --- diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index becd3169c..1ae822817 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -736,7 +736,36 @@ void MEDCouplingCMesh::unserialization(const std::vector& tinyInfoD, con void MEDCouplingCMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception) { - throw INTERP_KERNEL::Exception("MEDCouplingCMesh::writeVTKLL : not implemented yet !"); + std::ostringstream extent; + DataArrayDouble *thisArr[3]={_x_array,_y_array,_z_array}; + for(int i=0;i<3;i++) + { + if(thisArr[i]) + { extent << "0 " << thisArr[i]->getNumberOfTuples()-1 << " "; } + else + { extent << "0 0 "; } + } + ofs << " <" << getVTKDataSetType() << " WholeExtent=\"" << extent.str() << "\">\n"; + ofs << " \n"; + ofs << " \n" << pointData << std::endl; + ofs << " \n"; + ofs << " \n" << cellData << std::endl; + ofs << " \n"; + ofs << " \n"; + for(int i=0;i<3;i++) + { + if(thisArr[i]) + thisArr[i]->writeVTK(ofs,8,"Array"); + else + { + MEDCouplingAutoRefCountObjectPtr coo=DataArrayDouble::New(); coo->alloc(1,1); + coo->setIJ(0,0,0.); + coo->writeVTK(ofs,8,"Array"); + } + } + ofs << " \n"; + ofs << " \n"; + ofs << " \n"; } std::string MEDCouplingCMesh::getVTKDataSetType() const throw(INTERP_KERNEL::Exception)