]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
GetStricklerCoefficientForPoints() py wrapper p.2
authorisn <isn@opencascade.com>
Tue, 13 Sep 2016 12:44:52 +0000 (15:44 +0300)
committerisn <isn@opencascade.com>
Tue, 13 Sep 2016 12:44:52 +0000 (15:44 +0300)
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_LCM_FaceClassifier.cxx
src/HYDROData/HYDROData_LCM_FaceClassifier.h
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDROData/HYDROData_LandCoverMap.h
src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx

index 2b2cb691e5bee23e8a99022e5ca121c982c91734..fef44bd1741569f6fb7ffead13ba75e45e49d84e 100644 (file)
@@ -905,18 +905,18 @@ double HYDROData_CalculationCase::GetStricklerCoefficientForPoint( const gp_XY&
   return aCoeff;
 }
 
-bool HYDROData_CalculationCase::GetStricklerCoefficientForPoints(const std::vector<gp_Pnt2d>& thePoints,
-  std::vector<double>& theCoeffs, double DefValue, bool UseMax )
+std::vector<double> HYDROData_CalculationCase::GetStricklerCoefficientForPoints(const std::vector<gp_XY>& thePoints,
+  double DefValue, bool UseMax ) const
 {
-
   Handle( HYDROData_LandCoverMap ) aLCM = GetLandCoverMap();
   Handle( HYDROData_StricklerTable ) aTable = GetStricklerTable();
+  std::vector<double> 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
index 88655837886846f48cb516889b0f14069dce445a..ca0fd81cb7440fd67c66a972ae83b618904bd734 100644 (file)
@@ -341,9 +341,9 @@ public:
    */
   HYDRODATA_EXPORT double GetStricklerCoefficientForPoint( const gp_XY& thePoint ) const;
 
-  HYDRODATA_EXPORT bool GetStricklerCoefficientForPoints(const std::vector<gp_Pnt2d>& thePoints,
-                                                         std::vector<double>& theCoeffs, double DefValue,
-                                                         bool UseMax );
+  HYDRODATA_EXPORT std::vector<double> GetStricklerCoefficientForPoints(const std::vector<gp_XY>& thePoints,
+                                                                        double DefValue,
+                                                                        bool UseMax ) const;
 
   /**
    * Returns altitudes for given points on given region.
index faf7678ff23cec6c5e38216e84c1be623b092255..9e3a8f913b0d8565f1cc00b59e0cd5f3133ac629 100644 (file)
@@ -57,7 +57,7 @@ Standard_Boolean HYDROData_FaceClassifier_BndBoxTreeSelector::Accept (const Stan
 
 }
 
-void HYDROData_LCM_FaceClassifier::Classify( const std::vector<gp_Pnt2d>& thePoints, 
+void HYDROData_LCM_FaceClassifier::Classify( const std::vector<gp_XY>& thePoints, 
                                              std::vector<std::set <QString> >& theTypes,
                                              std::vector<NCollection_Map<TopoDS_Face> >* theFaces) const
 {
index 6afd303d6d763d894c9626cb628db91d800beca4..1a83a7efede3c8bee1c7bc8de75bb241eba396ff 100644 (file)
@@ -89,7 +89,7 @@ public:
   ~HYDROData_LCM_FaceClassifier()
   {};
 
-  void Classify( const std::vector<gp_Pnt2d>& thePoints, 
+  void Classify( const std::vector<gp_XY>& thePoints, 
     std::vector<std::set <QString> >& theTypes, 
     std::vector<NCollection_Map <TopoDS_Face> >* theFaces) const;
 
index f709b378cf92bca158f93bea3d210d1001d1ad29..4b816d8db04ae6591be44cf590584287e59350b3 100644 (file)
@@ -1259,13 +1259,13 @@ void HYDROData_LandCoverMap::UpdateLocalCS( double theDx, double theDy )
   SetShape( aLocatedShape );
 }
 
-void HYDROData_LandCoverMap::ClassifyPoints( const std::vector<gp_Pnt2d>& thePoints, std::vector<std::set <QString> >& theTypes ) const
+void HYDROData_LandCoverMap::ClassifyPoints( const std::vector<gp_XY>& thePoints, std::vector<std::set <QString> >& theTypes ) const
 {
   HYDROData_LCM_FaceClassifier FC(this);
   FC.Classify(thePoints, theTypes, NULL);
 }
 
-void HYDROData_LandCoverMap::ClassifyPoints( const std::vector<gp_Pnt2d>& thePoints,  
+void HYDROData_LandCoverMap::ClassifyPoints( const std::vector<gp_XY>& thePoints,  
   Handle(HYDROData_StricklerTable) theTable, 
   std::vector<double>& theCoeffs, double DefValue, bool UseMax ) const
 {
index f0d17d17482627b4e36ffac3de932a823257c9b4..e009351a2baa6e20176ca49c3baa0b7218103401 100644 (file)
@@ -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<gp_Pnt2d>& thePoints, std::vector<std::set <QString> >& theTypes ) const;
+  HYDRODATA_EXPORT void ClassifyPoints( const std::vector<gp_XY>& thePoints, std::vector<std::set <QString> >& theTypes ) const;
 
-  HYDRODATA_EXPORT void ClassifyPoints( const std::vector<gp_Pnt2d>& thePoints,
+  HYDRODATA_EXPORT void ClassifyPoints( const std::vector<gp_XY>& thePoints,
     Handle(HYDROData_StricklerTable) theTable, 
     std::vector<double>& theCoeffs, double DefValue, bool UseMax ) const;
 
index 3656a9aab100be06828fd0f3ce10980f8f058da7..8b0fed78a6f510b004093cce123c32c603c17658 100644 (file)
@@ -1182,7 +1182,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf()
 
   LCM->StoreLandCovers(aMapFace2ST);
 
-  std::vector<gp_Pnt2d> pnts;
+  std::vector<gp_XY> 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<gp_Pnt2d> pnts;
+  std::vector<gp_XY> pnts;
   pnts.push_back(gp_XY(0,0));
 
   pnts.push_back(gp_XY(468380, 6382300));