From d3fccc38162f3cd07e2182efe2e575826859e3b9 Mon Sep 17 00:00:00 2001 From: isn Date: Wed, 23 Jan 2019 20:06:41 +0300 Subject: [PATCH] lot 19 wrappers --- src/HYDROData/HYDROData_Bathymetry.cxx | 14 +++++++++++++ src/HYDROData/HYDROData_Bathymetry.h | 2 ++ src/HYDROPy/HYDROData_Bathymetry.sip | 27 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index c274ff5d..d3de1f76 100755 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -465,6 +465,20 @@ bool interpolZtriangle(const gp_XY& point, vtkPolyData* delaunay2D, vtkIdList* t } #endif + +NCollection_Sequence HYDROData_Bathymetry::GetAltitudesForPoints( const NCollection_Sequence& thePoints, int theMethod) const +{ + DEBTRACE("HYDROData_Bathymetry::GetAltitudesForPoints " << GetName().toStdString()); + NCollection_Sequence aResSeq; + for ( int i = 1, n = thePoints.Length(); i <= n; ++i ) + { + const gp_XY& thePnt = thePoints.Value(i); + double anAltitude = GetAltitudeForPoint( thePnt, theMethod ); + aResSeq.Append( anAltitude ); + } + return aResSeq; +} + double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theMethod) const { DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << "), interpolation method: " << theMethod); diff --git a/src/HYDROData/HYDROData_Bathymetry.h b/src/HYDROData/HYDROData_Bathymetry.h index 67a5868c..34b4a4ad 100644 --- a/src/HYDROData/HYDROData_Bathymetry.h +++ b/src/HYDROData/HYDROData_Bathymetry.h @@ -98,6 +98,8 @@ public: HYDRODATA_EXPORT virtual HYDROData_QuadtreeNode* GetQuadtreeNodes() const; HYDRODATA_EXPORT virtual HYDROData_QuadtreeNode* ComputeQuadtreeNodes( int key) const; + HYDRODATA_EXPORT virtual NCollection_Sequence GetAltitudesForPoints( const NCollection_Sequence& thePoints, int theMethod = 0) const; + #ifndef LIGHT_MODE HYDRODATA_EXPORT virtual vtkPolyData* GetVtkDelaunay2D() const; HYDRODATA_EXPORT virtual vtkPolyData* ComputeVtkDelaunay2D(int key) const; diff --git a/src/HYDROPy/HYDROData_Bathymetry.sip b/src/HYDROPy/HYDROData_Bathymetry.sip index 0c78ace3..d1cb1eac 100644 --- a/src/HYDROPy/HYDROData_Bathymetry.sip +++ b/src/HYDROPy/HYDROData_Bathymetry.sip @@ -53,6 +53,33 @@ public: virtual void SetAltitudePoints( const HYDROData_Bathymetry::AltitudePoints& ); HYDROData_Bathymetry::AltitudePoints GetAltitudePoints() const; + NCollection_Sequence GetAltitudesForPoints( const NCollection_Sequence& theCoordsX, + const NCollection_Sequence& theCoordsY, + int theMethod = 0) const + [NCollection_Sequence ( const NCollection_Sequence&, int)]; + %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 ); + } + + int aMethod = a2; + + NCollection_Sequence aRes; + Py_BEGIN_ALLOW_THREADS + aRes = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudesForPoints( aPnts, aMethod ) : + sipCpp->GetAltitudesForPoints( aPnts, aMethod ); + Py_END_ALLOW_THREADS + + sipRes = new NCollection_Sequence( aRes ); + %End + + void RemoveAltitudePoints(); public: -- 2.39.2