Salome HOME
Copyright update 2022
[modules/med.git] / src / MEDCouplingCorba_Swig / Client / MEDCouplingClient.i
index 8f6e421c0c993865d2519997dd3bab2147c5e335..4fb82d1b773195a052d0dad8e64eb8709c098bd7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -59,6 +59,16 @@ using namespace MEDCoupling;
 %nodefaultctor;
 %nodefaultdtor;
 
+%{
+#if PY_VERSION_HEX < 0x03050000
+static char*
+Py_EncodeLocale(const wchar_t *text, size_t *error_pos)
+{
+   return _Py_wchar2char(text, error_pos);
+}
+#endif
+%}
+
 namespace MEDCoupling
 {
   class MEDCouplingFieldDoubleClient
@@ -78,7 +88,7 @@ namespace MEDCoupling
           PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
           if(!iorField)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldDoubleClient.New appears to differ from CORBA reference ! Expecting a FieldDouble CORBA reference !");
-          char *ior=PyString_AsString(iorField);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorField), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
@@ -110,7 +120,7 @@ namespace MEDCoupling
           PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
           if(!iorField)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldTemplateClient.New appears to differ from CORBA reference ! Expecting a FieldTemplate CORBA reference !");
-          char *ior=PyString_AsString(iorField);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorField), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
@@ -142,7 +152,7 @@ namespace MEDCoupling
           PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
           if(!iorField)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldTemplateClient.New appears to differ from CORBA reference ! Expecting a MultiFields CORBA reference !");
-          char *ior=PyString_AsString(iorField);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorField), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
@@ -175,7 +185,7 @@ namespace MEDCoupling
           PyObject *iorField=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",fieldPtr);
           if(!iorField)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingFieldOverTimeClient.New appears to differ from CORBA reference ! Expecting a FieldOverTime CORBA reference !");
-          char *ior=PyString_AsString(iorField);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorField), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var fieldPtrCpp=orb->string_to_object(ior);
@@ -207,7 +217,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingMeshClient.New appears to differ from CORBA reference ! Expecting a MeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -282,7 +292,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingUMeshClient.New appears to differ from CORBA reference ! Expecting a UMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -314,7 +324,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCoupling1SGTUMeshClient.New appears to differ from CORBA reference ! Expecting a 1SGTUMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -346,7 +356,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCoupling1DGTUMeshClient.New appears to differ from CORBA reference ! Expecting a 1DGTUMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -378,7 +388,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingExtrudedMeshClient.New appears to differ from CORBA reference ! Expecting an ExtrudedMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -410,7 +420,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingCMeshClient.New appears to differ from CORBA reference ! Expecting a CMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -442,7 +452,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingIMeshClient.New appears to differ from CORBA reference ! Expecting a IMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -474,7 +484,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of MEDCouplingCurveLinearMeshClient.New appears to differ from CORBA reference ! Expecting a CurveLinearMeshCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -506,7 +516,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of DataArrayDoubleClient.New appears to differ from CORBA reference ! Expecting a DataArrayDoubleCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -538,7 +548,7 @@ namespace MEDCoupling
           PyObject *iorMesh=PyObject_CallMethod(orbPython,(char*)"object_to_string",(char*)"O",meshPtr);
           if(!iorMesh)
             throw INTERP_KERNEL::Exception("Error : the input parameter of DataArrayIntClient.New appears to differ from CORBA reference ! Expecting a DataArrayIntCorbaInterface CORBA reference !");
-          char *ior=PyString_AsString(iorMesh);
+          char *ior=Py_EncodeLocale(PyUnicode_AS_UNICODE(iorMesh), NULL);
           int argc=0;
           CORBA::ORB_var orb=CORBA::ORB_init(argc,0);
           CORBA::Object_var meshPtrCpp=orb->string_to_object(ior);
@@ -556,98 +566,131 @@ namespace MEDCoupling
 
 %pythoncode %{
 def MEDCouplingDataArrayDoubleIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDouble____iadd___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDouble____iadd___(self, self, *args)
 def MEDCouplingDataArrayDoubleIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDouble____isub___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDouble____isub___(self, self, *args)
 def MEDCouplingDataArrayDoubleImul(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDouble____imul___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDouble____imul___(self, self, *args)
 def MEDCouplingDataArrayDoubleIdiv(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDouble____idiv___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDouble____idiv___(self, self, *args)
 def MEDCouplingDataArrayDoubleIpow(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDouble____ipow___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDouble____ipow___(self, self, *args)
 def MEDCouplingFieldDoubleIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.MEDCouplingFieldDouble____iadd___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.MEDCouplingFieldDouble____iadd___(self, self, *args)
 def MEDCouplingFieldDoubleIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.MEDCouplingFieldDouble____isub___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.MEDCouplingFieldDouble____isub___(self, self, *args)
 def MEDCouplingFieldDoubleImul(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.MEDCouplingFieldDouble____imul___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.MEDCouplingFieldDouble____imul___(self, self, *args)
 def MEDCouplingFieldDoubleIdiv(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.MEDCouplingFieldDouble____idiv___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.MEDCouplingFieldDouble____idiv___(self, self, *args)
 def MEDCouplingFieldDoubleIpow(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.MEDCouplingFieldDouble____ipow___(self, self, *args)
-def MEDCouplingDataArrayIntIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayInt____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayInt____isub___(self, self, *args)
-def MEDCouplingDataArrayIntImul(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayInt____imul___(self, self, *args)
-def MEDCouplingDataArrayIntIdiv(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayInt____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntImod(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayInt____imod___(self, self, *args)
-def MEDCouplingDataArrayIntIpow(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayInt____ipow___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.MEDCouplingFieldDouble____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt32Iadd(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32Isub(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32Imul(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32Idiv(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Imod(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32____imod___(self, self, *args)
+def MEDCouplingDataArrayInt32Ipow(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt64Iadd(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64Isub(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64Imul(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64Idiv(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64Imod(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64Ipow(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64____ipow___(self, self, *args)
 def MEDCouplingDataArrayFloatIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayFloat____iadd___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayFloat____iadd___(self, self, *args)
 def MEDCouplingDataArrayFloatIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayFloat____isub___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayFloat____isub___(self, self, *args)
 def MEDCouplingDataArrayFloatImul(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayFloat____imul___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayFloat____imul___(self, self, *args)
 def MEDCouplingDataArrayFloatIdiv(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayFloat____idiv___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayFloat____idiv___(self, self, *args)
 def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDoubleTuple____iadd___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDoubleTuple____iadd___(self, self, *args)
 def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDoubleTuple____isub___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDoubleTuple____isub___(self, self, *args)
 def MEDCouplingDataArrayDoubleTupleImul(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDoubleTuple____imul___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDoubleTuple____imul___(self, self, *args)
 def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayDoubleTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayIntTuple____iadd___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayIntTuple____isub___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImul(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayIntTuple____imul___(self, self, *args)
-def MEDCouplingDataArrayIntTupleIdiv(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayIntTuple____idiv___(self, self, *args)
-def MEDCouplingDataArrayIntTupleImod(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DataArrayIntTuple____imod___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayDoubleTuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIadd(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIsub(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImul(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImod(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt32Tuple____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIadd(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIsub(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImul(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImod(self,*args):
+    import _MEDCoupling
+    return _MEDCoupling.DataArrayInt64Tuple____imod___(self, self, *args)
 def MEDCouplingDenseMatrixIadd(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DenseMatrix____iadd___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DenseMatrix____iadd___(self, self, *args)
 def MEDCouplingDenseMatrixIsub(self,*args):
-    import _MEDCouplingClient
-    return _MEDCouplingClient.DenseMatrix____isub___(self, self, *args)
+    import _MEDCoupling
+    return _MEDCoupling.DenseMatrix____isub___(self, self, *args)
 %}
 
 %include "MEDCouplingFinalize.i"