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 "MEDCouplingMeshFieldFactoryComponentServ.hxx"
22 #include "MEDCouplingMeshFieldFactoryComponent.hxx"
23 #include "MEDCouplingFieldDoubleServant.hxx"
24 #include "MEDCouplingFieldTemplateServant.hxx"
25 #include "MEDCouplingMultiFieldsServant.hxx"
26 #include "MEDCouplingFieldOverTimeServant.hxx"
27 #include "MEDCouplingExtrudedMeshServant.hxx"
28 #include "MEDCouplingCurveLinearMeshServant.hxx"
29 #include "MEDCoupling1SGTUMeshServant.hxx"
30 #include "MEDCoupling1DGTUMeshServant.hxx"
31 #include "MEDCouplingCMeshServant.hxx"
32 #include "MEDCouplingIMeshServant.hxx"
33 #include "MEDCouplingUMeshServant.hxx"
34 #include "DataArrayDoubleServant.hxx"
35 #include "DataArrayIntServant.hxx"
36 #include "MEDCouplingFieldDouble.hxx"
37 #include "MEDCouplingFieldTemplate.hxx"
38 #include "MEDCouplingMultiFields.hxx"
39 #include "MEDCouplingFieldOverTime.hxx"
40 #include "MEDCouplingMappedExtrudedMesh.hxx"
41 #include "MEDCouplingCurveLinearMesh.hxx"
42 #include "MEDCoupling1GTUMesh.hxx"
43 #include "MEDCouplingUMesh.hxx"
44 #include "MEDCouplingCMesh.hxx"
45 #include "MEDCouplingIMesh.hxx"
49 MEDCouplingMeshFieldFactoryComponent::MEDCouplingMeshFieldFactoryComponent(CORBA::ORB_ptr orb):_orb(orb)
53 void MEDCouplingMeshFieldFactoryComponent::destroyFactory()
55 PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
56 _default_POA()->deactivate_object(oid);
60 void MEDCouplingMeshFieldFactoryComponent::shutdownOrb()
65 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1DMesh()
67 MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build1DMesh();
68 MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
70 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
74 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get2DMesh()
76 MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build2DMesh();
77 MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
79 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
83 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get3DMesh()
85 MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build3DMesh();
86 MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
88 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
92 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get3DSurfMesh()
94 MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build3DSurfMesh();
95 MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
97 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
101 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get0DMesh()
103 MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build0DMesh();
104 MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
106 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
110 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getM1DMesh()
112 MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::buildM1DMesh();
113 MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
115 SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
119 SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getExtrudedMesh()
121 MEDCoupling::MEDCouplingUMesh *m2D;
122 MEDCoupling::MEDCouplingMappedExtrudedMesh *m1=MEDCouplingCorbaServBasicsTest::buildExtrudedMesh(m2D);
124 MEDCoupling::MEDCouplingExtrudedMeshServant *m=new MEDCoupling::MEDCouplingExtrudedMeshServant(m1);
126 SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface_ptr ret=m->_this();
130 SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getCMesh()
132 MEDCoupling::MEDCouplingCMesh *m1=MEDCouplingCorbaServBasicsTest::buildCMesh();
133 MEDCoupling::MEDCouplingCMeshServant *m=new MEDCoupling::MEDCouplingCMeshServant(m1);
135 SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr ret=m->_this();
139 SALOME_MED::MEDCouplingIMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getIMesh()
141 MEDCoupling::MEDCouplingIMesh *m1=MEDCouplingCorbaServBasicsTest::buildIMesh();
142 MEDCoupling::MEDCouplingIMeshServant *m=new MEDCoupling::MEDCouplingIMeshServant(m1);
144 SALOME_MED::MEDCouplingIMeshCorbaInterface_ptr ret=m->_this();
148 SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getCLMesh()
150 MEDCoupling::MEDCouplingCurveLinearMesh *m1=MEDCouplingCorbaServBasicsTest::buildCLMesh();
151 MEDCoupling::MEDCouplingCurveLinearMeshServant *m=new MEDCoupling::MEDCouplingCurveLinearMeshServant(m1);
153 SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface_ptr ret=m->_this();
157 SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1SGTUMesh()
159 MEDCoupling::MEDCoupling1SGTUMesh *m1=MEDCouplingCorbaServBasicsTest::build1SGTUMesh();
160 MEDCoupling::MEDCoupling1SGTUMeshServant *m=new MEDCoupling::MEDCoupling1SGTUMeshServant(m1);
162 SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr ret=m->_this();
166 SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1DGTUMesh()
168 MEDCoupling::MEDCoupling1DGTUMesh *m1=MEDCouplingCorbaServBasicsTest::build1DGTUMesh();
169 MEDCoupling::MEDCoupling1DGTUMeshServant *m=new MEDCoupling::MEDCoupling1DGTUMeshServant(m1);
171 SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr ret=m->_this();
175 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn2DNT()
177 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DNT();
178 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
180 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
184 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldNodeScalarOn2DNT()
186 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldNodeScalarOn2DNT();
187 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
189 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
193 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn3DNT()
195 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DNT();
196 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
198 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
202 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn3DSurfWT()
204 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DSurfWT();
205 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
207 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
211 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn3DSurfCOTI()
213 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DSurfCOTI();
214 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
216 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
220 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn2DLT()
222 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DLT();
223 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
225 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
229 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldGaussPt2DWT()
231 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldGaussPt2DWT();
232 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
234 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
238 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldGaussPtNE2DWT()
240 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldGaussPtNE2DWT();
241 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
243 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
247 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldVectorOnExtrudedWT()
249 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldVectorOnExtrudedWT();
250 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
252 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
256 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldVectorOnCMeshWT()
258 MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldVectorOnCMeshWT();
259 MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
261 SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
265 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateCellOn2D()
267 MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateCellOn2D();
268 MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
270 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
274 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateNodeOn2D()
276 MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateNodeOn2D();
277 MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
279 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
283 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateGaussPtOn2D()
285 MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateGaussPtOn2D();
286 MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
288 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
292 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateGaussNEOn2D()
294 MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateGaussNEOn2D();
295 MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
297 SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
301 SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getMultiFields1()
303 MEDCoupling::MEDCouplingMultiFields *fields=MEDCouplingCorbaServBasicsTest::buildMultiFields1();
304 MEDCoupling::MEDCouplingMultiFieldsServant *s=new MEDCoupling::MEDCouplingMultiFieldsServant(fields);
306 SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr ret=s->_this();
310 SALOME_MED::DataArrayDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayDouble1()
312 MEDCoupling::DataArrayDouble *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayDouble1();
313 MEDCoupling::DataArrayDoubleServant *retServ=new MEDCoupling::DataArrayDoubleServant(retCpp);
315 return retServ->_this();
318 SALOME_MED::DataArrayDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayDouble2()
320 MEDCoupling::DataArrayDouble *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayDouble2();
321 MEDCoupling::DataArrayDoubleServant *retServ=new MEDCoupling::DataArrayDoubleServant(retCpp);
323 return retServ->_this();
326 SALOME_MED::DataArrayDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayDouble3()
328 MEDCoupling::DataArrayDouble *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayDouble3();
329 MEDCoupling::DataArrayDoubleServant *retServ=new MEDCoupling::DataArrayDoubleServant(retCpp);
331 return retServ->_this();
334 SALOME_MED::DataArrayIntCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayInt1()
336 MEDCoupling::DataArrayInt *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayInt1();
337 MEDCoupling::DataArrayIntServant *retServ=new MEDCoupling::DataArrayIntServant(retCpp);
339 return retServ->_this();
342 SALOME_MED::DataArrayIntCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayInt2()
344 MEDCoupling::DataArrayInt *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayInt2();
345 MEDCoupling::DataArrayIntServant *retServ=new MEDCoupling::DataArrayIntServant(retCpp);
347 return retServ->_this();
350 SALOME_MED::DataArrayIntCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayInt3()
352 MEDCoupling::DataArrayInt *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayInt3();
353 MEDCoupling::DataArrayIntServant *retServ=new MEDCoupling::DataArrayIntServant(retCpp);
355 return retServ->_this();
358 SALOME_MED::MEDCouplingFieldOverTimeCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getMultiFields2()
360 MEDCoupling::MEDCouplingFieldOverTime *fot=MEDCouplingCorbaServBasicsTest::buildMultiFields2();
361 MEDCoupling::MEDCouplingFieldOverTimeServant *retServ=new MEDCoupling::MEDCouplingFieldOverTimeServant(fot);
363 return retServ->_this();