Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/smesh.git] / src / DriverMED / DriverMED_W_SMESHDS_Mesh.h
1 //  SMESH DriverMED : driver to read and write 'med' files
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DriverMED_W_SMESHDS_Mesh.h
25 //  Module : SMESH
26
27 #ifndef _INCLUDE_DRIVERMED_W_SMESHDS_MESH
28 #define _INCLUDE_DRIVERMED_W_SMESHDS_MESH
29
30 #include "SMESHDS_Mesh.hxx"
31 #include "Mesh_Writer.h"
32
33 #include <string>
34 #include <list>
35 #include <map>
36
37 extern "C"
38 {
39 #include <med.h>
40 }
41
42 using namespace std;
43
44 class SMESHDS_Group;
45 class SMESHDS_SubMesh;
46
47 class DriverMED_W_SMESHDS_Mesh:public Mesh_Writer
48 {
49   public:
50
51   DriverMED_W_SMESHDS_Mesh();
52   ~DriverMED_W_SMESHDS_Mesh();
53
54   /*! sets file name; only for usage with Add(), not Write()
55    */
56   void SetFile(string);
57   void AddGroupOfNodes();
58   void AddGroupOfEdges();
59   void AddGroupOfFaces();
60   void AddGroupOfVolumes();
61
62   /*! functions to prepare adding one mesh
63    */
64   void SetMesh(SMDS_Mesh * aMesh);
65   void SetMeshId(int);
66   void SetMeshName(string theMeshName);
67   void AddGroup(SMESHDS_Group* theGroup);
68   void AddAllSubMeshes();
69   void AddSubMesh(SMESHDS_SubMesh* theSubMesh, int theID);
70
71   /*! add one mesh
72    */
73   void Add();
74
75   /*! functions to write via DriverMED_W_SMDS_Mesh (no groups)
76    */
77   void SetFileId(med_idt);
78   void Write();
79
80  private:
81
82   SMDS_Mesh * myMesh;
83   string myFile;
84   med_idt myFileId;
85   int myMeshId;
86   string myMeshName;
87   list<SMESHDS_Group*> myGroups;
88   bool myAllSubMeshes;
89   map<int,SMESHDS_SubMesh*> mySubMeshes;
90   bool myDoGroupOfNodes;
91   bool myDoGroupOfEdges;
92   bool myDoGroupOfFaces;
93   bool myDoGroupOfVolumes;
94 };
95 #endif
96