X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileFieldOverView.cxx;h=8f2d9bc2d7376e67f9bc01e3a290ab81aab405e5;hb=1b0f297f9ff050751963bb9bece9fd09f3156560;hp=8a52bf254091939ea398b5c06cc83594693af257;hpb=1e36a6710aab710674e20fbd89f6a9a8f238c023;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileFieldOverView.cxx b/src/MEDLoader/MEDFileFieldOverView.cxx index 8a52bf254..8f2d9bc2d 100644 --- a/src/MEDLoader/MEDFileFieldOverView.cxx +++ b/src/MEDLoader/MEDFileFieldOverView.cxx @@ -391,6 +391,30 @@ void MEDMeshMultiLev::retrieveNumberIdsOnNodes(DataArrayInt *& numIds, bool& isW } } +/*! + * This method returns, if any, a new object containing the global node ids **BUT CONTRARY TO OTHER RETRIEVE METHODS** the returned object is always a NON AGGREGATED object. So the returned object if not null + * can be used as this safely. + */ +DataArrayInt *MEDMeshMultiLev::retrieveGlobalNodeIdsIfAny() const +{ + const MEDFileUMesh *umesh(dynamic_cast(_mesh)); + if(!umesh) + return 0; + const PartDefinition *pd(umesh->getPartDefAtLevel(1)); + if(!pd) + return 0; + MCAuto tmp(pd->toDAI()); + const DataArrayInt *tmpCpp(tmp); + if(!tmpCpp) + return 0; + // + const DataArrayInt *nr(_node_reduction); + if(nr) + return tmp->selectByTupleIdSafe(nr->begin(),nr->end()); + else + return tmp->deepCopy();// Yes a deep copy is needed because this method has to return a non aggregated object ! +} + std::vector< INTERP_KERNEL::NormalizedCellType > MEDMeshMultiLev::getGeoTypes() const { return _geo_types;