From e2a86f95793c73c1e2339d42ce38bb07af0f0bff Mon Sep 17 00:00:00 2001 From: isn Date: Tue, 13 Sep 2016 15:44:52 +0300 Subject: [PATCH] GetStricklerCoefficientForPoints() py wrapper p.2 --- src/HYDROData/HYDROData_CalculationCase.cxx | 10 +++++----- src/HYDROData/HYDROData_CalculationCase.h | 6 +++--- src/HYDROData/HYDROData_LCM_FaceClassifier.cxx | 2 +- src/HYDROData/HYDROData_LCM_FaceClassifier.h | 2 +- src/HYDROData/HYDROData_LandCoverMap.cxx | 4 ++-- src/HYDROData/HYDROData_LandCoverMap.h | 6 +++--- src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 2b2cb691..fef44bd1 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -905,18 +905,18 @@ double HYDROData_CalculationCase::GetStricklerCoefficientForPoint( const gp_XY& return aCoeff; } -bool HYDROData_CalculationCase::GetStricklerCoefficientForPoints(const std::vector& thePoints, - std::vector& theCoeffs, double DefValue, bool UseMax ) +std::vector HYDROData_CalculationCase::GetStricklerCoefficientForPoints(const std::vector& thePoints, + double DefValue, bool UseMax ) const { - Handle( HYDROData_LandCoverMap ) aLCM = GetLandCoverMap(); Handle( HYDROData_StricklerTable ) aTable = GetStricklerTable(); + std::vector theCoeffs; if( aLCM.IsNull() || aTable.IsNull() ) - return false; + return theCoeffs; aLCM->ClassifyPoints(thePoints, aTable, theCoeffs, DefValue, UseMax ); - return true; + return theCoeffs; } Handle(HYDROData_Region) HYDROData_CalculationCase::GetRegionFromPoint( const gp_XY& thePoint ) const diff --git a/src/HYDROData/HYDROData_CalculationCase.h b/src/HYDROData/HYDROData_CalculationCase.h index 88655837..ca0fd81c 100644 --- a/src/HYDROData/HYDROData_CalculationCase.h +++ b/src/HYDROData/HYDROData_CalculationCase.h @@ -341,9 +341,9 @@ public: */ HYDRODATA_EXPORT double GetStricklerCoefficientForPoint( const gp_XY& thePoint ) const; - HYDRODATA_EXPORT bool GetStricklerCoefficientForPoints(const std::vector& thePoints, - std::vector& theCoeffs, double DefValue, - bool UseMax ); + HYDRODATA_EXPORT std::vector GetStricklerCoefficientForPoints(const std::vector& thePoints, + double DefValue, + bool UseMax ) const; /** * Returns altitudes for given points on given region. diff --git a/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx b/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx index faf7678f..9e3a8f91 100644 --- a/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx +++ b/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx @@ -57,7 +57,7 @@ Standard_Boolean HYDROData_FaceClassifier_BndBoxTreeSelector::Accept (const Stan } -void HYDROData_LCM_FaceClassifier::Classify( const std::vector& thePoints, +void HYDROData_LCM_FaceClassifier::Classify( const std::vector& thePoints, std::vector >& theTypes, std::vector >* theFaces) const { diff --git a/src/HYDROData/HYDROData_LCM_FaceClassifier.h b/src/HYDROData/HYDROData_LCM_FaceClassifier.h index 6afd303d..1a83a7ef 100644 --- a/src/HYDROData/HYDROData_LCM_FaceClassifier.h +++ b/src/HYDROData/HYDROData_LCM_FaceClassifier.h @@ -89,7 +89,7 @@ public: ~HYDROData_LCM_FaceClassifier() {}; - void Classify( const std::vector& thePoints, + void Classify( const std::vector& thePoints, std::vector >& theTypes, std::vector >* theFaces) const; diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index f709b378..4b816d8d 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -1259,13 +1259,13 @@ void HYDROData_LandCoverMap::UpdateLocalCS( double theDx, double theDy ) SetShape( aLocatedShape ); } -void HYDROData_LandCoverMap::ClassifyPoints( const std::vector& thePoints, std::vector >& theTypes ) const +void HYDROData_LandCoverMap::ClassifyPoints( const std::vector& thePoints, std::vector >& theTypes ) const { HYDROData_LCM_FaceClassifier FC(this); FC.Classify(thePoints, theTypes, NULL); } -void HYDROData_LandCoverMap::ClassifyPoints( const std::vector& thePoints, +void HYDROData_LandCoverMap::ClassifyPoints( const std::vector& thePoints, Handle(HYDROData_StricklerTable) theTable, std::vector& theCoeffs, double DefValue, bool UseMax ) const { diff --git a/src/HYDROData/HYDROData_LandCoverMap.h b/src/HYDROData/HYDROData_LandCoverMap.h index f0d17d17..e009351a 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@ -41,7 +41,7 @@ class TopoDS_Iterator; class TopTools_ListOfShape; class Handle( HYDROData_PolylineXY ); class Handle( HYDROData_Object ); -class gp_Pnt2d; +class gp_XY; class HYDROData_LandCoverMap : public HYDROData_Entity { @@ -150,9 +150,9 @@ public: HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy ); - HYDRODATA_EXPORT void ClassifyPoints( const std::vector& thePoints, std::vector >& theTypes ) const; + HYDRODATA_EXPORT void ClassifyPoints( const std::vector& thePoints, std::vector >& theTypes ) const; - HYDRODATA_EXPORT void ClassifyPoints( const std::vector& thePoints, + HYDRODATA_EXPORT void ClassifyPoints( const std::vector& thePoints, Handle(HYDROData_StricklerTable) theTable, std::vector& theCoeffs, double DefValue, bool UseMax ) const; diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 3656a9aa..8b0fed78 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -1182,7 +1182,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf() LCM->StoreLandCovers(aMapFace2ST); - std::vector pnts; + std::vector pnts; #ifdef NDEBUG int N = 1000; //1000*1000 points; uniform distribution for release mode #else @@ -1200,7 +1200,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf() { double px = x0 + (x1-x0)*((double)i/(double)N); double py = y0 + (y1-y0)*((double)j/(double)N); - pnts.push_back(gp_Pnt2d(px,py)); + pnts.push_back(gp_XY(px,py)); } } OSD_Timer aTimer; @@ -1238,7 +1238,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_check() TopoDS_Shape Sh = LCM->GetShape(); - std::vector pnts; + std::vector pnts; pnts.push_back(gp_XY(0,0)); pnts.push_back(gp_XY(468380, 6382300)); -- 2.39.2