Salome HOME
merge BR_v14_rc
[modules/hydro.git] / src / HYDROData / HYDROData_PolylineOperator.h
index ed658ffbadb1c1c412c183022fec1add7d9b8896..8e27796cea78a6f98165bbf531534985fc482ca3 100644 (file)
@@ -25,6 +25,7 @@
 #include <vector>
 
 class Handle( HYDROData_Document );
+class HYDROData_TopoCurve;
 
 class HYDRODATA_EXPORT HYDROData_PolylineOperator
 {
@@ -36,7 +37,8 @@ public:
   bool Split( const Handle( HYDROData_Document )& theDoc,
               const Handle( HYDROData_PolylineXY )& thePolyline,
               const Handle( HYDROData_PolylineXY )& theTool,
-              double theTolerance ) const;
+              double theTolerance,
+              bool& theIsIntersected) const;
   bool Split( const Handle( HYDROData_Document )& theDoc,
               const HYDROData_SequenceOfObjects& thePolylines,
               double theTolerance );
@@ -50,12 +52,25 @@ public:
     const Handle( HYDROData_PolylineXY )& thePolyline,
     std::vector<TopoDS_Wire>& theWires);
 
+  //! The method is intended to approximate the B-spline edge curve
+  //! by a 'Hydro' spline section.
+  //! Inserts the knot in the middle of each such B-spline piece that
+  //! the middle deflection is more than the required deflection and
+  //! more than the half of the maximal middle deflection.
+  //! Returns the initial maximal middle deflection.
+  //! Returns a negative value in the case of any erorr.
+  static double ReduceDeflection(
+    const double theDeflection,
+    HYDROData_TopoCurve& theCurve,
+    int& thePieceCount);
+
 protected:
   bool split( const Handle( HYDROData_Document )& theDoc,
               const Handle( HYDROData_PolylineXY )& thePolyline,
               const HYDROData_SequenceOfObjects& theTools,
               double theTolerance,
-              int theIgnoreIndex ) const;
+              int theIgnoreIndex,
+              bool& theIsIntersected) const;
 
   static void Split(
     const TopoDS_Wire& theWire,