]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Correction of the swig module
authorEl Hadi Moussi <moussi@phimeca.com>
Fri, 9 Aug 2024 11:17:20 +0000 (13:17 +0200)
committerEl Hadi Moussi <moussi@phimeca.com>
Fri, 9 Aug 2024 11:17:20 +0000 (13:17 +0200)
src/ShapeRecogn/ShapeRecognMesh.hxx
src/ShapeRecogn/Swig/CMakeLists.txt
src/ShapeRecogn/Swig/ShapeRecogn.i [new file with mode: 0644]
src/ShapeRecogn/Swig/ShapeRecognMesh.i [deleted file]

index feaaba09f52caaa87a74ddea788a31d3f58f778b..6defd49a4370366acd255296fb92448f5bc426fd 100644 (file)
@@ -75,6 +75,7 @@ namespace MEDCoupling
             DataArrayDouble *values) const;
         double *buildArea3DArray(const std::array<double, 3> &(*areaFunc)(Areas *, mcIdType)) const;
         double *buildAreaArray(double (*areaFunc)(Areas *, mcIdType)) const;
+
         const MEDCouplingUMesh *mesh;
         Nodes *nodes = nullptr;
         Areas *areas = nullptr;
index e03cbeaf4489843dbedf0903f3492ce2a1b5e383..8e839d15656bfe11bdbd90e3c93c5852f9735feb 100644 (file)
@@ -22,18 +22,20 @@ INCLUDE(${SWIG_USE_FILE})
 
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
 
-SET_SOURCE_FILES_PROPERTIES(ShapeRecognMesh.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(ShapeRecogn.i PROPERTIES CPLUSPLUS ON)
 IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
-  SET_SOURCE_FILES_PROPERTIES(ShapeRecognMesh.i PROPERTIES SWIG_FLAGS "-py3")
+  SET_SOURCE_FILES_PROPERTIES(ShapeRecogn.i PROPERTIES SWIG_FLAGS "-py3")
 ELSE()
-  SET_SOURCE_FILES_PROPERTIES(ShapeRecognMesh.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+  SET_SOURCE_FILES_PROPERTIES(ShapeRecogn.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 ENDIF()
+
+SET(SWIG_MODULE_ShapeRecogn_EXTRA_FLAGS "")
 IF(MEDCOUPLING_USE_64BIT_IDS)
-  STRING(APPEND SWIG_MODULE_ShapeRecogn_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS")
+  STRING(APPEND SWIG_MODULE_ShapeRecogn_EXTRA_FLAGS "-DMEDCOUPLING_USE_64BIT_IDS")
 ENDIF(MEDCOUPLING_USE_64BIT_IDS)
 
 SET (ShapeRecogn_SWIG_DPYS_FILES
-  ShapeRecognMesh.i
+  ShapeRecogn.i
 )
 
 INCLUDE_DIRECTORIES(
@@ -42,6 +44,7 @@ INCLUDE_DIRECTORIES(
   ${HDF5_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/..
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader
   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling_Swig
   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling
   ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL
@@ -54,25 +57,25 @@ SET (SWIG_MODULE_ShapeRecogn_EXTRA_DEPS ${ShapeRecogn_SWIG_DPYS_FILES}
     ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX})
 
 IF(WIN32)
-  SET_PROPERTY(SOURCE ShapeRecognMesh.i PROPERTY COMPILE_DEFINITIONS WIN32)
+  SET_PROPERTY(SOURCE ShapeRecogn.i PROPERTY COMPILE_DEFINITIONS WIN32)
 ENDIF()
 
 IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")   
-  SWIG_ADD_MODULE(ShapeRecognMesh python ShapeRecognMesh.i)
+  SWIG_ADD_MODULE(ShapeRecogn python ShapeRecogn.i)
 ELSE()
-  SWIG_ADD_LIBRARY(ShapeRecognMesh LANGUAGE python SOURCES ShapeRecognMesh.i)
+  SWIG_ADD_LIBRARY(ShapeRecogn LANGUAGE python SOURCES ShapeRecogn.i)
 ENDIF()
 
-SWIG_LINK_LIBRARIES(ShapeRecognMesh ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} shaperecogn medloader medcouplingcpp)
-SWIG_CHECK_GENERATION(ShapeRecognMesh)
+SWIG_LINK_LIBRARIES(ShapeRecogn ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} shaperecogn medloader medcouplingcpp)
+SWIG_CHECK_GENERATION(ShapeRecogn)
 IF(WIN32)
-  SET_TARGET_PROPERTIES(_ShapeRecognMesh PROPERTIES DEBUG_OUTPUT_NAME _ShapeRecogn_d)
+  SET_TARGET_PROPERTIES(_ShapeRecogn PROPERTIES DEBUG_OUTPUT_NAME _ShapeRecogn_d)
   # To increase the size of the .obj file on Windows because ShapeRecognPYTHON_wrap.cxx, generated by SWIG, is too big
-  TARGET_COMPILE_OPTIONS(_ShapeRecognMesh PRIVATE /bigobj) 
+  TARGET_COMPILE_OPTIONS(_ShapeRecogn PRIVATE /bigobj) 
 ENDIF(WIN32)
 
-INSTALL(TARGETS _ShapeRecognMesh DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES ShapeRecognMesh.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
+INSTALL(TARGETS _ShapeRecogn DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
+INSTALL(FILES ShapeRecogn.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
 
 SALOME_INSTALL_SCRIPTS(
   ${CMAKE_CURRENT_BINARY_DIR}/ShapeRecogn.py 
diff --git a/src/ShapeRecogn/Swig/ShapeRecogn.i b/src/ShapeRecogn/Swig/ShapeRecogn.i
new file mode 100644 (file)
index 0000000..f97e5f9
--- /dev/null
@@ -0,0 +1,13 @@
+%module ShapeRecogn
+
+%include "std_string.i"
+%include "MEDCouplingCommon.i"
+
+%{
+#include "ShapeRecognMesh.hxx"
+using namespace MEDCoupling;
+%}
+
+%ignore getAreas() const;
+%ignore getNodes() const;
+%include "ShapeRecognMesh.hxx"
diff --git a/src/ShapeRecogn/Swig/ShapeRecognMesh.i b/src/ShapeRecogn/Swig/ShapeRecognMesh.i
deleted file mode 100644 (file)
index 06a7948..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-%module ShapeRecogn
-
-%include "std_string.i"
-
-%{
-#include "ShapeRecognMesh.hxx"
-using namespace MEDCoupling;
-%}
-
-%ignore getAreas() const;
-%ignore getNodes() const;
-%include "ShapeRecognMesh.hxx"