X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileMeshReadSelector.cxx;h=55b1bab34d17270718b3fd3bde3032832f6ca9d4;hb=b307fa3ee9c6d9e08082e2ccc832b28a17fd6d2c;hp=913aeafe6ceea543bb4335bbe7290c156e29294c;hpb=75943f980f7b908052ef03c2c0154508f4b0a039;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileMeshReadSelector.cxx b/src/MEDLoader/MEDFileMeshReadSelector.cxx index 913aeafe6..55b1bab34 100644 --- a/src/MEDLoader/MEDFileMeshReadSelector.cxx +++ b/src/MEDLoader/MEDFileMeshReadSelector.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 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 @@ -16,13 +16,17 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Anthony Geay (CEA/DEN) +// Author : Anthony Geay (EDF R&D) #include "MEDFileMeshReadSelector.hxx" -using namespace ParaMEDMEM; +#include "InterpKernelException.hxx" -MEDFileMeshReadSelector::MEDFileMeshReadSelector():_code(0xFFFFFFFF) +#include + +using namespace MEDCoupling; + +MEDFileMeshReadSelector::MEDFileMeshReadSelector():_nb_coords_load_sessions(1),_code(0xFFFFFFFF) { } @@ -40,6 +44,13 @@ void MEDFileMeshReadSelector::setCode(unsigned int newCode) _code=newCode; } +void MEDFileMeshReadSelector::setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions) +{ + if(newNbOfCoordsLoadSessions < 1) + throw INTERP_KERNEL::Exception("MEDFileMeshReadSelector::setNumberOfCoordsLoadSessions : input must be >= 1 !"); + _nb_coords_load_sessions = newNbOfCoordsLoadSessions; +} + bool MEDFileMeshReadSelector::isCellFamilyFieldReading() const { return _code & 0x00000001; @@ -70,6 +81,11 @@ bool MEDFileMeshReadSelector::isNodeNumFieldReading() const return _code & 0x00000020; } +bool MEDFileMeshReadSelector::isGlobalNodeNumFieldReading() const +{ + return _code & 0x00000040; +} + void MEDFileMeshReadSelector::setCellFamilyFieldReading(bool b) { unsigned int code(_code & 0xFFFFFFFE); @@ -124,15 +140,26 @@ void MEDFileMeshReadSelector::setNodeNumFieldReading(bool b) _code=code; } +void MEDFileMeshReadSelector::setGlobalNodeNumFieldReading(bool b) +{ + unsigned int code(_code & 0xFFFFFFBF); + unsigned int b2=b?1:0; + b2<<=6; + code+=b2; + _code=code; +} + void MEDFileMeshReadSelector::reprAll(std::ostream& str) const { str << "MEDFileMeshReadSelector (code=" << _code << ") : \n"; + str << "Number of coords load part sessions : " << this->_nb_coords_load_sessions << std::endl; str << "Read family field on cells : " << ReprStatus(isCellFamilyFieldReading()) << std::endl; str << "Read family field on nodes : " << ReprStatus(isNodeFamilyFieldReading()) << std::endl; str << "Read name field on cells : " << ReprStatus(isCellNameFieldReading()) << std::endl; str << "Read name field on nodes : " << ReprStatus(isNodeNameFieldReading()) << std::endl; str << "Read number field on cells : " << ReprStatus(isCellNumFieldReading()) << std::endl; - str << "Read number field name on nodes : " << ReprStatus(isNodeNumFieldReading()); + str << "Read number field name on nodes : " << ReprStatus(isNodeNumFieldReading()) << std::endl; + str << "Read global number field name on nodes : " << ReprStatus(isGlobalNodeNumFieldReading()); } std::string MEDFileMeshReadSelector::ReprStatus(bool v)