2 #include "DriverUNV_W_SMESHDS_Document.h"
3 #include "DriverUNV_W_SMESHDS_Mesh.h"
9 Document_Writer *Wmaker()
11 return new DriverUNV_W_SMESHDS_Document;
15 DriverUNV_W_SMESHDS_Document::DriverUNV_W_SMESHDS_Document()
20 DriverUNV_W_SMESHDS_Document::~DriverUNV_W_SMESHDS_Document()
25 //void DriverUNV_W_SMESHDS_Document::SetFile(string aFile) {
29 //void DriverUNV_W_SMESHDS_Document::SetDocument(Handle(SMESHDS_Document)& aDocument) {
30 //myDocument = aDocument;
33 void DriverUNV_W_SMESHDS_Document::Write()
36 SMESHDS_Mesh * myMesh;
38 /****************************************************************************
39 * OUVERTURE DU FICHIER EN ECRITURE *
40 ****************************************************************************/
41 char *file2Write = (char *)myFile.c_str();
42 FILE *fid = fopen(file2Write, "w+");
45 fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Write);
49 /****************************************************************************
50 * FERMETURE DU FICHIER *
51 ****************************************************************************/
55 /******** Nombre de maillages ********/
56 int nb_of_meshes = myDocument->NbMeshes(); //voir avec Yves
60 string myClass = string("SMESHDS_Mesh");
61 string myExtension = string("UNV");
63 //while (numero<nb_of_meshes) {
65 //myMesh = myDocument->GetMesh(numero);
66 myDocument->InitMeshesIterator();
67 while(myDocument->MoreMesh())
70 myMesh = myDocument->NextMesh();
72 DriverUNV_W_SMESHDS_Mesh *myWriter = new DriverUNV_W_SMESHDS_Mesh;
73 //Mesh_Writer* myWriter = Driver::GetMeshWriter(myExtension, myClass);
75 myWriter->SetMesh(myMesh);
76 myWriter->SetFile(myFile);
78 //myWriter->SetFileId(fid);
79 myWriter->SetMeshId(numero);