1 // SMESH DriverUNV : driver to read and write 'unv' files
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : DriverUNV_R_SMESHDS_Document.cxx
28 #include "DriverUNV_R_SMESHDS_Document.h"
29 #include "DriverUNV_R_SMESHDS_Mesh.h"
31 #include "utilities.h"
39 // Document_Reader* maker() {
40 DriverUNV_R_SMESHDS_Document* maker() {
41 fprintf(stdout,"here in maker\n");
42 return new DriverUNV_R_SMESHDS_Document;
46 DriverUNV_R_SMESHDS_Document::DriverUNV_R_SMESHDS_Document() {
50 DriverUNV_R_SMESHDS_Document::~DriverUNV_R_SMESHDS_Document() {
54 //void DriverUNV_R_SMESHDS_Document::SetFile(string aFile) {
58 //void DriverUNV_R_SMESHDS_Document::SetDocument(Handle(SMESHDS_Document)& aDoc) {
62 void DriverUNV_R_SMESHDS_Document::Read() {
66 //Handle(SMESHDS_Document) myDocument = new SMESHDS_Document(1);
68 /****************************************************************************
69 * OUVERTURE DU FICHIER EN LECTURE *
70 ****************************************************************************/
71 char* file2Read = (char*)myFile.c_str();
72 FILE* fid = fopen(file2Read,"r");
75 fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Read);
79 /****************************************************************************
80 * COMBIEN DE MAILLAGES ? *
81 ****************************************************************************/
84 /****************************************************************************
85 * FERMETURE DU FICHIER *
86 ****************************************************************************/
89 printf("Nombre de maillages = %d\n",nmaa);
91 string myClass = string("SMESHDS_Mesh");
92 string myExtension = string("UNV");
94 for (int meshIt=1;meshIt<=nmaa;meshIt++) {
95 myMeshId = myDocument->NewMesh();
97 Handle(SMDS_Mesh) myMesh = myDocument->GetMesh(myMeshId);
99 DriverUNV_R_SMESHDS_Mesh* myReader = new DriverUNV_R_SMESHDS_Mesh;
102 myReader->SetMesh(myMesh);
103 myReader->SetFile(myFile);
104 //myReader->SetFileId(fid);