X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROPy%2FHYDROData_CalculationCase.sip;h=5b7c7f2ce97297644332904975566cd1a804c811;hb=e989e0f3cdd230307b28ed0128a49978b27096ef;hp=9557333f7d6a1142c7557e9ebdf1a47bdb15ea4c;hpb=b2c8c65866a6132584b866808d41777142430ada;p=modules%2Fhydro.git diff --git a/src/HYDROPy/HYDROData_CalculationCase.sip b/src/HYDROPy/HYDROData_CalculationCase.sip index 9557333f..5b7c7f2c 100644 --- a/src/HYDROPy/HYDROData_CalculationCase.sip +++ b/src/HYDROPy/HYDROData_CalculationCase.sip @@ -22,8 +22,15 @@ %ExportedHeaderCode #include +#include %End +enum HYDROData_PriorityType +{ + LESS, + GREATER, +}; + class HYDROData_CalculationCase : public HYDROData_Entity { @@ -300,6 +307,27 @@ public: Py_END_ALLOW_THREADS %End + /** + * Returns altitude for given point on given region. + * \param thePoint the point to examine + * \param theRegion reference region to check + * \return result altitude value + */ + double GetAltitudeForPoint( const double theCoordX, + const double theCoordY, + HYDROData_Region theRegion ) const + [double ( const gp_XY&, const Handle_HYDROData_Region& )]; + %MethodCode + gp_XY aPnt( a0, a1 ); + Handle(HYDROData_Region) aRefRegion = + Handle(HYDROData_Region)::DownCast( createHandle( a2 ) ); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudeForPoint( aPnt, aRefRegion ) : + sipCpp->GetAltitudeForPoint( aPnt, aRefRegion ); + Py_END_ALLOW_THREADS + %End + /** * Returns altitude for given point on given zone. * \param thePoint the point to examine @@ -321,6 +349,39 @@ public: Py_END_ALLOW_THREADS %End + /** + * Returns altitudes for given points on given region. + * \param thePoints the points to examine + * \param theZone reference region to check + * \return result altitude value + */ + NCollection_Sequence GetAltitudesForPoints( const NCollection_Sequence& theCoordsX, + const NCollection_Sequence& theCoordsY, + HYDROData_Region theRegion ) const + [NCollection_Sequence ( const NCollection_Sequence&, const Handle_HYDROData_Region& )]; + %MethodCode + + NCollection_Sequence aPnts; + + int aLen = qMin( a0->Length(), a1->Length() ); + for ( int i = 1; i <= aLen; ++i ) + { + gp_XY aPnt( a0->Value( i ), a1->Value( i ) ); + aPnts.Append( aPnt ); + } + + Handle(HYDROData_Region) aRefRegion = + Handle(HYDROData_Region)::DownCast( createHandle( a2 ) ); + + NCollection_Sequence aRes; + Py_BEGIN_ALLOW_THREADS + aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetAltitudesForPoints( aPnts, aRefRegion ) : + sipCpp->GetAltitudesForPoints( aPnts, aRefRegion ); + Py_END_ALLOW_THREADS + + sipRes = new NCollection_Sequence( aRes ); + %End + /** * Returns altitudes for given points on given zone. * \param thePoints the points to examine @@ -354,6 +415,27 @@ public: sipRes = new NCollection_Sequence( aRes ); %End + /** + * Returns region to which the point is belongs. + * \param thePoint the point to examine + * \return result region + */ + HYDROData_Region GetRegionFromPoint( const double theCoordX, + const double theCoordY ) const + [Handle_HYDROData_Region ( const gp_XY& )]; + %MethodCode + Handle(HYDROData_Region) aRes; + + gp_XY aPnt( a0, a1 ); + + Py_BEGIN_ALLOW_THREADS + aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetRegionFromPoint( aPnt ) : + sipCpp->GetRegionFromPoint( aPnt ); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_Region*)createPointer( aRes ); + %End + /** * Returns zone to which the point is belongs. * \param thePoint the point to examine @@ -397,6 +479,28 @@ public: Py_END_ALLOW_THREADS %End + + void ClearRules(); + + void AddRule( HYDROData_Object theObject1, + HYDROData_PriorityType thePriority, + HYDROData_Object theObject2, + HYDROData_Zone::MergeAltitudesType theMergeType ) + [void ( const Handle_HYDROData_Object&, HYDROData_PriorityType, const Handle_HYDROData_Object&, HYDROData_Zone::MergeAltitudesType )]; + %MethodCode + Handle(HYDROData_Object) anObject1 = + Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); + Handle(HYDROData_Object) anObject2 = + Handle(HYDROData_Object)::DownCast( createHandle( a2 ) ); + + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddRule( anObject1, a1, anObject2, a3 ) : + sipCpp->AddRule( anObject1, a1, anObject2, a3 ); + Py_END_ALLOW_THREADS + %End + + QString DumpRules(); + protected: /**