X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverUNV%2FUNV2417_Structure.cxx;h=0f7313b76d8b995aeb25f7f22442fc2ff28aadd8;hb=84e136e74b2bc729df20617a9968439919337a55;hp=67d2cbe25d52a80c130d292d517300fad625a684;hpb=c63ee099ad2b149bd70136839c973e8910137bc5;p=modules%2Fsmesh.git diff --git a/src/DriverUNV/UNV2417_Structure.cxx b/src/DriverUNV/UNV2417_Structure.cxx index 67d2cbe25..0f7313b76 100644 --- a/src/DriverUNV/UNV2417_Structure.cxx +++ b/src/DriverUNV/UNV2417_Structure.cxx @@ -1,26 +1,29 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// 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. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #include "UNV2417_Structure.hxx" #include "UNV_Utilities.hxx" -#include +#include #include using namespace std; @@ -34,8 +37,9 @@ static int MYDEBUG = 0; #endif -static string _group_labels[] = {"2417", "2429", "2430", "2432", "2435", "2452", "2467"}; -#define NBGROUP 7 +static string _group_labels[] = {"2417", "2429", "2430", "2432", + "2435", "2452", "2467", "2477"}; +#define NBGROUP 8 static string _label_dataset = "2467"; @@ -52,7 +56,7 @@ void UNV2417::Read(std::ifstream& in_stream, TDataSet& theDataSet) * a "-1" followed by a number means the beginning of a dataset * stop combing at the end of the file */ - while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){ + while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){ olds = news; in_stream >> news; } @@ -60,7 +64,7 @@ void UNV2417::Read(std::ifstream& in_stream, TDataSet& theDataSet) return; for (int i = 0; i < NBGROUP; i++) { if (news == _group_labels[i]) { - ReadGroup(news, in_stream, theDataSet); + ReadGroup(news, in_stream, theDataSet); } } } @@ -91,28 +95,31 @@ void UNV2417::ReadGroup(const std::string& myGroupLabel, std::ifstream& in_strea std::getline(in_stream, aRec.GroupName, '\n'); // Finalise previous reading std::getline(in_stream, aRec.GroupName, '\n'); - + int aElType; int aElId; int aNum; for(int j=0; j < n_nodes; j++){ in_stream>>aElType; in_stream>>aElId; - if ((myGroupLabel.compare("2435") == 0) || (myGroupLabel.compare("2452") == 0) || (myGroupLabel.compare("2467") == 0)) { - in_stream>>aTmp; - in_stream>>aTmp; + if ((myGroupLabel.compare("2435") == 0) || + (myGroupLabel.compare("2452") == 0) || + (myGroupLabel.compare("2467") == 0) || + (myGroupLabel.compare("2477") == 0)) { + in_stream>>aTmp; + in_stream>>aTmp; } switch (aElType) { case 7: // Nodes - aNum = aRec.NodeList.size(); - aRec.NodeList.resize(aNum + 1); - aRec.NodeList[aNum] = aElId; - break; + aNum = aRec.NodeList.size(); + aRec.NodeList.resize(aNum + 1); + aRec.NodeList[aNum] = aElId; + break; case 8: // Elements - aNum = aRec.ElementList.size(); - aRec.ElementList.resize(aNum + 1); - aRec.ElementList[aNum] = aElId; - break; + aNum = aRec.ElementList.size(); + aRec.ElementList.resize(aNum + 1); + aRec.ElementList[aNum] = aElId; + break; } } theDataSet.insert(TDataSet::value_type(aId,aRec)); @@ -154,8 +161,8 @@ void UNV2417::Write(std::ofstream& out_stream, const TDataSet& theDataSet) int i; for (i = 0; i < aNbNodes; i++) { if (aRow == 2) { - out_stream<