From f847628af7a488ed9c5c666814d7e412f73ad656 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 14 Jan 2014 09:04:31 +0000 Subject: [PATCH] SIP: NCollection_Sequence mapping is updated. --- CMake/UsePyQt4EXT.cmake | 14 ++++++++++++-- src/HYDROPy/CAS/NCollection_Sequence.sip | 10 +++++----- src/HYDROPy/HYDROData_Bathymetry.sip | 8 ++++---- src/HYDROPy/HYDROData_IPolyline.sip | 8 ++++---- src/HYDROPy/HYDROData_Profile.sip | 13 ++++++------- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/CMake/UsePyQt4EXT.cmake b/CMake/UsePyQt4EXT.cmake index 7472ff58..63bb86eb 100644 --- a/CMake/UsePyQt4EXT.cmake +++ b/CMake/UsePyQt4EXT.cmake @@ -133,8 +133,8 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc) - LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc) - SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc) +# LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc) +# SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc) @@ -150,6 +150,16 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles) LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc) SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc) + + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_BathymetryAltitudePoint.cc) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_BathymetryAltitudePoint.cc) + + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylinePoint.cc) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylinePoint.cc) + + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_ProfileProfilePoint.cc) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_ProfileProfilePoint.cc) + # LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc) # SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc) diff --git a/src/HYDROPy/CAS/NCollection_Sequence.sip b/src/HYDROPy/CAS/NCollection_Sequence.sip index ed07ef94..8c002cd3 100644 --- a/src/HYDROPy/CAS/NCollection_Sequence.sip +++ b/src/HYDROPy/CAS/NCollection_Sequence.sip @@ -45,7 +45,7 @@ template TYPE *t = new TYPE(sipCpp->Value(i)); PyObject *tobj; - if ((tobj = sipConvertFromNewType(t, sipType_TYPE, sipTransferObj)) == NULL) + if ((tobj = sipConvertFromNewType(t, sipFindType("TYPE"), sipTransferObj)) == NULL) { Py_DECREF(l); delete t; @@ -71,7 +71,7 @@ template for (SIP_SSIZE_T i = 0; i < len; ++i) { PyObject *itm = PySequence_ITEM(sipPy, i); - bool ok = (itm && sipCanConvertToType(itm, sipType_TYPE, SIP_NOT_NONE)); + bool ok = (itm && sipCanConvertToType(itm, sipFindType("TYPE"), SIP_NOT_NONE)); Py_XDECREF(itm); @@ -89,13 +89,13 @@ template { PyObject *itm = PySequence_ITEM(sipPy, i); int state; - TYPE *t = reinterpret_cast(sipConvertToType(itm, sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); + TYPE *t = reinterpret_cast(sipConvertToType(itm, sipFindType("TYPE"), sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); Py_DECREF(itm); if (*sipIsErr) { - sipReleaseType(t, sipType_TYPE, state); + sipReleaseType(t, sipFindType("TYPE"), state); delete aSeq; return 0; @@ -103,7 +103,7 @@ template aSeq->Append(*t); - sipReleaseType(t, sipType_TYPE, state); + sipReleaseType(t, sipFindType("TYPE"), state); } *sipCppPtr = aSeq; diff --git a/src/HYDROPy/HYDROData_Bathymetry.sip b/src/HYDROPy/HYDROData_Bathymetry.sip index 349318a6..057b2767 100644 --- a/src/HYDROPy/HYDROData_Bathymetry.sip +++ b/src/HYDROPy/HYDROData_Bathymetry.sip @@ -26,10 +26,6 @@ class HYDROData_Bathymetry : HYDROData_IAltitudeObject { - - typedef gp_XYZ AltitudePoint; - typedef NCollection_Sequence AltitudePoints; - %ConvertToSubClassCode switch ( sipCpp->GetKind() ) { @@ -43,6 +39,10 @@ class HYDROData_Bathymetry : HYDROData_IAltitudeObject } %End + typedef gp_XYZ AltitudePoint; + typedef NCollection_Sequence AltitudePoints; + + %TypeHeaderCode #include %End diff --git a/src/HYDROPy/HYDROData_IPolyline.sip b/src/HYDROPy/HYDROData_IPolyline.sip index ca0a630c..885a97b9 100644 --- a/src/HYDROPy/HYDROData_IPolyline.sip +++ b/src/HYDROPy/HYDROData_IPolyline.sip @@ -26,14 +26,14 @@ class HYDROData_IPolyline : HYDROData_Entity /Abstract/ { - - typedef gp_XY Point; - typedef NCollection_Sequence PointsList; - %TypeHeaderCode #include %End + typedef gp_XY Point; + typedef NCollection_Sequence PointsList; + + %ConvertToSubClassCode switch ( sipCpp->GetKind() ) { diff --git a/src/HYDROPy/HYDROData_Profile.sip b/src/HYDROPy/HYDROData_Profile.sip index 41ec2f78..ab34b1bc 100644 --- a/src/HYDROPy/HYDROData_Profile.sip +++ b/src/HYDROPy/HYDROData_Profile.sip @@ -26,14 +26,13 @@ class HYDROData_Profile : public HYDROData_Object { -public: - - typedef gp_XYZ ProfilePoint; - typedef NCollection_Sequence ProfilePoints; - %TypeHeaderCode #include "HYDROData_Profile.h" %End +public: + + typedef gp_XYZ ProfilePoint; + typedef NCollection_Sequence ProfilePoints; public: /** @@ -143,14 +142,14 @@ public: * First and last points will be automatically updated. * \param thePoints the list with new profile points */ - void SetProfilePoints( const ProfilePoints thePoints ); + void SetProfilePoints( const HYDROData_Profile::ProfilePoints thePoints ); /** * Returns profile points. * Empty sequence is returned if first or last point was not set. * \return profile points list */ - ProfilePoints GetProfilePoints() const; + HYDROData_Profile::ProfilePoints GetProfilePoints() const; public: -- 2.39.2