X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineOperator.h;h=a4c280b8c12eb0fd72911af03536b883581879af;hb=39b1848f103d89cfb544a1651b3fbf221fc2c401;hp=a76a6af9eed6de3f57900d52a904e514cf41395c;hpb=b62210e48be9a46b9a7d2c85ecce2fdccefbfa07;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PolylineOperator.h b/src/HYDROData/HYDROData_PolylineOperator.h index a76a6af9..a4c280b8 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.h +++ b/src/HYDROData/HYDROData_PolylineOperator.h @@ -25,38 +25,67 @@ #include class Handle( HYDROData_Document ); +class HYDROData_TopoCurve; +class Handle(HYDROData_Object); class HYDRODATA_EXPORT HYDROData_PolylineOperator { public: bool Split( const Handle( HYDROData_Document )& theDoc, - const TCollection_AsciiString& theNamePrefix, const Handle( HYDROData_PolylineXY )& thePolyline, - const gp_Pnt2d& thePoint ) const; + const gp_Pnt2d& thePoint, + double theTolerance ) const; bool Split( const Handle( HYDROData_Document )& theDoc, - const TCollection_AsciiString& theNamePrefix, const Handle( HYDROData_PolylineXY )& thePolyline, - const Handle( HYDROData_PolylineXY )& theTool ) const; + const Handle( HYDROData_PolylineXY )& theTool, + double theTolerance, + bool& theIsIntersected) const; bool Split( const Handle( HYDROData_Document )& theDoc, - const TCollection_AsciiString& theNamePrefix, - const HYDROData_SequenceOfObjects& thePolylines ); + const HYDROData_SequenceOfObjects& thePolylines, + double theTolerance ); bool Merge( const Handle( HYDROData_Document )& theDoc, - const TCollection_AsciiString& theName, + const QString& theName, const HYDROData_SequenceOfObjects& thePolylines, - bool isConnectByNewSegment ); + bool isConnectByNewSegment, + double theTolerance ); -protected: - static std::vector GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline ); + static void GetWires( + const Handle( HYDROData_PolylineXY )& thePolyline, + std::vector& 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 error. + static double ReduceDeflection( + const double theDeflection, + HYDROData_TopoCurve& theCurve, + int& thePieceCount); - static std::vector Intersection( const Handle( Geom2d_Curve )& theCurve, - const Handle( Geom2d_Curve )& theTool ); + bool Extract( const Handle(HYDROData_Document)& theDocument, + const Handle(HYDROData_Object)& theObject ); + +protected: + bool split( const Handle( HYDROData_Document )& theDoc, + const Handle( HYDROData_PolylineXY )& thePolyline, + const HYDROData_SequenceOfObjects& theTools, + double theTolerance, + int theIgnoreIndex, + bool& theIsIntersected) const; - static std::vector Split( const Handle( Geom2d_Curve )& theCurve, - const std::vector& thePoints ); + static void Split( + const TopoDS_Wire& theWire, + const gp_Pnt2d& thePoint, + double theTolerance, + std::vector& theWires); static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc, - const TCollection_AsciiString& theNamePrefix, - const std::vector& theCurves ); + const Handle( HYDROData_PolylineXY )& theOldPolyline, + const std::vector& theShape, + bool isUseIndices ); }; #endif