X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FDriverUNV%2FDriverUNV_R_SMESHDS_Document.cxx;h=0e1b871fcd7e0a6f668565c2ac9f178c9c8be26d;hp=8b904cf4c6a155921e4fc4d4ae493120b592ba21;hb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;hpb=51569f091c2d18be76ea9bd3e68ca0247cc731c3 diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx index 8b904cf4c..0e1b871fc 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx @@ -1,90 +1,20 @@ -using namespace std; -#include "DriverUNV_R_SMESHDS_Document.h" -#include "DriverUNV_R_SMESHDS_Mesh.h" - -#include "utilities.h" - -int getOne() -{ - printf("in getOne"); - return (1); -} - -extern "C" -{ - // Document_Reader* maker() { - DriverUNV_R_SMESHDS_Document *maker() - { - fprintf(stdout, "here in maker\n"); - return new DriverUNV_R_SMESHDS_Document; - } -} - -DriverUNV_R_SMESHDS_Document::DriverUNV_R_SMESHDS_Document() -{ - myFile = string(""); -} - -DriverUNV_R_SMESHDS_Document::~DriverUNV_R_SMESHDS_Document() -{ - ; -} - -//void DriverUNV_R_SMESHDS_Document::SetFile(string aFile) { -//myFile = aFile; -//} - -//void DriverUNV_R_SMESHDS_Document::SetDocument(Handle(SMESHDS_Document)& aDoc) { -//myDocument = aDoc; -//} - -void DriverUNV_R_SMESHDS_Document::Read() -{ - - int myMeshId; - 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); - } +// 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 - /**************************************************************************** - * 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("UNV"); - - for (int meshIt = 1; meshIt <= nmaa; meshIt++) - { - myMeshId = myDocument->NewMesh(); - - SMDS_Mesh * myMesh = myDocument->GetMesh(myMeshId); - - DriverUNV_R_SMESHDS_Mesh *myReader = new DriverUNV_R_SMESHDS_Mesh; - - myReader->SetMesh(myMesh); - myReader->SetFile(myFile); - //myReader->SetFileId(fid); - - myReader->Read(); - - } - -} +#include "DriverUNV_R_SMESHDS_Document.h"