2 #include "DriverDAT_R_SMESHDS_Document.h"
3 #include "DriverDAT_R_SMESHDS_Mesh.h"
13 // Document_Reader* maker() {
14 DriverDAT_R_SMESHDS_Document* maker() {
15 fprintf(stdout,"here in maker\n");
16 return new DriverDAT_R_SMESHDS_Document;
20 DriverDAT_R_SMESHDS_Document::DriverDAT_R_SMESHDS_Document() {
24 DriverDAT_R_SMESHDS_Document::~DriverDAT_R_SMESHDS_Document() {
28 //void DriverDAT_R_SMESHDS_Document::SetFile(string aFile) {
32 //void DriverDAT_R_SMESHDS_Document::SetDocument(Handle(SMESHDS_Document)& aDoc) {
36 void DriverDAT_R_SMESHDS_Document::Read() {
41 //Handle(SMESHDS_Document) myDocument = new SMESHDS_Document(1);
43 /****************************************************************************
44 * OUVERTURE DU FICHIER EN LECTURE *
45 ****************************************************************************/
46 char* file2Read = (char*)myFile.c_str();
47 FILE* fid = fopen(file2Read,"r");
50 fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Read);
54 /****************************************************************************
55 * COMBIEN DE MAILLAGES ? *
56 ****************************************************************************/
59 /****************************************************************************
60 * FERMETURE DU FICHIER *
61 ****************************************************************************/
64 printf("Nombre de maillages = %d\n",nmaa);
66 string myClass = string("SMESHDS_Mesh");
67 string myExtension = string("DAT");
69 for (int meshIt=1;meshIt<=nmaa;meshIt++) {
70 myMeshId = myDocument->NewMesh();
72 Handle(SMDS_Mesh) myMesh = myDocument->GetMesh(myMeshId);
74 DriverDAT_R_SMESHDS_Mesh* myReader = new DriverDAT_R_SMESHDS_Mesh;
77 myReader->SetMesh(myMesh);
78 myReader->SetFile(myFile);
79 //myReader->SetFileId(fid);