1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #include "MEDCouplingFieldServant.hxx"
22 #include "MEDCouplingMeshServant.hxx"
23 #include "MEDCouplingUMeshServant.hxx"
24 #include "MEDCouplingCMeshServant.hxx"
25 #include "MEDCouplingIMeshServant.hxx"
26 #include "MEDCouplingCurveLinearMeshServant.hxx"
27 #include "MEDCouplingExtrudedMeshServant.hxx"
28 #include "MEDCoupling1SGTUMeshServant.hxx"
29 #include "MEDCoupling1DGTUMeshServant.hxx"
30 #include "MEDCouplingField.hxx"
31 #include "MEDCouplingUMesh.hxx"
32 #include "MEDCouplingCMesh.hxx"
33 #include "MEDCouplingIMesh.hxx"
34 #include "MEDCouplingCurveLinearMesh.hxx"
35 #include "MEDCouplingExtrudedMesh.hxx"
36 #include "MEDCoupling1GTUMesh.hxx"
38 using namespace MEDCoupling;
40 MEDCouplingFieldServant::MEDCouplingFieldServant(const MEDCouplingField *cppPointerOfMesh):MEDCouplingRefCountServant(cppPointerOfMesh,cppPointerOfMesh)
44 SALOME_MED::MEDCouplingMeshCorbaInterface_ptr MEDCouplingFieldServant::BuildCorbaRefFromCppPointer(const MEDCouplingMesh *mesh)
46 const MEDCouplingUMesh *uMesh=dynamic_cast<const MEDCouplingUMesh *>(mesh);
49 MEDCouplingUMeshServant *retServ=new MEDCouplingUMeshServant(uMesh);
50 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=retServ->_this();//let this line even if it seems fool
53 const MEDCouplingCMesh *cMesh=dynamic_cast<const MEDCouplingCMesh *>(mesh);
56 MEDCouplingCMeshServant *retServ=new MEDCouplingCMeshServant(cMesh);
57 SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr ret=retServ->_this();//let this line even if it seems fool
60 const MEDCouplingIMesh *iMesh=dynamic_cast<const MEDCouplingIMesh *>(mesh);
63 MEDCouplingIMeshServant *retServ=new MEDCouplingIMeshServant(iMesh);
64 SALOME_MED::MEDCouplingIMeshCorbaInterface_ptr ret=retServ->_this();//let this line even if it seems fool
67 const MEDCouplingExtrudedMesh *eMesh=dynamic_cast<const MEDCouplingExtrudedMesh *>(mesh);
70 MEDCouplingExtrudedMeshServant *retServ=new MEDCouplingExtrudedMeshServant(eMesh);
71 return retServ->_this();
73 const MEDCouplingCurveLinearMesh *clMesh=dynamic_cast<const MEDCouplingCurveLinearMesh *>(mesh);
76 MEDCouplingCurveLinearMeshServant *retServ=new MEDCouplingCurveLinearMeshServant(clMesh);
77 SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface_ptr ret=retServ->_this();//let this line even if it seems fool
80 const MEDCoupling1SGTUMesh *u0Mesh=dynamic_cast<const MEDCoupling1SGTUMesh *>(mesh);
83 MEDCoupling1SGTUMeshServant *retServ=new MEDCoupling1SGTUMeshServant(u0Mesh);
84 SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr ret=retServ->_this();//let this line even if it seems fool
87 const MEDCoupling1DGTUMesh *u1Mesh=dynamic_cast<const MEDCoupling1DGTUMesh *>(mesh);
90 MEDCoupling1DGTUMeshServant *retServ=new MEDCoupling1DGTUMeshServant(u1Mesh);
91 SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr ret=retServ->_this();//let this line even if it seems fool
94 throw INTERP_KERNEL::Exception("Not dealt mesh type !");
97 SALOME_MED::MEDCouplingMeshCorbaInterface_ptr MEDCouplingFieldServant::getMesh()
99 const MEDCouplingMesh *mesh(getPointer()->getMesh());
100 return BuildCorbaRefFromCppPointer(mesh);