Salome HOME
da5178fccfa9d8ac630cea3a2db5b90f19ddaa78
[modules/med.git] / src / MEDCouplingCorba / Test / MEDCouplingMeshFieldFactoryComponentServ.cxx
1 // Copyright (C) 2007-2022  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)
20
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"
46
47 namespace SALOME_TEST
48 {
49   MEDCouplingMeshFieldFactoryComponent::MEDCouplingMeshFieldFactoryComponent(CORBA::ORB_ptr orb):_orb(orb)
50   {
51   }
52
53   void MEDCouplingMeshFieldFactoryComponent::destroyFactory()
54   {
55     PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
56     _default_POA()->deactivate_object(oid);
57     _remove_ref();
58   }
59
60   void MEDCouplingMeshFieldFactoryComponent::shutdownOrb()
61   {
62     _orb->shutdown(0);
63   }
64
65   SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1DMesh()
66   {
67     MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build1DMesh();
68     MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
69     m1->decrRef();
70     SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
71     return ret;
72   }
73
74   SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get2DMesh()
75   {
76     MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build2DMesh();
77     MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
78     m1->decrRef();
79     SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
80     return ret;
81   }
82
83   SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get3DMesh()
84   {
85     MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build3DMesh();
86     MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
87     m1->decrRef();
88     SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
89     return ret;
90   }
91
92   SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get3DSurfMesh()
93   {
94     MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build3DSurfMesh();
95     MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
96     m1->decrRef();
97     SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
98     return ret;
99   }
100
101   SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get0DMesh()
102   {
103     MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::build0DMesh();
104     MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
105     m1->decrRef();
106     SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
107     return ret;
108   }
109
110   SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getM1DMesh()
111   {
112     MEDCoupling::MEDCouplingUMesh *m1=MEDCouplingCorbaServBasicsTest::buildM1DMesh();
113     MEDCoupling::MEDCouplingUMeshServant *m=new MEDCoupling::MEDCouplingUMeshServant(m1);
114     m1->decrRef();
115     SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr ret=m->_this();
116     return ret;
117   }
118
119   SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getExtrudedMesh()
120   {
121     MEDCoupling::MEDCouplingUMesh *m2D;
122     MEDCoupling::MEDCouplingMappedExtrudedMesh *m1=MEDCouplingCorbaServBasicsTest::buildExtrudedMesh(m2D);
123     m2D->decrRef();
124     MEDCoupling::MEDCouplingExtrudedMeshServant *m=new MEDCoupling::MEDCouplingExtrudedMeshServant(m1);
125     m1->decrRef();
126     SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface_ptr ret=m->_this();
127     return ret;
128   }
129
130   SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getCMesh()
131   {
132     MEDCoupling::MEDCouplingCMesh *m1=MEDCouplingCorbaServBasicsTest::buildCMesh();
133     MEDCoupling::MEDCouplingCMeshServant *m=new MEDCoupling::MEDCouplingCMeshServant(m1);
134     m1->decrRef();
135     SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr ret=m->_this();
136     return ret;
137   }
138   
139   SALOME_MED::MEDCouplingIMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getIMesh()
140   {
141     MEDCoupling::MEDCouplingIMesh *m1=MEDCouplingCorbaServBasicsTest::buildIMesh();
142     MEDCoupling::MEDCouplingIMeshServant *m=new MEDCoupling::MEDCouplingIMeshServant(m1);
143     m1->decrRef();
144     SALOME_MED::MEDCouplingIMeshCorbaInterface_ptr ret=m->_this();
145     return ret;
146   }
147
148   SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getCLMesh()
149   {
150     MEDCoupling::MEDCouplingCurveLinearMesh *m1=MEDCouplingCorbaServBasicsTest::buildCLMesh();
151     MEDCoupling::MEDCouplingCurveLinearMeshServant *m=new MEDCoupling::MEDCouplingCurveLinearMeshServant(m1);
152     m1->decrRef();
153     SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface_ptr ret=m->_this();
154     return ret;
155   }
156
157   SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1SGTUMesh()
158   {
159     MEDCoupling::MEDCoupling1SGTUMesh *m1=MEDCouplingCorbaServBasicsTest::build1SGTUMesh();
160     MEDCoupling::MEDCoupling1SGTUMeshServant *m=new MEDCoupling::MEDCoupling1SGTUMeshServant(m1);
161     m1->decrRef();
162     SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr ret=m->_this();
163     return ret;
164   }
165
166   SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1DGTUMesh()
167   {
168     MEDCoupling::MEDCoupling1DGTUMesh *m1=MEDCouplingCorbaServBasicsTest::build1DGTUMesh();
169     MEDCoupling::MEDCoupling1DGTUMeshServant *m=new MEDCoupling::MEDCoupling1DGTUMeshServant(m1);
170     m1->decrRef();
171     SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr ret=m->_this();
172     return ret;
173   }
174
175   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn2DNT()
176   {
177     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DNT();
178     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
179     field->decrRef();
180     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
181     return ret;
182   }
183
184   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldNodeScalarOn2DNT()
185   {
186     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldNodeScalarOn2DNT();
187     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
188     field->decrRef();
189     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
190     return ret;
191   }
192
193   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn3DNT()
194   {
195     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DNT();
196     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
197     field->decrRef();
198     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
199     return ret;
200   }
201
202   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn3DSurfWT()
203   {
204     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DSurfWT();
205     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
206     field->decrRef();
207     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
208     return ret;
209   }
210   
211   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn3DSurfCOTI()
212   {
213     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn3DSurfCOTI();
214     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
215     field->decrRef();
216     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
217     return ret;
218   }
219
220   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn2DLT()
221   {
222     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DLT();
223     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
224     field->decrRef();
225     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
226     return ret;
227   }
228
229   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldGaussPt2DWT()
230   {
231     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldGaussPt2DWT();
232     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
233     field->decrRef();
234     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
235     return ret;
236   }
237
238   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldGaussPtNE2DWT()
239   {
240     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldGaussPtNE2DWT();
241     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
242     field->decrRef();
243     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
244     return ret;
245   }
246
247   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldVectorOnExtrudedWT()
248   {
249     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldVectorOnExtrudedWT();
250     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
251     field->decrRef();
252     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
253     return ret;
254   }
255
256   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldVectorOnCMeshWT()
257   {
258     MEDCoupling::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldVectorOnCMeshWT();
259     MEDCoupling::MEDCouplingFieldDoubleServant *m=new MEDCoupling::MEDCouplingFieldDoubleServant(field);
260     field->decrRef();
261     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr ret=m->_this();
262     return ret;
263   }
264   
265   SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateCellOn2D()
266   {
267     MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateCellOn2D();
268     MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
269     field->decrRef();
270     SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
271     return ret;
272   }
273   
274   SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateNodeOn2D()
275   {
276     MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateNodeOn2D();
277     MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
278     field->decrRef();
279     SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
280     return ret;
281   }
282   
283   SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateGaussPtOn2D()
284   {
285     MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateGaussPtOn2D();
286     MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
287     field->decrRef();
288     SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
289     return ret;
290   }
291
292   SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldTemplateGaussNEOn2D()
293   {
294     MEDCoupling::MEDCouplingFieldTemplate *field=MEDCouplingCorbaServBasicsTest::buildFieldTemplateGaussNEOn2D();
295     MEDCoupling::MEDCouplingFieldTemplateServant *m=new MEDCoupling::MEDCouplingFieldTemplateServant(field);
296     field->decrRef();
297     SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_ptr ret=m->_this();
298     return ret;
299   }
300
301   SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getMultiFields1()
302   {
303     MEDCoupling::MEDCouplingMultiFields *fields=MEDCouplingCorbaServBasicsTest::buildMultiFields1();
304     MEDCoupling::MEDCouplingMultiFieldsServant *s=new MEDCoupling::MEDCouplingMultiFieldsServant(fields);
305     fields->decrRef();
306     SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr ret=s->_this();
307     return ret;
308   }
309
310   SALOME_MED::DataArrayDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayDouble1()
311   {
312     MEDCoupling::DataArrayDouble *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayDouble1();
313     MEDCoupling::DataArrayDoubleServant *retServ=new MEDCoupling::DataArrayDoubleServant(retCpp);
314     retCpp->decrRef();
315     return retServ->_this();
316   }
317
318   SALOME_MED::DataArrayDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayDouble2()
319   {
320     MEDCoupling::DataArrayDouble *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayDouble2();
321     MEDCoupling::DataArrayDoubleServant *retServ=new MEDCoupling::DataArrayDoubleServant(retCpp);
322     retCpp->decrRef();
323     return retServ->_this();
324   }
325
326   SALOME_MED::DataArrayDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayDouble3()
327   {
328     MEDCoupling::DataArrayDouble *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayDouble3();
329     MEDCoupling::DataArrayDoubleServant *retServ=new MEDCoupling::DataArrayDoubleServant(retCpp);
330     retCpp->decrRef();
331     return retServ->_this();
332   }
333
334   SALOME_MED::DataArrayIntCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayInt1()
335   {
336     MEDCoupling::DataArrayInt *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayInt1();
337     MEDCoupling::DataArrayIntServant *retServ=new MEDCoupling::DataArrayIntServant(retCpp);
338     retCpp->decrRef();
339     return retServ->_this();
340   }
341
342   SALOME_MED::DataArrayIntCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayInt2()
343   {
344     MEDCoupling::DataArrayInt *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayInt2();
345     MEDCoupling::DataArrayIntServant *retServ=new MEDCoupling::DataArrayIntServant(retCpp);
346     retCpp->decrRef();
347     return retServ->_this();
348   }
349
350   SALOME_MED::DataArrayIntCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getArrayInt3()
351   {
352     MEDCoupling::DataArrayInt *retCpp=MEDCouplingCorbaServBasicsTest::buildArrayInt3();
353     MEDCoupling::DataArrayIntServant *retServ=new MEDCoupling::DataArrayIntServant(retCpp);
354     retCpp->decrRef();
355     return retServ->_this();
356   }
357
358   SALOME_MED::MEDCouplingFieldOverTimeCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getMultiFields2()
359   {
360     MEDCoupling::MEDCouplingFieldOverTime *fot=MEDCouplingCorbaServBasicsTest::buildMultiFields2();
361     MEDCoupling::MEDCouplingFieldOverTimeServant *retServ=new MEDCoupling::MEDCouplingFieldOverTimeServant(fot);
362     fot->decrRef();
363     return retServ->_this();
364   }
365 }