1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "UNV164_Structure.hxx"
24 #include "UNV_Utilities.hxx"
32 using namespace UNV164;
34 static string _label_dataset = "164";
36 void UNV164::Read(std::ifstream& in_stream, TRecord& theUnitsRecord )
39 EXCEPTION(runtime_error,"ERROR: Input file not good.");
41 if(!beginning_of_dataset(in_stream,_label_dataset))
45 char line[theMaxLineLen];
47 in_stream >> theUnitsRecord.units_code;
48 in_stream.readsome( line, 20 );
49 theUnitsRecord.units_description = line;
50 in_stream >> theUnitsRecord.temp_mode;
52 for ( int i = 0; i < 4; i++ )
55 theUnitsRecord.factors[i] = D_to_e(num_buf);
59 void UNV164::Write(std::ofstream& out_stream)
61 if(!out_stream.good())
62 EXCEPTION(runtime_error,"ERROR: Output file not good.");
64 out_stream<<" -1" << endl;
65 out_stream<<" "<<_label_dataset << endl;
67 out_stream<<" 1 SI: Meter (newton) 2" << endl;
68 out_stream<<" 1.0000000000000000E+0 1.0000000000000000E+0 1.0000000000000000E+0" << endl;
69 out_stream<<" 2.7314999999999998E+2" << endl;
71 out_stream<<" -1" << endl;
74 UNV164::TRecord::TRecord()
77 units_description = "SI: Meter (newton)";