Salome HOME
merge BR_v14_rc from origin
[modules/hydro.git] / src / HYDROData / HYDROData_PolylineOperator.h
index 3f92f0befff43394b0cdf9c4223241bcbdac71f7..7740bf5ed3977d3a7f13ffa842df76c93a1b73d8 100644 (file)
@@ -25,6 +25,7 @@
 #include <vector>
 
 class Handle( HYDROData_Document );
+class HYDROData_TopoCurve;
 
 class HYDRODATA_EXPORT HYDROData_PolylineOperator
 {
@@ -46,6 +47,22 @@ public:
               bool isConnectByNewSegment,
               double theTolerance );
 
+  static void GetWires(
+    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,
@@ -53,19 +70,11 @@ protected:
               double theTolerance,
               int theIgnoreIndex ) const;
 
-  static std::vector<TopoDS_Wire> GetWires( const Handle( HYDROData_PolylineXY )& thePolyline );
-
-  static std::vector<TopoDS_Shape> Split( const TopoDS_Wire& theWire,
-                                          const gp_Pnt2d& thePoint,
-                                          double theTolerance );
-  static std::vector<TopoDS_Shape> Split( const TopoDS_Wire& theWire,
-                                          const TopoDS_Wire& theTool,
-                                          double theTolerance );
-  static std::vector<TopoDS_Shape> Split( const std::vector<TopoDS_Wire>& theWires,
-                                          double theTolerance );
-
-  static bool Merge( TopoDS_Shape& theShape, const TopoDS_Wire& theWire, 
-                     bool isConnectByNewSegment, double theTolerance );
+  static void Split(
+    const TopoDS_Wire& theWire,
+    const gp_Pnt2d& thePoint,
+    double theTolerance,
+    std::vector<TopoDS_Shape>& theWires);
 
   static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc,
                                const QString& theNamePrefix,