X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverDAT%2FDriverDAT_R_SMESHDS_Document.cxx;h=b9bc993b70d84d3d6361fbeeff6ea15b8df6e795;hb=062f1da5dde14e9ca8755c2eda44cbe8850f1d3a;hp=fe360369795ae63a7e109f2a2c18380c4596c62b;hpb=8d2ecd75b04ac82778c48882c4f19d4561be0985;p=modules%2Fsmesh.git diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx index fe3603697..b9bc993b7 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.cxx @@ -1,117 +1,23 @@ -// SMESH DriverDAT : driver to read and write 'dat' files +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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. -// -// 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. -// -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // +// 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. // +// 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. +// +// 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 // -// File : DriverDAT_R_SMESHDS_Document.cxx -// Module : SMESH -using namespace std; #include "DriverDAT_R_SMESHDS_Document.h" -#include "DriverDAT_R_SMESHDS_Mesh.h" - -#include "utilities.h" - -int getOne() -{ - printf("in getOne"); - return (1); -} - -extern "C" -{ - // Document_Reader* maker() { - DriverDAT_R_SMESHDS_Document *maker() - { - fprintf(stdout, "here in maker\n"); - return new DriverDAT_R_SMESHDS_Document; - } -} - -DriverDAT_R_SMESHDS_Document::DriverDAT_R_SMESHDS_Document() -{ - myFile = string(""); -} - -DriverDAT_R_SMESHDS_Document::~DriverDAT_R_SMESHDS_Document() -{ - ; -} - -//void DriverDAT_R_SMESHDS_Document::SetFile(string aFile) { -//myFile = aFile; -//} - -//void DriverDAT_R_SMESHDS_Document::SetDocument(Handle(SMESHDS_Document)& aDoc) { -//myDocument = aDoc; -//} - -void DriverDAT_R_SMESHDS_Document::Read() -{ - - int myMeshId; - MESSAGE("in read"); - SCRUTE(myFile); - //Handle(SMESHDS_Document) myDocument = new SMESHDS_Document(1); - - /**************************************************************************** - * OUVERTURE DU FICHIER EN LECTURE * - ****************************************************************************/ - char *file2Read = (char *)myFile.c_str(); - FILE *fid = fopen(file2Read, "r"); - if (fid < 0) - { - fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read); - exit(EXIT_FAILURE); - } - - /**************************************************************************** - * COMBIEN DE MAILLAGES ? * - ****************************************************************************/ - int nmaa = 1; - - /**************************************************************************** - * FERMETURE DU FICHIER * - ****************************************************************************/ - fclose(fid); - - printf("Nombre de maillages = %d\n", nmaa); - - string myClass = string("SMESHDS_Mesh"); - string myExtension = string("DAT"); - - for (int meshIt = 1; meshIt <= nmaa; meshIt++) - { - myMeshId = myDocument->NewMesh(); - - SMDS_Mesh * myMesh = myDocument->GetMesh(myMeshId); - - DriverDAT_R_SMESHDS_Mesh *myReader = new DriverDAT_R_SMESHDS_Mesh; - - myReader->SetMesh(myMesh); - myReader->SetFile(myFile); - //myReader->SetFileId(fid); - - myReader->Read(); - - } - -}