X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FIO%2FMEDFileFieldRepresentationTree.cxx;h=b3512390494ebdf34402d64cd8e12af539acb7d1;hb=a833b1388f958c887b2b0886fc40a8be0256e2c8;hp=6cf1d8034caae68beeeadd883a4de46d51dd91c9;hpb=f50743d07c99b985dd078aad0fb4bbf7337851cc;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index 6cf1d803..b3512390 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2014 CEA/DEN, EDF R&D +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -535,6 +535,12 @@ bool MEDFileFieldRepresentationLeaves::containZeName(const char *name, int& id) return false; } +void MEDFileFieldRepresentationLeaves::dumpState(std::map& status) const +{ + for(std::vector::const_iterator it=_arrays.begin();it!=_arrays.end();it++) + status[(*it).getZeName()]=(*it).getStatus(); +} + bool MEDFileFieldRepresentationLeaves::isActivated() const { for(std::vector::const_iterator it=_arrays.begin();it!=_arrays.end();it++) @@ -1393,6 +1399,16 @@ void MEDFileFieldRepresentationTree::printMySelf(std::ostream& os) const os << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" << std::endl; } +std::map MEDFileFieldRepresentationTree::dumpState() const +{ + std::map ret; + for(std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > >::const_iterator it0=_data_structure.begin();it0!=_data_structure.end();it0++) + for(std::vector< std::vector< MEDFileFieldRepresentationLeaves > >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++) + for(std::vector< MEDFileFieldRepresentationLeaves >::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++) + (*it2).dumpState(ret); + return ret; +} + void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms, ParaMEDMEM::MEDFileFields *ret) { if(!ret) @@ -1404,53 +1420,53 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f1tsMultiLev(ParaMEDMEM::MEDFileField1TS::New()); MEDFileUMesh *mmu(dynamic_cast(mm)); if(mmu) - { - for(std::vector::const_iterator it=levs.begin();it!=levs.end();it++) - { - std::vector gts(mmu->getGeoTypesAtLevel(*it)); - for(std::vector::const_iterator gt=gts.begin();gt!=gts.end();gt++) - { - ParaMEDMEM::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); - f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); - arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); - arr->iota(); - f->setArray(arr); - f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); - f1tsMultiLev->setFieldNoProfileSBT(f); - } - } - if(levs.empty()) - { - std::vector levsExt(mm->getNonEmptyLevelsExt()); - if(levsExt.size()==levs.size()+1) - { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(1)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES)); - f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); - arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); - arr->iota(); f->setArray(arr); - f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); - f1tsMultiLev->setFieldNoProfileSBT(f); - } - else - continue; - } - } + { + for(std::vector::const_iterator it=levs.begin();it!=levs.end();it++) + { + std::vector gts(mmu->getGeoTypesAtLevel(*it)); + for(std::vector::const_iterator gt=gts.begin();gt!=gts.end();gt++) + { + ParaMEDMEM::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); + f->setMesh(m); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); + arr->iota(); + f->setArray(arr); + f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); + f1tsMultiLev->setFieldNoProfileSBT(f); + } + } + if(levs.empty()) + { + std::vector levsExt(mm->getNonEmptyLevelsExt()); + if(levsExt.size()==levs.size()+1) + { + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(1)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES)); + f->setMesh(m); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); + arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); + arr->iota(); f->setArray(arr); + f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); + f1tsMultiLev->setFieldNoProfileSBT(f); + } + else + continue; + } + } else - { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(0)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); - f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); - arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); - arr->iota(); - f->setArray(arr); - f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); - f1tsMultiLev->setFieldNoProfileSBT(f); - } + { + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(0)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); + f->setMesh(m); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); + arr->iota(); + f->setArray(arr); + f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); + f1tsMultiLev->setFieldNoProfileSBT(f); + } // ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr fmtsMultiLev(ParaMEDMEM::MEDFileFieldMultiTS::New()); fmtsMultiLev->pushBackTimeStep(f1tsMultiLev);