From: adv Date: Fri, 24 Jan 2014 05:54:45 +0000 (+0000) Subject: API for GetZoneFromPoint() corrected to be more pythonic. X-Git-Tag: BR_hydro_v_1_0~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5a8d8e4352ca50e2b12a2ddf25f0fd8f6f842418;p=modules%2Fhydro.git API for GetZoneFromPoint() corrected to be more pythonic. --- diff --git a/src/HYDROPy/HYDROData_CalculationCase.sip b/src/HYDROPy/HYDROData_CalculationCase.sip index 4ebb4b59..bf1cb020 100644 --- a/src/HYDROPy/HYDROData_CalculationCase.sip +++ b/src/HYDROPy/HYDROData_CalculationCase.sip @@ -296,14 +296,20 @@ public: * \param thePoint the point to examine * \return result zone */ - HYDROData_Zone GetZoneFromPoint( const gp_XY& thePoint ) const [Handle_HYDROData_Zone ( const gp_XY& )]; + HYDROData_Zone GetZoneFromPoint( SIP_PYTUPLE ) const [Handle_HYDROData_Zone ( const gp_XY& )]; %MethodCode Handle(HYDROData_Zone) aRes; - Py_BEGIN_ALLOW_THREADS - aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetZoneFromPoint( *a0 ) : - sipCpp->GetZoneFromPoint( *a0 ); - Py_END_ALLOW_THREADS + double x = 0.0, y = 0.0; + if ( PyArg_ParseTuple( a0, "dd", &x, &y ) ) + { + gp_XY aPnt( x, y ); + + Py_BEGIN_ALLOW_THREADS + aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetZoneFromPoint( aPnt ) : + sipCpp->GetZoneFromPoint( aPnt ); + Py_END_ALLOW_THREADS + } sipRes = (HYDROData_Zone*)createPointer( aRes ); %End