Salome HOME
Merge branch 'BR_H2018_3' into BR_2018_V8_5
[modules/hydro.git] / src / HYDROPy / HYDROData_CalculationCase.sip
index a70e7f9bd7d824a2b870c82b94d12e69d3222a53..dac4e0d40f026c2e4ad101f581c3cebfb3b1dc6d 100644 (file)
@@ -176,6 +176,47 @@ public:
    */
   void RemoveGeometryGroups();
 
+     
+  /**
+   * Add new boundary polygon to calculation case.
+   */
+  bool AddBoundaryPolygon( HYDROData_BCPolygon theObject ) [bool ( const opencascade::handle<HYDROData_BCPolygon>& )];
+  %MethodCode
+    Handle(HYDROData_BCPolygon) aRef =
+      Handle(HYDROData_BCPolygon)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddBoundaryPolygon( aRef ):
+                               sipCpp->AddBoundaryPolygon( aRef );
+      Py_END_ALLOW_THREADS
+    }
+  %End
+
+  /**
+   * Returns all boundary polygons of calculation case.
+   */
+  HYDROData_SequenceOfObjects GetBoundaryPolygons() const;
+
+  /**
+   * Removes boundary polygon from calculation case.
+   */
+  void RemoveBoundaryPolygon( HYDROData_BCPolygon theObject )
+  [void ( const opencascade::handle<HYDROData_BCPolygon>& )];
+  %MethodCode
+    Handle(HYDROData_BCPolygon) aRef =
+      Handle(HYDROData_BCPolygon)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      if ( sipSelfWasArg ) {
+        sipCpp->HYDROData_CalculationCase::RemoveBoundaryPolygon( aRef );
+      } else {
+        sipCpp->RemoveBoundaryPolygon( aRef );
+      }
+      Py_END_ALLOW_THREADS
+    }
+  %End
 
   /**
    * Sets reference boundary polyline object for calculation case.
@@ -479,6 +520,26 @@ public:
   %End
 
 
+  std::vector<int> GetStricklerTypeForPoints( const NCollection_Sequence<double>& theCoordsX,
+                                              const NCollection_Sequence<double>& theCoordsY ) const
+  [std::vector<int>( const NCollection_Sequence<gp_XY>& )];
+  %MethodCode
+  std::vector<gp_XY> 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.push_back( aPnt );
+  }
+  std::vector<int> aRes;
+  Py_BEGIN_ALLOW_THREADS
+  aRes = sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::GetStricklerTypeForPoints( aPnts ) : 
+                         sipCpp->GetStricklerTypeForPoints( aPnts );
+  Py_END_ALLOW_THREADS
+  sipRes = new std::vector<int>( aRes );
+  %End
+
+
   /**
    * Returns altitudes for given points on given zone.
    * \param thePoints the points to examine