Salome HOME
Overload of MEDLoader.ReadField method to ease access of medcoupling for new comers
[tools/medcoupling.git] / src / MEDLoader / MEDFileMeshReadSelector.cxx
index 945d02b168aa1322972ac0366a543740bf3f5c9c..3a48c27313891a32513c1b16847577d89333e416 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  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
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,7 @@
 
 #include "MEDFileMeshReadSelector.hxx"
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 MEDFileMeshReadSelector::MEDFileMeshReadSelector():_code(0xFFFFFFFF)
 {
@@ -60,6 +60,16 @@ bool MEDFileMeshReadSelector::isNodeNameFieldReading() const
   return _code & 0x00000008;
 }
 
+bool MEDFileMeshReadSelector::isCellNumFieldReading() const
+{
+  return _code & 0x00000010;
+}
+
+bool MEDFileMeshReadSelector::isNodeNumFieldReading() const
+{
+  return _code & 0x00000020;
+}
+
 void MEDFileMeshReadSelector::setCellFamilyFieldReading(bool b)
 {
   unsigned int code(_code & 0xFFFFFFFE);
@@ -96,13 +106,33 @@ void MEDFileMeshReadSelector::setNodeNameFieldReading(bool b)
   _code=code;
 }
 
+void MEDFileMeshReadSelector::setCellNumFieldReading(bool b)
+{
+  unsigned int code(_code & 0xFFFFFFEF);
+  unsigned int b2=b?1:0;
+  b2<<=4;
+  code+=b2;
+  _code=code;
+}
+
+void MEDFileMeshReadSelector::setNodeNumFieldReading(bool b)
+{
+  unsigned int code(_code & 0xFFFFFFDF);
+  unsigned int b2=b?1:0;
+  b2<<=5;
+  code+=b2;
+  _code=code;
+}
+
 void MEDFileMeshReadSelector::reprAll(std::ostream& str) const
 {
   str << "MEDFileMeshReadSelector (code=" << _code << ") : \n";
   str << "Read family field on cells : " << ReprStatus(isCellFamilyFieldReading()) << std::endl;
   str << "Read family field on nodes : " << ReprStatus(isNodeFamilyFieldReading()) << std::endl;
-  str << "Read family name on cells : " << ReprStatus(isCellNameFieldReading()) << std::endl;
-  str << "Read family name on nodes : " << ReprStatus(isNodeNameFieldReading());
+  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());
 }
 
 std::string MEDFileMeshReadSelector::ReprStatus(bool v)