2 #include "DriverUNV_R_SMESHDS_Document.h"
3 #include "DriverUNV_R_SMESHDS_Mesh.h"
13 // Document_Reader* maker() {
14 DriverUNV_R_SMESHDS_Document* maker() {
15 fprintf(stdout,"here in maker\n");
16 return new DriverUNV_R_SMESHDS_Document;
20 DriverUNV_R_SMESHDS_Document::DriverUNV_R_SMESHDS_Document() {
24 DriverUNV_R_SMESHDS_Document::~DriverUNV_R_SMESHDS_Document() {
28 //void DriverUNV_R_SMESHDS_Document::SetFile(string aFile) {
32 //void DriverUNV_R_SMESHDS_Document::SetDocument(Handle(SMESHDS_Document)& aDoc) {
36 void DriverUNV_R_SMESHDS_Document::Read() {
40 //Handle(SMESHDS_Document) myDocument = new SMESHDS_Document(1);
42 /****************************************************************************
43 * OUVERTURE DU FICHIER EN LECTURE *
44 ****************************************************************************/
45 char* file2Read = (char*)myFile.c_str();
46 FILE* fid = fopen(file2Read,"r");
49 fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Read);
53 /****************************************************************************
54 * COMBIEN DE MAILLAGES ? *
55 ****************************************************************************/
58 /****************************************************************************
59 * FERMETURE DU FICHIER *
60 ****************************************************************************/
63 printf("Nombre de maillages = %d\n",nmaa);
65 string myClass = string("SMESHDS_Mesh");
66 string myExtension = string("UNV");
68 for (int meshIt=1;meshIt<=nmaa;meshIt++) {
69 myMeshId = myDocument->NewMesh();
71 Handle(SMDS_Mesh) myMesh = myDocument->GetMesh(myMeshId);
73 DriverUNV_R_SMESHDS_Mesh* myReader = new DriverUNV_R_SMESHDS_Mesh;
76 myReader->SetMesh(myMesh);
77 myReader->SetFile(myFile);
78 //myReader->SetFileId(fid);