X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_PolylineOperator.h;h=a4c280b8c12eb0fd72911af03536b883581879af;hb=61fb5fc7b0d481359dda905574e6bd548290716d;hp=3f92f0befff43394b0cdf9c4223241bcbdac71f7;hpb=35ecf820e6ed480b383b636631c637b1ebf53b56;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_PolylineOperator.h b/src/HYDROData/HYDROData_PolylineOperator.h index 3f92f0be..a4c280b8 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.h +++ b/src/HYDROData/HYDROData_PolylineOperator.h @@ -25,6 +25,8 @@ #include class Handle( HYDROData_Document ); +class HYDROData_TopoCurve; +class Handle(HYDROData_Object); class HYDRODATA_EXPORT HYDROData_PolylineOperator { @@ -36,7 +38,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 ); @@ -46,29 +49,41 @@ public: 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); + + 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 ) const; - - static std::vector GetWires( const Handle( HYDROData_PolylineXY )& thePolyline ); - - static std::vector Split( const TopoDS_Wire& theWire, - const gp_Pnt2d& thePoint, - double theTolerance ); - static std::vector Split( const TopoDS_Wire& theWire, - const TopoDS_Wire& theTool, - double theTolerance ); - static std::vector Split( const std::vector& theWires, - double theTolerance ); + int theIgnoreIndex, + bool& theIsIntersected) const; - 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& theWires); static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc, - const QString& theNamePrefix, + const Handle( HYDROData_PolylineXY )& theOldPolyline, const std::vector& theShape, bool isUseIndices ); };