1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #include "MEDFileMeshReadSelector.hxx"
23 using namespace ParaMEDMEM;
25 MEDFileMeshReadSelector::MEDFileMeshReadSelector():_code(0xFFFFFFFF)
29 MEDFileMeshReadSelector::MEDFileMeshReadSelector(unsigned int code):_code(code)
33 unsigned int MEDFileMeshReadSelector::getCode() const
38 void MEDFileMeshReadSelector::setCode(unsigned int newCode)
43 bool MEDFileMeshReadSelector::isCellFamilyFieldReading() const
45 return _code & 0x00000001;
48 bool MEDFileMeshReadSelector::isNodeFamilyFieldReading() const
50 return _code & 0x00000002;
53 bool MEDFileMeshReadSelector::isCellNameFieldReading() const
55 return _code & 0x00000004;
58 bool MEDFileMeshReadSelector::isNodeNameFieldReading() const
60 return _code & 0x00000008;
63 bool MEDFileMeshReadSelector::isCellNumFieldReading() const
65 return _code & 0x00000010;
68 bool MEDFileMeshReadSelector::isNodeNumFieldReading() const
70 return _code & 0x00000020;
73 void MEDFileMeshReadSelector::setCellFamilyFieldReading(bool b)
75 unsigned int code(_code & 0xFFFFFFFE);
76 unsigned int b2=b?1:0;
82 void MEDFileMeshReadSelector::setNodeFamilyFieldReading(bool b)
84 unsigned int code(_code & 0xFFFFFFFD);
85 unsigned int b2=b?1:0;
91 void MEDFileMeshReadSelector::setCellNameFieldReading(bool b)
93 unsigned int code(_code & 0xFFFFFFFB);
94 unsigned int b2=b?1:0;
100 void MEDFileMeshReadSelector::setNodeNameFieldReading(bool b)
102 unsigned int code(_code & 0xFFFFFFF7);
103 unsigned int b2=b?1:0;
109 void MEDFileMeshReadSelector::setCellNumFieldReading(bool b)
111 unsigned int code(_code & 0xFFFFFFEF);
112 unsigned int b2=b?1:0;
118 void MEDFileMeshReadSelector::setNodeNumFieldReading(bool b)
120 unsigned int code(_code & 0xFFFFFFDF);
121 unsigned int b2=b?1:0;
127 void MEDFileMeshReadSelector::reprAll(std::ostream& str) const
129 str << "MEDFileMeshReadSelector (code=" << _code << ") : \n";
130 str << "Read family field on cells : " << ReprStatus(isCellFamilyFieldReading()) << std::endl;
131 str << "Read family field on nodes : " << ReprStatus(isNodeFamilyFieldReading()) << std::endl;
132 str << "Read name field on cells : " << ReprStatus(isCellNameFieldReading()) << std::endl;
133 str << "Read name field on nodes : " << ReprStatus(isNodeNameFieldReading()) << std::endl;
134 str << "Read number field on cells : " << ReprStatus(isCellNumFieldReading()) << std::endl;
135 str << "Read number field name on nodes : " << ReprStatus(isNodeNumFieldReading());
138 std::string MEDFileMeshReadSelector::ReprStatus(bool v)
141 return std::string("ON");
143 return std::string("OFF");