X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineOperator.h;h=6fea45128c56f22ef759fda3f9ccfaa00cd0d1d0;hb=4bef76eb65a4ad3c90ff28b84a1df70054fef8b4;hp=d3e49e3526e0a1d4e7d7bcb5c94ce79ac844e90a;hpb=c0d628b2e1f42a693a91c1054f42dcfd36a054e5;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PolylineOperator.h b/src/HYDROData/HYDROData_PolylineOperator.h index d3e49e35..6fea4512 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.h +++ b/src/HYDROData/HYDROData_PolylineOperator.h @@ -24,25 +24,68 @@ #include #include -class HYDROData_PolylineOperator +class HYDROData_Document; +class HYDROData_TopoCurve; +class HYDROData_Object; + +class HYDRODATA_EXPORT HYDROData_PolylineOperator { public: - HYDRODATA_EXPORT bool Split( const Handle( HYDROData_PolylineXY )& thePolyline, - const gp_Pnt2d& thePoint ) const; - HYDRODATA_EXPORT bool Split( const Handle( HYDROData_PolylineXY )& thePolyline, - const Handle( HYDROData_PolylineXY )& theTool ) const; - HYDRODATA_EXPORT bool Split( const HYDROData_SequenceOfObjects& thePolylines ); - HYDRODATA_EXPORT bool Merge( const HYDROData_SequenceOfObjects& thePolylines ); + bool Split( const Handle( HYDROData_Document )& theDoc, + const Handle( HYDROData_PolylineXY )& thePolyline, + const gp_Pnt2d& thePoint, + double theTolerance ) const; + bool Split( const Handle( HYDROData_Document )& theDoc, + const Handle( HYDROData_PolylineXY )& thePolyline, + const Handle( HYDROData_PolylineXY )& theTool, + double theTolerance, + bool& theIsIntersected) const; + bool Split( const Handle( HYDROData_Document )& theDoc, + const HYDROData_SequenceOfObjects& thePolylines, + double theTolerance ); + bool Merge( const Handle( HYDROData_Document )& theDoc, + const QString& theName, + const HYDROData_SequenceOfObjects& thePolylines, + bool isConnectByNewSegment, + double theTolerance ); + + 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 HYDRODATA_EXPORT std::vector GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline ); + bool Extract( const Handle(HYDROData_Document)& theDocument, + const Handle(HYDROData_Object)& theObject ); - static HYDRODATA_EXPORT std::vector Intersection( const Handle( Geom2d_Curve )& theCurve, - const Handle( Geom2d_Curve )& theTool ); +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 HYDRODATA_EXPORT 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 HYDRODATA_EXPORT bool CreatePolylines( const std::vector& theCurves ); + static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc, + const Handle( HYDROData_PolylineXY )& theOldPolyline, + const std::vector& theShape, + bool isUseIndices ); }; #endif