1 // SMESH Driver : implementaion of driver for reading and writing
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHDriver.cxx
28 #include "SMESHDriver.h"
31 #include <utilities.h>
34 #include "DriverMED_R_SMESHDS_Document.h"
35 #include "DriverMED_R_SMESHDS_Mesh.h"
36 #include "DriverMED_R_SMDS_Mesh.h"
37 #include "DriverMED_W_SMESHDS_Document.h"
38 #include "DriverMED_W_SMESHDS_Mesh.h"
39 #include "DriverMED_W_SMDS_Mesh.h"
41 #include "DriverDAT_R_SMESHDS_Document.h"
42 #include "DriverDAT_R_SMESHDS_Mesh.h"
43 #include "DriverDAT_R_SMDS_Mesh.h"
44 #include "DriverDAT_W_SMESHDS_Document.h"
45 #include "DriverDAT_W_SMESHDS_Mesh.h"
46 #include "DriverDAT_W_SMDS_Mesh.h"
49 Document_Reader* SMESHDriver::GetDocumentReader(string Extension, string Class) {
50 if (Extension==string("MED")) {
51 DriverMED_R_SMESHDS_Document* myDriver = new DriverMED_R_SMESHDS_Document();
54 else if (Extension==string("DAT")) {
55 DriverDAT_R_SMESHDS_Document* myDriver = new DriverDAT_R_SMESHDS_Document();
59 MESSAGE("No driver known for this extension");
60 return (Document_Reader*)NULL;
66 Document_Writer* SMESHDriver::GetDocumentWriter(string Extension, string Class) {
67 if (Extension==string("MED")) {
68 DriverMED_W_SMESHDS_Document* myDriver = new DriverMED_W_SMESHDS_Document();
71 else if (Extension==string("DAT")) {
72 DriverDAT_W_SMESHDS_Document* myDriver = new DriverDAT_W_SMESHDS_Document();
76 MESSAGE("No driver known for this extension");
77 return (Document_Writer*)NULL;
83 Mesh_Reader* SMESHDriver::GetMeshReader(string Extension, string Class) {
84 if (Extension==string("MED")) {
86 if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
87 DriverMED_R_SMESHDS_Mesh* myDriver = new DriverMED_R_SMESHDS_Mesh();
90 else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
91 DriverMED_R_SMDS_Mesh* myDriver = new DriverMED_R_SMDS_Mesh();
96 else if (Extension==string("DAT")) {
98 if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
99 DriverDAT_R_SMESHDS_Mesh* myDriver = new DriverDAT_R_SMESHDS_Mesh();
102 else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
103 DriverDAT_R_SMDS_Mesh* myDriver = new DriverDAT_R_SMDS_Mesh();
112 Mesh_Writer* SMESHDriver::GetMeshWriter(string Extension, string Class) {
113 if (Extension==string("MED")) {
115 if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
116 DriverMED_W_SMESHDS_Mesh* myDriver = new DriverMED_W_SMESHDS_Mesh();
119 else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
120 DriverMED_W_SMDS_Mesh* myDriver = new DriverMED_W_SMDS_Mesh();
125 else if (Extension==string("DAT")) {
127 if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
128 DriverDAT_W_SMESHDS_Mesh* myDriver = new DriverDAT_W_SMESHDS_Mesh();
131 else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
132 DriverDAT_W_SMDS_Mesh* myDriver = new DriverDAT_W_SMDS_Mesh();