From: Anthony Geay Date: Fri, 17 Oct 2014 13:00:54 +0000 (+0200) Subject: Solve bug EDF#8655 definitely. X-Git-Tag: V7_5_0b1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f5dbfb52e5f1bebdf2b7ff0106868917f7fd9d5;p=modules%2Fparavis.git Solve bug EDF#8655 definitely. --- diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index 3669c63c..f9df2d33 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -1151,7 +1151,24 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam { MEDCouplingAutoRefCountObjectPtr fmts((*fields)->getFieldAtPos((int)j)); std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > tmp(fmts->splitDiscretizations()); - allFMTSLeavesToDisplaySafe.insert(allFMTSLeavesToDisplaySafe.end(),tmp.begin(),tmp.end()); + // EDF 8655 + for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::const_iterator it=tmp.begin();it!=tmp.end();it++) + { + if(!(*it)->presenceOfMultiDiscPerGeoType()) + allFMTSLeavesToDisplaySafe.push_back(*it); + else + {// The case of some parts of field have more than one discretization per geo type. + std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > subTmp((*it)->splitMultiDiscrPerGeoTypes()); + std::size_t it0Cnt(0); + for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::iterator it0=subTmp.begin();it0!=subTmp.end();it0++,it0Cnt++)//not const because setName + { + std::ostringstream oss; oss << (*it0)->getName() << "_" << std::setfill('M') << std::setw(3) << it0Cnt; + (*it0)->setName(oss.str()); + allFMTSLeavesToDisplaySafe.push_back(*it0); + } + } + } + // end EDF 8655 } } std::vector< MEDFileAnyTypeFieldMultiTS *> allFMTSLeavesToDisplay(allFMTSLeavesToDisplaySafe.size());