From: El Hadi Moussi Date: Fri, 9 Aug 2024 11:17:20 +0000 (+0200) Subject: Correction of the swig module X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4bc97a290e4b1ce14eace3f07be7de554b77aff5;p=tools%2Fmedcoupling.git Correction of the swig module --- diff --git a/src/ShapeRecogn/ShapeRecognMesh.hxx b/src/ShapeRecogn/ShapeRecognMesh.hxx index feaaba09f..6defd49a4 100644 --- a/src/ShapeRecogn/ShapeRecognMesh.hxx +++ b/src/ShapeRecogn/ShapeRecognMesh.hxx @@ -75,6 +75,7 @@ namespace MEDCoupling DataArrayDouble *values) const; double *buildArea3DArray(const std::array &(*areaFunc)(Areas *, mcIdType)) const; double *buildAreaArray(double (*areaFunc)(Areas *, mcIdType)) const; + const MEDCouplingUMesh *mesh; Nodes *nodes = nullptr; Areas *areas = nullptr; diff --git a/src/ShapeRecogn/Swig/CMakeLists.txt b/src/ShapeRecogn/Swig/CMakeLists.txt index e03cbeaf4..8e839d156 100644 --- a/src/ShapeRecogn/Swig/CMakeLists.txt +++ b/src/ShapeRecogn/Swig/CMakeLists.txt @@ -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 index 000000000..f97e5f9ea --- /dev/null +++ b/src/ShapeRecogn/Swig/ShapeRecogn.i @@ -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 index 06a7948b8..000000000 --- a/src/ShapeRecogn/Swig/ShapeRecognMesh.i +++ /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"