]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
API for GetZoneFromPoint() corrected to be more pythonic.
authoradv <adv@opencascade.com>
Fri, 24 Jan 2014 05:54:45 +0000 (05:54 +0000)
committeradv <adv@opencascade.com>
Fri, 24 Jan 2014 05:54:45 +0000 (05:54 +0000)
src/HYDROPy/HYDROData_CalculationCase.sip

index 4ebb4b59b8fb3f122b7b28f963233cba1b048ff3..bf1cb020352d625c44b7a473532bd4ca19bcb986 100644 (file)
@@ -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