Salome HOME
Windows porting
authorrnv <rnv@opencascade.com>
Wed, 29 Aug 2018 11:46:27 +0000 (14:46 +0300)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 4 Sep 2018 14:38:30 +0000 (16:38 +0200)
60 files changed:
doc/user/images/cartesian.py
doc/user/images/convert2quadratic.py
doc/user/images/curvelinear.py
doc/user/images/explodeIntoEdges.py
doc/user/images/extractSlice3D.py
doc/user/images/extract_mesh_fetched_nodes.py
doc/user/images/extract_mesh_ids.py
doc/user/images/extrusion.py
doc/user/images/intersect_2d1d.py
doc/user/images/intersect_2d2d.py
doc/user/images/measure_field.py
doc/user/images/orderConsecutiveCells1D.py
doc/user/images/orient_2d.py
doc/user/images/ortho_field.py
doc/user/images/partition.py
doc/user/images/partition_with_layer.py
doc/user/images/projection_P0P1_dual.py
doc/user/images/projection_P0P1_meshes.py
doc/user/images/projection_P1P0_dual.py
doc/user/images/renumber_nodes.py
doc/user/images/simplexize.py
doc/user/images/skin.py
doc/user/images/zones.py
src/INTERP_KERNEL/ExprEval/InterpKernelFunction.cxx
src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx
src/INTERP_KERNEL/ExprEval/InterpKernelValue.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DPrecision.hxx
src/INTERP_KERNEL/InterpKernelCellSimplify.cxx
src/INTERP_KERNEL/VectorUtils.hxx
src/MEDCoupling/MEDCoupling.hxx
src/MEDCoupling/MEDCouplingAMRAttribute.cxx
src/MEDCoupling/MEDCouplingMemArray.cxx
src/MEDCoupling/MEDCouplingMemArray.hxx
src/MEDCoupling/MEDCouplingPartDefinition.cxx
src/MEDCoupling/MEDCouplingUMesh_intersection.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx
src/MEDCoupling_Swig/CMakeLists.txt
src/MEDCoupling_Swig/MEDCouplingBasicsTest1.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest6.py
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/MEDCoupling_Swig/MEDCouplingDataForTest.py
src/MEDCoupling_Swig/MEDCouplingExamplesTest.py
src/MEDCoupling_Swig/MEDCouplingIntersectTest.py
src/MEDCoupling_Swig/MEDCouplingNumPyTest.py
src/MEDCoupling_Swig/MEDCouplingPickleTest.py
src/MEDCoupling_Swig/UsersGuideExamplesTest.py
src/MEDCoupling_Swig/UsersGuideExamplesTest_numpy.py
src/MEDLoader/Swig/CMakeLists.txt
src/MEDPartitioner_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/CMakeLists.txt
src/PyWrapping/CMakeLists.txt
src/RENUMBER_Swig/CMakeLists.txt
src/RENUMBER_Swig/MEDRenumberCommon.i
src/RENUMBER_Swig/MEDRenumberTest.py
src/RENUMBER_Swig/UsersGuideExamplesTest.py

index 7ac1c79d0be7f85a0c12e76f888901e8519b8834..2829dfb6345c2e3c92dfaeecdbe3e7bcd6f63ac2 100644 (file)
@@ -64,8 +64,12 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 XCoords=[-0.3,0.,0.1,0.3,0.45,0.47,0.49,1.,1.22] # 9 values along X
index d4cb1d08fb4c38a7b50ce0e5ecae8e0bf098c03a..7bb05d06274e13a036ec78802daba1eaafb8ae12 100644 (file)
@@ -64,8 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 arr=DataArrayDouble(range(2))
index 268a8e84434a44d02e14ee72f57134e8325b3503..056cd16b5b02bec355b344243578f6ea34ddee21 100644 (file)
@@ -64,8 +64,12 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 m=MEDCouplingCurveLinearMesh("myCurveLinearMesh")
index 0c626eab6e3ec2c9dee850a240a52b0de0a0ecd6..b07e658edc5a1e943eb5a8933d3ed171390b9b42 100644 (file)
@@ -64,8 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(5))
 mesh1=MEDCouplingCMesh("mesh")
index 5d34cab18519637310f8ccdf67f626c7a0c7f68a..5b5e1c7829bc85a88d4c1863cb553d15bc23ed8b 100644 (file)
@@ -26,7 +26,12 @@ ipar.append("ParaView_1", "empty")
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "ParaViS")
 
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
+
 from MEDLoader import WriteMesh, WriteFieldUsingAlreadyWrittenMesh
 
 medfile1="mesh1.med"
index 2a49a353f6597b86c205e2ea0ec63ea2e765a0c2..5d94de3db0e5024bc604750fe4c1131b29d6497b 100644 (file)
@@ -65,7 +65,10 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 ipar.append("AP_MODULES_LIST", "Mesh")
 
 
-from MEDCoupling import *
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(6))
 mesh1=MEDCouplingCMesh("mesh")
index c619c055bad6923e259be48fd06558f5023c6947..09cca9c67ffd80893acfb044e6edf72f0b42159d 100644 (file)
@@ -64,8 +64,10 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(6))
 mesh1=MEDCouplingCMesh("mesh")
index 73f3334c42ff8f269f2ed5db0f7df7bf1b8cb655..324ed6cb3b466561bb7034c1318f6f2a73336fd7 100644 (file)
@@ -64,8 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(3))
 mesh1=MEDCouplingCMesh("mesh")
index 62590010da1dec86f7671003e33744b94729186e..49b3d13e7d880f83b890ce814d5257cba3dc34a2 100644 (file)
@@ -65,8 +65,10 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(6))
 mesh2d=MEDCouplingCMesh("mesh2d")
index 37219194cda90c42f6fb363b3d97a56bba43de69..048ba4133e80de7b86e29008dea3e4f465d6e690 100644 (file)
@@ -65,8 +65,10 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(6))
 mesh2d=MEDCouplingCMesh("mesh2")
index 24cbd6497b1e50e20da2065e47a857bede995e2f..d686fbad01ef3864fcded55284787e47869b584d 100644 (file)
@@ -10,7 +10,12 @@ import salome
 salome.salome_init()
 theStudy = salome.myStudy
 
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
+
 from MEDLoader import WriteMesh, WriteFieldUsingAlreadyWrittenMesh
 
 medfile="mesh1.med"
index 4d26fca62076e5af38cbd2eabfac59c982ef61e6..e2ca078ad17938597fa1197c6183f23b42a07b1a 100644 (file)
@@ -65,8 +65,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 coordsArr=DataArrayDouble(range(6))
index d6b8409a8da4bb6962529ae9c55d021b33054ecc..f5cf417fd6415f024efb960af5d24a4f7c0562c0 100644 (file)
@@ -65,8 +65,10 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 coordsArr=DataArrayDouble(range(6))
index 7d27868d99ac503f27a1d2958585ab294e643a29..f49bc4f783d1624d2fc3afec7fd841ddac15efc7 100644 (file)
@@ -4,7 +4,11 @@
 ### This script is intended to be launched in a new SALOME study
 ###
 
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(3))
 mesh1=MEDCouplingCMesh("mesh")
index a669b82219d448dc15e576c24290d1078fff6d53..ba2cd5b99277f6dd7ef2863de6634962e191c930 100644 (file)
@@ -68,9 +68,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-
-from MEDCoupling import *
 from MEDLoader import ReadMeshFromFile, WriteMesh
 
 coordsArr=DataArrayDouble(range(8))
index e7d64c722610af5e6d467c8e4788612f03a5107b..abd4d78bdfc6f1b5b2c76361717805c01376ecb5 100644 (file)
@@ -68,9 +68,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-
-from MEDCoupling import *
 from MEDLoader import ReadMeshFromFile, WriteMesh
 
 coordsArr=DataArrayDouble(range(8))
index 59500cc7548f417d38deb55a63697f2d012a549a..2c4c0cf2ae2b8b85a4f9814e27f1f5b7a29e4cdd 100644 (file)
@@ -64,8 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 srcCoo=DataArrayDouble([(0,0),(1,0),(3,0),(0,1),(1,1),(3,1)])
 src=MEDCouplingUMesh("src",2)
index a26adfb7af7899b6f6dd05c47633fb6138e5f0be..92ec7ae3f8a112bee44bedd4a84da6bd768da885 100644 (file)
@@ -64,8 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 srcCoo=DataArrayDouble([(0,0),(1,0),(3,0),(0,1),(1,1),(3,1)])
 src=MEDCouplingUMesh("src",2)
index 4d925b927d09f97e2e92d01ebb1237ac541074ec..f9b3f9aaa39136b445dbc9e392bc70f7fe443a25 100644 (file)
@@ -64,8 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 srcCoo=DataArrayDouble([(0,0),(1,0),(3,0),(0,1),(1,1),(3,1)])
 src=MEDCouplingUMesh("src",2)
index 0e15ab61e5779890ce2a8a2c22ceda3cc43e8de9..ac16031033c15715e373aa38c04f3f5a43346f79 100644 (file)
@@ -68,9 +68,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-
-from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 coordsArr=DataArrayDouble(range(2))
index 73a350bde5ee393889b7bb7a27bfa1178da39c2e..c5edfd6a287da54d5fc35fb6d16c212fcdbe5989 100644 (file)
@@ -64,9 +64,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 # fill list AP_MODULES_LIST
 ipar.append("AP_MODULES_LIST", "Mesh")
 
-
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(3))
 mesh1=MEDCouplingCMesh("mesh")
index be8381374dfbade3bb5dcc3959289b6a4be549ba..4a212e8b4d1dbd6e563bb00958f176e1414cd4bf 100644 (file)
@@ -65,7 +65,11 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 ipar.append("AP_MODULES_LIST", "Mesh")
 
 
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 coordsArr=DataArrayDouble(range(5))
 mesh1=MEDCouplingCMesh("mesh")
index 73afd5a1779e57cd994956bce5b5db24ad87ae0e..f5e0b6bcdb902f132480a45c09dff7b0e1bf3ca8 100644 (file)
@@ -65,7 +65,12 @@ ipar.append("VTKViewer_1", """<?xml version="1.0"?>
 ipar.append("AP_MODULES_LIST", "Mesh")
 
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 from MEDLoader import WriteMesh
 
 coords=DataArrayDouble(range(6))
index c3ddbac4657fe17d872e1bfa63d5d571b4c2f638..bed1610b7d09726d86ca88c2d4cea3fb7606e19f 100644 (file)
@@ -21,6 +21,7 @@
 #include "InterpKernelFunction.hxx"
 #include "InterpKernelValue.hxx"
 
+#include <algorithm>
 #include <cmath>
 #include <limits>
 
index aeee8ba16be3637d19d065fceb40e43371573463..3c8215e948e27058922b039f24c9a1f53db35975 100644 (file)
@@ -21,6 +21,7 @@
 #include "InterpKernelUnit.hxx"
 #include "InterpKernelExprParser.hxx"
 
+#include <algorithm>
 #include <cmath>
 #include <sstream>
 #include <iomanip>
index 833607843fb610869f9ffce109d797b49f5b69db..223e34063ccbca24bfbaedcb6d2a2a6e179c927a 100644 (file)
 #include <limits>
 #include <algorithm>
 
+#ifdef WIN32
+#include <functional>
+#endif 
+
 using namespace INTERP_KERNEL;
 
 ValueDouble::ValueDouble():_data(std::numeric_limits<double>::max())
index 27a9acb993a4c16b1eb59736f53e7cafdcd77525..db8f43d67999693ce6872b47d549153b48131e40 100644 (file)
@@ -28,6 +28,9 @@
 
 #include <algorithm>
 
+#include <functional>
+
+
 using namespace INTERP_KERNEL;
 
 MergePoints::MergePoints():_ass1Start1(0),_ass1End1(0),_ass1Start2(0),_ass1End2(0),
index 00149c5641364fc3fcaf7c2a801ca0047c418c3b..e66a0a378164198db62e5f39463e4a728992a2b3 100644 (file)
@@ -36,7 +36,7 @@ namespace INTERP_KERNEL
    * When the instance is destroyed, the previous precision is set back.
    *
    */
-  class QuadraticPlanarPrecision
+  class INTERPKERNEL_EXPORT QuadraticPlanarPrecision
   {
   public:
     QuadraticPlanarPrecision(double prec);
index 40fad8559919e0911b49cd9467c276e6d94b7aa7..ebc88f280bc53740c565c4392b0162bdbb6ae6c1 100644 (file)
@@ -21,6 +21,7 @@
 #include "InterpKernelCellSimplify.hxx"
 #include "CellModel.hxx"
 
+#include <functional>
 #include <algorithm>
 #include <iterator>
 #include <sstream>
index 7ac0582bd6b7b711101a3e36b5387d72e2296f7b..00b2bf042cb1f20d28ccbfd5ccc6a9deda64d998 100644 (file)
 #ifndef __VECTORUTILS_HXX__
 #define __VECTORUTILS_HXX__
 
+#include <algorithm>
 #include <sstream>
 #include <numeric>
 #include <string>
 #include <cmath>
 #include <map>
 
+
 namespace INTERP_KERNEL
 {
   /// Precision used for tests of 3D part of INTERP_KERNEL
index 89add71b616f825f476decb3ce8373918734dfff..391b9d378def0dbde3c208b76f11526510cfe66c 100644 (file)
@@ -22,7 +22,7 @@
 #define _MEDCOUPLING_HXX_
 
 #ifdef WIN32
-#  if defined medcoupling_EXPORTS
+#  if defined(medcoupling_EXPORTS) || defined(medcouplingcpp_EXPORTS) || defined(MEDCOUPLING_WIN32_SWIG)
 #    define MEDCOUPLING_EXPORT __declspec( dllexport )
 #  else
 #    define MEDCOUPLING_EXPORT __declspec( dllimport )
index 7302fa45ffb542bc40350e04a904176520c215b4..f1e5081063602d275239c63230c8d1f5791c936b 100644 (file)
 #include <sstream>
 #include <fstream>
 
+#ifdef WIN32
+#include <functional>
+#endif
+
 using namespace MEDCoupling;
 
 /// @cond INTERNAL
index f7bcef0096840fb202f9441261088ae73f37c6af..4346c26bec59894672385d8d8e26ba42a9939d95 100644 (file)
@@ -53,12 +53,9 @@ template class MEDCoupling::DataArrayIterator<double>;
 template class MEDCoupling::DataArrayIterator<int>;
 template class MEDCoupling::DataArrayDiscrete<Int32>;
 template class MEDCoupling::DataArrayDiscreteSigned<Int32>;
-
-// [ABN] : Newest Intel compilers need this:
-template Traits<Int32>::ArrayType* MEDCoupling::DataArrayTuple<Int32>::buildDA(int, int) const;
-template Traits<double>::ArrayType* MEDCoupling::DataArrayTuple<double>::buildDA(int, int) const;
-template Traits<float>::ArrayType* MEDCoupling::DataArrayTuple<float>::buildDA(int, int) const;
-
+template class MEDCoupling::DataArrayTuple<int>;
+template class MEDCoupling::DataArrayTuple<double>;
+template class MEDCoupling::DataArrayTuple<float>;
 
 template<int SPACEDIM>
 void DataArrayDouble::findCommonTuplesAlg(const double *bbox, int nbNodes, int limitNodeId, double prec, DataArrayInt *c, DataArrayInt *cI) const
index 0fdbdcf1c04e56b7c5ce2c2068d71c6994f8235e..af887b919a783e4bcaa21a340509139fdf4eeb95 100644 (file)
@@ -51,14 +51,14 @@ namespace MEDCoupling
   class MEDCouplingPointer
   {
   public:
-    MEDCouplingPointer():_internal(0),_external(0) { }
-    void null() { _internal=0; _external=0; }
-    bool isNull() const { return _internal==0 && _external==0; }
-    void setInternal(T *pointer);
-    void setExternal(const T *pointer);
-    const T *getConstPointer() const { if(_internal) return _internal; else return _external; }
-    const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; }
-    T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; }
+    MEDCOUPLING_EXPORT MEDCouplingPointer():_internal(0),_external(0) { }
+    MEDCOUPLING_EXPORT void null() { _internal=0; _external=0; }
+    MEDCOUPLING_EXPORT bool isNull() const { return _internal==0 && _external==0; }
+    MEDCOUPLING_EXPORT void setInternal(T *pointer);
+    MEDCOUPLING_EXPORT void setExternal(const T *pointer);
+    MEDCOUPLING_EXPORT const T *getConstPointer() const { if(_internal) return _internal; else return _external; }
+    MEDCOUPLING_EXPORT const T *getConstPointerLoc(std::size_t offset) const { if(_internal) return _internal+offset; else return _external+offset; }
+    MEDCOUPLING_EXPORT T *getPointer() { if(_internal) return _internal; if(_external) throw INTERP_KERNEL::Exception("Trying to write on an external pointer."); else return 0; }
   private:
     T *_internal;
     const T *_external;
@@ -70,45 +70,45 @@ namespace MEDCoupling
   public:
     typedef void (*Deallocator)(void *,void *);
   public:
-    MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { }
-    MemArray(const MemArray<T>& other);
-    bool isNull() const { return _pointer.isNull(); }
-    const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); }
-    const T *getConstPointer() const { return _pointer.getConstPointer(); }
-    std::size_t getNbOfElem() const { return _nb_of_elem; }
-    std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; }
-    T *getPointer() { return _pointer.getPointer(); }
-    MemArray<T> &operator=(const MemArray<T>& other);
-    T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; }
-    T& operator[](std::size_t id) { return _pointer.getPointer()[id]; }
-    bool isEqual(const MemArray<T>& other, T prec, std::string& reason) const;
-    void repr(int sl, std::ostream& stream) const;
-    bool reprHeader(int sl, std::ostream& stream) const;
-    void reprZip(int sl, std::ostream& stream) const;
-    void reprNotTooLong(int sl, std::ostream& stream) const;
-    void fillWithValue(const T& val);
-    T *fromNoInterlace(int nbOfComp) const;
-    T *toNoInterlace(int nbOfComp) const;
-    void sort(bool asc);
-    void reverse(int nbOfComp);
-    void alloc(std::size_t nbOfElements);
-    void reserve(std::size_t newNbOfElements);
-    void reAlloc(std::size_t newNbOfElements);
-    void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem);
-    void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem);
-    void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers);
+    MEDCOUPLING_EXPORT MemArray():_nb_of_elem(0),_nb_of_elem_alloc(0),_ownership(false),_dealloc(0),_param_for_deallocator(0) { }
+    MEDCOUPLING_EXPORT MemArray(const MemArray<T>& other);
+    MEDCOUPLING_EXPORT bool isNull() const { return _pointer.isNull(); }
+    MEDCOUPLING_EXPORT const T *getConstPointerLoc(std::size_t offset) const { return _pointer.getConstPointerLoc(offset); }
+    MEDCOUPLING_EXPORT const T *getConstPointer() const { return _pointer.getConstPointer(); }
+    MEDCOUPLING_EXPORT std::size_t getNbOfElem() const { return _nb_of_elem; }
+    MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _nb_of_elem_alloc; }
+    MEDCOUPLING_EXPORT T *getPointer() { return _pointer.getPointer(); }
+    MEDCOUPLING_EXPORT MemArray<T> &operator=(const MemArray<T>& other);
+    MEDCOUPLING_EXPORT T operator[](std::size_t id) const { return _pointer.getConstPointer()[id]; }
+    MEDCOUPLING_EXPORT T& operator[](std::size_t id) { return _pointer.getPointer()[id]; }
+    MEDCOUPLING_EXPORT bool isEqual(const MemArray<T>& other, T prec, std::string& reason) const;
+    MEDCOUPLING_EXPORT void repr(int sl, std::ostream& stream) const;
+    MEDCOUPLING_EXPORT bool reprHeader(int sl, std::ostream& stream) const;
+    MEDCOUPLING_EXPORT void reprZip(int sl, std::ostream& stream) const;
+    MEDCOUPLING_EXPORT void reprNotTooLong(int sl, std::ostream& stream) const;
+    MEDCOUPLING_EXPORT void fillWithValue(const T& val);
+    MEDCOUPLING_EXPORT T *fromNoInterlace(int nbOfComp) const;
+    MEDCOUPLING_EXPORT T *toNoInterlace(int nbOfComp) const;
+    MEDCOUPLING_EXPORT void sort(bool asc);
+    MEDCOUPLING_EXPORT void reverse(int nbOfComp);
+    MEDCOUPLING_EXPORT void alloc(std::size_t nbOfElements);
+    MEDCOUPLING_EXPORT void reserve(std::size_t newNbOfElements);
+    MEDCOUPLING_EXPORT void reAlloc(std::size_t newNbOfElements);
+    MEDCOUPLING_EXPORT void useArray(const T *array, bool ownership, DeallocType type, std::size_t nbOfElem);
+    MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const T *array, std::size_t nbOfElem);
+    MEDCOUPLING_EXPORT void writeOnPlace(std::size_t id, T element0, const T *others, std::size_t sizeOfOthers);
     template<class InputIterator>
     void insertAtTheEnd(InputIterator first, InputIterator last);
-    void pushBack(T elem);
-    T popBack();
-    void pack() const;
-    bool isDeallocatorCalled() const { return _ownership; }
-    Deallocator getDeallocator() const { return _dealloc; }
-    void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; }
-    void setParameterForDeallocator(void *param) { _param_for_deallocator=param; }
-    void *getParameterForDeallocator() const { return _param_for_deallocator; }
-    void destroy();
-    ~MemArray() { destroy(); }
+    MEDCOUPLING_EXPORT void pushBack(T elem);
+    MEDCOUPLING_EXPORT T popBack();
+    MEDCOUPLING_EXPORT void pack() const;
+    MEDCOUPLING_EXPORT bool isDeallocatorCalled() const { return _ownership; }
+    MEDCOUPLING_EXPORT Deallocator getDeallocator() const { return _dealloc; }
+    MEDCOUPLING_EXPORT void setSpecificDeallocator(Deallocator dealloc) { _dealloc=dealloc; }
+    MEDCOUPLING_EXPORT void setParameterForDeallocator(void *param) { _param_for_deallocator=param; }
+    MEDCOUPLING_EXPORT void *getParameterForDeallocator() const { return _param_for_deallocator; }
+    MEDCOUPLING_EXPORT void destroy();
+    MEDCOUPLING_EXPORT ~MemArray() { destroy(); }
   public:
     static void CPPDeallocator(void *pt, void *param);
     static void CDeallocator(void *pt, void *param);
@@ -229,68 +229,68 @@ namespace MEDCoupling
     //
     MEDCOUPLING_EXPORT std::size_t getNumberOfTuples() const { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
     MEDCOUPLING_EXPORT std::size_t getNbOfElems() const { return _mem.getNbOfElem(); }
-    bool empty() const;
+    MEDCOUPLING_EXPORT bool empty() const;
     MEDCOUPLING_EXPORT void *getVoidStarPointer() { return getPointer(); }
     MEDCOUPLING_EXPORT const T *getConstPointer() const { return _mem.getConstPointer(); }
     MEDCOUPLING_EXPORT const T *begin() const { return getConstPointer(); }
     MEDCOUPLING_EXPORT const T *end() const { return getConstPointer()+getNbOfElems(); }
     MEDCOUPLING_EXPORT T *rwBegin() { return getPointer(); }
     MEDCOUPLING_EXPORT T *rwEnd() { return getPointer()+getNbOfElems(); }
-    void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1);
-    void useArray(const T *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo);
-    void useExternalArrayWithRWAccess(const T *array, int nbOfTuple, int nbOfCompo);
-    T getIJSafe(int tupleId, int compoId) const;
+    MEDCOUPLING_EXPORT void alloc(std::size_t nbOfTuple, std::size_t nbOfCompo=1);
+    MEDCOUPLING_EXPORT void useArray(const T *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo);
+    MEDCOUPLING_EXPORT void useExternalArrayWithRWAccess(const T *array, int nbOfTuple, int nbOfCompo);
+    MEDCOUPLING_EXPORT T getIJSafe(int tupleId, int compoId) const;
     MEDCOUPLING_EXPORT T getIJ(int tupleId, int compoId) const { return _mem[tupleId*_info_on_compo.size()+compoId]; }
     MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); }
     MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, T newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; }
     MEDCOUPLING_EXPORT T *getPointer() { return _mem.getPointer(); declareAsNew(); }
-    void pack() const;
-    bool isAllocated() const;
-    void checkAllocated() const;
-    void desallocate();
-    void reserve(std::size_t nbOfElems);
-    void rearrange(int newNbOfCompo);
-    void transpose();
-    void pushBackSilent(T val);
-    void pushBackValsSilent(const T *valsBg, const T *valsEnd);
-    T popBackSilent();
-    T front() const;
-    T back() const;
-    std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); }
-    void allocIfNecessary(int nbOfTuple, int nbOfCompo);
-    void deepCopyFrom(const DataArrayTemplate<T>& other);
-    void reverse();
-    void fillWithValue(T val);
-    void reAlloc(std::size_t newNbOfTuple);
-    void renumberInPlace(const int *old2New);
-    void renumberInPlaceR(const int *new2Old);
-    void sort(bool asc=true);
-    typename Traits<T>::ArrayType *renumber(const int *old2New) const;
-    typename Traits<T>::ArrayType *renumberR(const int *new2Old) const;
-    typename Traits<T>::ArrayType *renumberAndReduce(const int *old2New, int newNbOfTuple) const;
-    typename Traits<T>::ArrayType *changeNbOfComponents(int newNbOfComp, T dftValue) const;
-    typename Traits<T>::ArrayType *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
-    MCAuto<typename Traits<T>::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const;
-    void circularPermutation(int nbOfShift=1);
-    void circularPermutationPerTuple(int nbOfShift=1);
-    void reversePerTuple();
-    void setPartOfValues1(const typename Traits<T>::ArrayType *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
-    void setPartOfValuesSimple1(T a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
-    void setPartOfValues2(const typename Traits<T>::ArrayType *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
-    void setPartOfValuesSimple2(T a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp);
-    void setPartOfValues3(const typename Traits<T>::ArrayType *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
-    void setPartOfValuesSimple3(T a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp);
-    void setPartOfValues4(const typename Traits<T>::ArrayType *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
-    void setPartOfValuesSimple4(T a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
-    void setPartOfValuesAdv(const typename Traits<T>::ArrayType *a, const DataArrayInt32 *tuplesSelec);
-    void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt32 *tuplesSelec);
-    void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
-    T getMaxValue(int& tupleId) const;
-    T getMaxValueInArray() const;
-    T getMaxAbsValue(std::size_t& tupleId) const;
-    T getMaxAbsValueInArray() const;
-    T getMinValue(int& tupleId) const;
-    T getMinValueInArray() const;
+    MEDCOUPLING_EXPORT void pack() const;
+    MEDCOUPLING_EXPORT bool isAllocated() const;
+    MEDCOUPLING_EXPORT void checkAllocated() const;
+    MEDCOUPLING_EXPORT void desallocate();
+    MEDCOUPLING_EXPORT void reserve(std::size_t nbOfElems);
+    MEDCOUPLING_EXPORT void rearrange(int newNbOfCompo);
+    MEDCOUPLING_EXPORT void transpose();
+    MEDCOUPLING_EXPORT void pushBackSilent(T val);
+    MEDCOUPLING_EXPORT void pushBackValsSilent(const T *valsBg, const T *valsEnd);
+    MEDCOUPLING_EXPORT T popBackSilent();
+    MEDCOUPLING_EXPORT T front() const;
+    MEDCOUPLING_EXPORT T back() const;
+    MEDCOUPLING_EXPORT std::size_t getNbOfElemAllocated() const { return _mem.getNbOfElemAllocated(); }
+    MEDCOUPLING_EXPORT void allocIfNecessary(int nbOfTuple, int nbOfCompo);
+    MEDCOUPLING_EXPORT void deepCopyFrom(const DataArrayTemplate<T>& other);
+    MEDCOUPLING_EXPORT void reverse();
+    MEDCOUPLING_EXPORT void fillWithValue(T val);
+    MEDCOUPLING_EXPORT void reAlloc(std::size_t newNbOfTuple);
+    MEDCOUPLING_EXPORT void renumberInPlace(const int *old2New);
+    MEDCOUPLING_EXPORT void renumberInPlaceR(const int *new2Old);
+    MEDCOUPLING_EXPORT void sort(bool asc=true);
+    MEDCOUPLING_EXPORT typename Traits<T>::ArrayType *renumber(const int *old2New) const;
+    MEDCOUPLING_EXPORT typename Traits<T>::ArrayType *renumberR(const int *new2Old) const;
+    MEDCOUPLING_EXPORT typename Traits<T>::ArrayType *renumberAndReduce(const int *old2New, int newNbOfTuple) const;
+    MEDCOUPLING_EXPORT typename Traits<T>::ArrayType *changeNbOfComponents(int newNbOfComp, T dftValue) const;
+    MEDCOUPLING_EXPORT typename Traits<T>::ArrayType *subArray(int tupleIdBg, int tupleIdEnd=-1) const;
+    MEDCOUPLING_EXPORT MCAuto<typename Traits<T>::ArrayTypeCh> selectPartDef(const PartDefinition* pd) const;
+    MEDCOUPLING_EXPORT void circularPermutation(int nbOfShift=1);
+    MEDCOUPLING_EXPORT void circularPermutationPerTuple(int nbOfShift=1);
+    MEDCOUPLING_EXPORT void reversePerTuple();
+    MEDCOUPLING_EXPORT void setPartOfValues1(const typename Traits<T>::ArrayType *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
+    MEDCOUPLING_EXPORT void setPartOfValuesSimple1(T a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
+    MEDCOUPLING_EXPORT void setPartOfValues2(const typename Traits<T>::ArrayType *a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
+    MEDCOUPLING_EXPORT void setPartOfValuesSimple2(T a, const int *bgTuples, const int *endTuples, const int *bgComp, const int *endComp);
+    MEDCOUPLING_EXPORT void setPartOfValues3(const typename Traits<T>::ArrayType *a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
+    MEDCOUPLING_EXPORT void setPartOfValuesSimple3(T a, const int *bgTuples, const int *endTuples, int bgComp, int endComp, int stepComp);
+    MEDCOUPLING_EXPORT void setPartOfValues4(const typename Traits<T>::ArrayType *a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp, bool strictCompoCompare=true);
+    MEDCOUPLING_EXPORT void setPartOfValuesSimple4(T a, int bgTuples, int endTuples, int stepTuples, const int *bgComp, const int *endComp);
+    MEDCOUPLING_EXPORT void setPartOfValuesAdv(const typename Traits<T>::ArrayType *a, const DataArrayInt32 *tuplesSelec);
+    MEDCOUPLING_EXPORT void setContigPartOfSelectedValues(int tupleIdStart, const DataArray *aBase, const DataArrayInt32 *tuplesSelec);
+    MEDCOUPLING_EXPORT void setContigPartOfSelectedValuesSlice(int tupleIdStart, const DataArray *aBase, int bg, int end2, int step);
+    MEDCOUPLING_EXPORT T getMaxValue(int& tupleId) const;
+    MEDCOUPLING_EXPORT T getMaxValueInArray() const;
+    MEDCOUPLING_EXPORT T getMaxAbsValue(std::size_t& tupleId) const;
+    MEDCOUPLING_EXPORT T getMaxAbsValueInArray() const;
+    MEDCOUPLING_EXPORT T getMinValue(int& tupleId) const;
+    MEDCOUPLING_EXPORT T getMinValueInArray() const;
     MEDCOUPLING_EXPORT void getTuple(int tupleId, T *res) const { std::copy(_mem.getConstPointerLoc(tupleId*_info_on_compo.size()),_mem.getConstPointerLoc((tupleId+1)*_info_on_compo.size()),res); }
     template<class InputIterator>
     void insertAtTheEnd(InputIterator first, InputIterator last);
index 9652e8ddd6503210a77bc1d57a3ba0ad4c07022f..3f1ba3f42c00011a88e8689e997f4156eaa7a087 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "MEDCouplingPartDefinition.hxx"
 
+#include <functional>
 #include <sstream>
 
 using namespace MEDCoupling;
index ba461e5a47ae9fb4fd0f4c0050df4023092004ef..51b716ba07f5e32beaa7a6344ef285e32e0ac9b1 100644 (file)
@@ -2016,7 +2016,7 @@ DataArrayInt *MEDCouplingUMesh::conformize2D(double eps)
  */
 DataArrayInt *MEDCouplingUMesh::colinearize2D(double eps)
 {
-  internalColinearize2D(eps, false);
+  return internalColinearize2D(eps, false);
 }
 
 /*!
@@ -2028,7 +2028,7 @@ DataArrayInt *MEDCouplingUMesh::colinearize2D(double eps)
  */
 DataArrayInt *MEDCouplingUMesh::colinearizeKeepingConform2D(double eps)
 {
-  internalColinearize2D(eps, true);
+  return internalColinearize2D(eps, true);
 }
 
 
index 94db55df86d2bda62e6de1e5a571728df5f78bd7..d3ac9fa3d62e06355e9a82ca2060a8283d77166f 100644 (file)
 #include "MEDCouplingCMesh.hxx"
 #include "MEDCouplingMappedExtrudedMesh.hxx"
 #include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingMemArray.hxx"
-
 #include <sstream>
 #include <cmath>
 #include <algorithm>
 #include <functional>
 
-#ifdef WIN32
-#include "MEDCouplingMemArray.txx"
-#endif
-
 using namespace MEDCoupling;
 
 void MEDCouplingBasicsTest1::testArray()
index 26033c3b0c10bd15aa574cc324463593d1bf242b..8707de7a7fd62335f247c604758178bce5df2f07 100644 (file)
@@ -87,9 +87,21 @@ IF(MEDCOUPLING_BUILD_DOC)
         swig_ready)
 ENDIF()
 
-SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i)
-SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp)
-SWIG_CHECK_GENERATION(MEDCoupling)
+IF(WIN32)
+  # Under Windows MEDCoupling conflicts wiht medcoupling from PyWrapping
+  SET(MEDCouling_target_name MEDCouplingCompat)
+ELSE()
+  SET(MEDCouling_target_name MEDCoupling)
+ENDIF()
+
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+  SWIG_ADD_MODULE(${MEDCouling_target_name} python MEDCoupling.i)  
+ELSE()
+  SWIG_ADD_LIBRARY(${MEDCouling_target_name} LANGUAGE python SOURCES MEDCoupling.i)
+ENDIF()
+
+SWIG_LINK_LIBRARIES(${MEDCouling_target_name} ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp)
+SWIG_CHECK_GENERATION(${MEDCouling_target_name})
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
 IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
   SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_FLAGS "-py3")
@@ -103,14 +115,20 @@ SET (SWIG_MODULE_MEDCouplingRemapper_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES}
     ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX}
     ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX})
 
-SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i)
+
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+  SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i)  
+ELSE()
+  SWIG_ADD_LIBRARY(MEDCouplingRemapper LANGUAGE python SOURCES MEDCouplingRemapper.i)
+ENDIF()
+
 SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBRARIES} medcouplingremapper)
 
 IF(WIN32)
   SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingRemapper_d)
-  SET_TARGET_PROPERTIES(_MEDCoupling PROPERTIES DEBUG_OUTPUT_NAME _MEDCoupling_d)
+  SET_TARGET_PROPERTIES(_${MEDCouling_target_name} PROPERTIES DEBUG_OUTPUT_NAME _${MEDCouling_target_name}_d)
 ENDIF(WIN32)
-INSTALL(TARGETS ${SWIG_MODULE_MEDCoupling_REAL_NAME} ${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
+INSTALL(TARGETS ${SWIG_MODULE_${MEDCouling_target_name}_REAL_NAME} ${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
 
 SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py)
 SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${MEDCOUPLING_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_MEDCoupling_REAL_NAME};${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME}")
index 4d3692134593b76200104c5e8e4b4b4f04422286..f9e80cf4f0bc632489a548226466de5939869003 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
+
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index 9589dc0deb450cedc261a642924a117c5ca2e518..bb74613adda4a5e53586566b7003d3c4acfe9666 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index a5d5e16fc0ff0ae7e91bca580822fcdbd0da3a48..034c288a625bed3900a99350e63abd18a3334bfb 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index 00090fb60fda793a70fafda462df65cbfae4f95b..d72103bf56cb541c55aae39dea872a72835f191d 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index b5b326bc48c68a98f60aca749294c7def4b359d0..28cfa11de0e30924369ecbd273a9ef8f4f36054e 100644 (file)
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
+
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index 76fbfb6672f3956dee17cdd06c4e3370a9b2ed0b..c5f7d5b3ee9994d9b0631720913a41c5b7ddf369 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index e8d5a9db85e5f77ca8b9e03a04022d5f2f4c9c9d..df59e032cbe17ed87c0c7c0394545dbfbc8667db 100644 (file)
@@ -31,6 +31,7 @@
 #include "MEDCouplingMappedExtrudedMesh.hxx"
 #include "MEDCouplingCMesh.hxx"
 #include "MEDCouplingIMesh.hxx"
+#include "MEDCouplingMap.txx"
 #include "MEDCouplingCurveLinearMesh.hxx"
 #include "MEDCoupling1GTUMesh.hxx"
 #include "MEDCouplingField.hxx"
index 99f975407ea5e153ae0c9060ae64cecb9fd8bf1e..f6861f0d66fa8cbc87641e961d6a699e55a2325a 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 class MEDCouplingDataForTest:
     def build2DTargetMesh_1(cls):
index fb60d96a8685eea9bd576cc3a69ece825e0e9e31..13cbd33426bd66ec9e1f7dd49e0cbd6aa616d3db 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 import unittest
 from math import pi, sqrt
 
index 17acd21f92b44bfd3787ec76807c6a6aba278b78..28e92fbc4dd3bc9c810cdcc0bd94cfa65e4ecaca 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 import unittest
 from math import pi,e,sqrt,cos,sin
 from datetime import datetime
index 90c6f5eb80a857bde13bf554f959ca0838f07b7d..0cfc225e363278a3e5f6323a0eafca90d5bfb6f3 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
 if MEDCouplingHasNumPyBindings():
     from numpy import *
index a73bb88ab849937a8a93935dff8caec0f0241e73..a8f7b3cbb801232ccff37e70eb0496fb3c1ce825 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 from MEDCouplingDataForTest import MEDCouplingDataForTest
 
 if MEDCouplingHasNumPyBindings():
index cad12285f8f61e6221d344ec2e89f836e7fd5fac..314f5c70b5e9fb19e57bb90f08bd450642028cb5 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 from math import pi, sqrt
 
 # ! [PySnippetUMeshStdBuild1_1]
index ad566904a9bd0928b70e39dcbc001ae6cbf4f531..bf8506fb67e90d90ee70228f471b86062cf2f832 100644 (file)
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+import sys
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
 
-from MEDCoupling import *
 from math import pi, sqrt
 
 import numpy
-import MEDCoupling
+if sys.platform == "win32":
+    import MEDCouplingCompat as MEDCoupling
+else:
+    import MEDCoupling
+
 #! [UG_DataArrayNumpy_0]
 # NumPy is an optional pre-requisite!
 assert(MEDCoupling.MEDCouplingHasNumPyBindings())
index 54b018f35a9b65784096eb2c42df38fa93195001..b8469f5184eeb8b670e98fd4d4f9d47d9b97c669 100644 (file)
@@ -68,11 +68,19 @@ IF(MEDCOUPLING_BUILD_DOC)
         swig_ready)
 ENDIF()
 
-SWIG_ADD_MODULE(MEDLoader python MEDLoader.i)
+
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")   
+  SWIG_ADD_MODULE(MEDLoader python MEDLoader.i)
+ELSE()
+  SWIG_ADD_LIBRARY(MEDLoader LANGUAGE python SOURCES MEDLoader.i)
+ENDIF()
+
 SWIG_LINK_LIBRARIES(MEDLoader ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medloader medcouplingcpp )
 SWIG_CHECK_GENERATION(MEDLoader)
 IF(WIN32)
   SET_TARGET_PROPERTIES(_MEDLoader PROPERTIES DEBUG_OUTPUT_NAME _MEDLoader_d)
+  # To increase the size of the .obj file on Windows because MEDLoaderPYTHON_wrap.cxx, generated by SWIG, is too big
+  TARGET_COMPILE_OPTIONS(_MEDLoader PRIVATE /bigobj) 
 ENDIF(WIN32)
 
 INSTALL(TARGETS _MEDLoader DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
index 9fa9b025bebf00eb3bc5dfb7a350c1075dc0de95..3a8e3986c961c6f24680e522b9c7bdfd2b04d6ea 100644 (file)
@@ -52,7 +52,12 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
   )
 
-SWIG_ADD_MODULE(MEDPartitioner python MEDPartitioner.i)
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")     
+  SWIG_ADD_MODULE(MEDPartitioner python MEDPartitioner.i)
+ELSE()
+  SWIG_ADD_LIBRARY(MEDPartitioner LANGUAGE python SOURCES MEDPartitioner.i)
+ENDIF()
+
 SWIG_LINK_LIBRARIES(MEDPartitioner ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medpartitionercpp)
 SWIG_CHECK_GENERATION(MEDPartitioner)
 
index 24730403b8fa0ce2b1d4dcdf9f2ef001f76944ab..d23f6b284e318f4d1be984ee4841eed3fd4a2dbe 100644 (file)
@@ -49,7 +49,12 @@ SET (SWIG_MODULE_ParaMEDMEM_EXTRA_DEPS
     ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX}
     ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX})
 
-SWIG_ADD_MODULE(ParaMEDMEM python ParaMEDMEM.i)
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")     
+  SWIG_ADD_MODULE(ParaMEDMEM python ParaMEDMEM.i)
+ELSE()
+  SWIG_ADD_LIBRARY(ParaMEDMEM LANGUAGE python SOURCES ParaMEDMEM.i)
+ENDIF()
+
 SWIG_LINK_LIBRARIES(ParaMEDMEM ${PYTHON_LIBRARIES} paramedmem)
 SWIG_CHECK_GENERATION(ParaMEDMEM)
 
index 16271266bd6581806ff500758648531a414947ac..1d05b34d017a93c9bb83ef1496cc6094038b7af5 100644 (file)
@@ -82,7 +82,12 @@ IF(MEDCOUPLING_USE_MPI)
   LIST(APPEND medcoupling_LIB_dependancies paramedmem)
 ENDIF(MEDCOUPLING_USE_MPI)
 
-SWIG_ADD_MODULE(medcoupling python medcoupling.i)
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")     
+  SWIG_ADD_MODULE(medcoupling python medcoupling.i)
+ELSE()
+  SWIG_ADD_LIBRARY(medcoupling LANGUAGE python SOURCES medcoupling.i)
+ENDIF()
+
 SWIG_LINK_LIBRARIES(medcoupling ${medcoupling_LIB_dependancies})
 SWIG_CHECK_GENERATION(medcoupling)
 IF(WIN32)
index f4df9d5af1856ab1aad572a0799bfea51d0b5e3f..fac3ae3a0ff02ee94cfcee5874991f8925165b40 100644 (file)
@@ -49,7 +49,12 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
   )
 
-SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i)
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")     
+  SWIG_ADD_MODULE(MEDRenumber python MEDRenumber.i)
+ELSE()
+  SWIG_ADD_LIBRARY(MEDRenumber LANGUAGE python SOURCES MEDRenumber.i)
+ENDIF()
+
 SWIG_LINK_LIBRARIES(MEDRenumber ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} renumbercpp)
 SWIG_CHECK_GENERATION(MEDRenumber)
 
index 3c1cec8a80cb80b44c01e5c5f501103d4be456fc..a88e4fb6f9aa3b8a1d79bb2fe4a2da5f4a0bac88 100644 (file)
@@ -22,6 +22,9 @@
 %include std_string.i
 
 %{
+#ifdef WIN32
+#define MEDCOUPLING_WIN32_SWIG
+#endif
 #include "MEDCouplingMemArray.txx"
 #include "MCAuto.hxx"
 #include "MEDCouplingDataArrayTypemaps.i"
@@ -38,7 +41,7 @@ using namespace INTERP_KERNEL;
 %init %{ import_array(); %}
 #endif
 
-%init %{ initializeMe(); %}
+%init %{ initializeMe_renumber(); %}
 
 %feature("autodoc", "1");
 %feature("docstring");
@@ -51,7 +54,7 @@ using namespace INTERP_KERNEL;
 %include "MEDCouplingMemArray.i"
 
 %{
-  void initializeMe()
+  void initializeMe_renumber()
   {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
     SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
     SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
index 8a826141ad9b20f8e0fb6a55d6aad91cad830418..f4bb200035695a4c66335a39cc86783b32f2a6a5 100644 (file)
 
 from MEDRenumber import *
 import unittest
+import sys
 
 class MEDRenumberTest(unittest.TestCase):
 
     @unittest.skipUnless("BOOST" in RenumberAvailableMethods(),"requires BOOST prerequisite !")
     def test1(self):
-        from MEDCoupling import MEDCouplingCMesh
+        if sys.platform == "win32":
+            from MEDCouplingCompat import MEDCouplingCMesh
+        else:
+            from MEDCoupling import MEDCouplingCMesh
+
         ren=RenumberingFactory("BOOST")
         arr=DataArrayDouble(10) ; arr.iota()
         c=MEDCouplingCMesh() ; c.setCoords(arr,arr)
index d61b6746f564e7e6dbff757d9bab0f44b969d401..6713ba7cabe1e94e741a08f7abd724e3f942b385 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+import sys
+
+if sys.platform == "win32":
+    from MEDCouplingCompat import *
+else:
+    from MEDCoupling import *
+
 from math import pi, sqrt
 
-import MEDCoupling
+if sys.platform == "win32":
+    import MEDCouplingCompat as MEDCoupling
+else:
+    import MEDCoupling
 
 from MEDCouplingDataForTest import MEDCouplingDataForTest
 m=MEDCouplingDataForTest.build2DTargetMesh_1();
@@ -34,7 +43,6 @@ mrenum=m[n2o]
 #! [UG_Optimization_0]
 
 #! [UG_Optimization_1]
-from MEDCoupling import MEDCouplingSkyLineArray
 import MEDPartitioner
 # prepare a MEDPartitioner
 a,b=m.computeNeighborsOfCells()