Salome HOME
NRI : Add GEOM includes and libs.
[modules/smesh.git] / src / Driver / SMESHDriver.cxx
1 using namespace std;
2 #include "SMESHDriver.h"
3
4 #include <dlfcn.h>
5 #include <utilities.h>
6
7 //A enlever
8 #include "DriverMED_R_SMESHDS_Document.h"
9 #include "DriverMED_R_SMESHDS_Mesh.h"
10 #include "DriverMED_R_SMDS_Mesh.h"
11 #include "DriverMED_W_SMESHDS_Document.h"
12 #include "DriverMED_W_SMESHDS_Mesh.h"
13 #include "DriverMED_W_SMDS_Mesh.h"
14
15 #include "DriverDAT_R_SMESHDS_Document.h"
16 #include "DriverDAT_R_SMESHDS_Mesh.h"
17 #include "DriverDAT_R_SMDS_Mesh.h"
18 #include "DriverDAT_W_SMESHDS_Document.h"
19 #include "DriverDAT_W_SMESHDS_Mesh.h"
20 #include "DriverDAT_W_SMDS_Mesh.h"
21 //
22
23 Document_Reader* SMESHDriver::GetDocumentReader(string Extension, string Class) {
24   if (Extension==string("MED")) {
25     DriverMED_R_SMESHDS_Document* myDriver = new DriverMED_R_SMESHDS_Document();
26     return (myDriver);
27   }
28   else if (Extension==string("DAT")) {
29     DriverDAT_R_SMESHDS_Document* myDriver = new DriverDAT_R_SMESHDS_Document();
30     return (myDriver);
31   }
32   else {
33     MESSAGE("No driver known for this extension");
34     return (Document_Reader*)NULL;
35   }
36
37
38 }
39
40 Document_Writer* SMESHDriver::GetDocumentWriter(string Extension, string Class) {
41   if (Extension==string("MED")) {
42     DriverMED_W_SMESHDS_Document* myDriver = new DriverMED_W_SMESHDS_Document();
43     return (myDriver);
44   }    
45   else if (Extension==string("DAT")) {
46     DriverDAT_W_SMESHDS_Document* myDriver = new DriverDAT_W_SMESHDS_Document();
47     return (myDriver);
48   }    
49   else {
50     MESSAGE("No driver known for this extension");
51     return (Document_Writer*)NULL;
52   }
53
54
55 }
56
57 Mesh_Reader* SMESHDriver::GetMeshReader(string Extension, string Class) {
58   if (Extension==string("MED")) {
59
60   if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
61     DriverMED_R_SMESHDS_Mesh* myDriver = new DriverMED_R_SMESHDS_Mesh();
62     return (myDriver);
63   }
64   else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
65     DriverMED_R_SMDS_Mesh* myDriver = new DriverMED_R_SMDS_Mesh();
66     return (myDriver);
67   }
68
69   }
70   else if (Extension==string("DAT")) {
71
72   if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
73     DriverDAT_R_SMESHDS_Mesh* myDriver = new DriverDAT_R_SMESHDS_Mesh();
74     return (myDriver);
75   }
76   else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
77     DriverDAT_R_SMDS_Mesh* myDriver = new DriverDAT_R_SMDS_Mesh();
78     return (myDriver);
79   }
80
81   }
82
83
84 }
85
86 Mesh_Writer* SMESHDriver::GetMeshWriter(string Extension, string Class) {
87   if (Extension==string("MED")) {
88
89   if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
90     DriverMED_W_SMESHDS_Mesh* myDriver = new DriverMED_W_SMESHDS_Mesh();
91     return (myDriver);
92   }
93   else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
94     DriverMED_W_SMDS_Mesh* myDriver = new DriverMED_W_SMDS_Mesh();
95     return (myDriver);
96   }
97
98   }
99   else if (Extension==string("DAT")) {
100
101   if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
102     DriverDAT_W_SMESHDS_Mesh* myDriver = new DriverDAT_W_SMESHDS_Mesh();
103     return (myDriver);
104   }
105   else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
106     DriverDAT_W_SMDS_Mesh* myDriver = new DriverDAT_W_SMDS_Mesh();
107     return (myDriver);
108   }
109
110   }
111
112 }
113