1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROData_PolylineOperator_HeaderFile
20 #define HYDROData_PolylineOperator_HeaderFile
22 #include <HYDROData_PolylineXY.h>
23 #include <Geom2d_Curve.hxx>
24 #include <gp_Pnt2d.hxx>
27 class Handle( HYDROData_Document );
29 class HYDRODATA_EXPORT HYDROData_PolylineOperator
32 bool Split( const Handle( HYDROData_Document )& theDoc,
33 const TCollection_AsciiString& theNamePrefix,
34 const Handle( HYDROData_PolylineXY )& thePolyline,
35 const gp_Pnt2d& thePoint ) const;
36 bool Split( const Handle( HYDROData_Document )& theDoc,
37 const TCollection_AsciiString& theNamePrefix,
38 const Handle( HYDROData_PolylineXY )& thePolyline,
39 const Handle( HYDROData_PolylineXY )& theTool ) const;
40 bool Split( const Handle( HYDROData_Document )& theDoc,
41 const TCollection_AsciiString& theNamePrefix,
42 const HYDROData_SequenceOfObjects& thePolylines );
43 bool Merge( const Handle( HYDROData_Document )& theDoc,
44 const TCollection_AsciiString& theName,
45 const HYDROData_SequenceOfObjects& thePolylines,
46 bool isConnectByNewSegment );
49 static std::vector<Handle( Geom2d_Curve )> GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline );
51 static std::vector<gp_Pnt2d> Intersection( const Handle( Geom2d_Curve )& theCurve,
52 const Handle( Geom2d_Curve )& theTool );
54 static std::vector<Handle( Geom2d_Curve )> Split( const Handle( Geom2d_Curve )& theCurve,
55 const std::vector<gp_Pnt2d>& thePoints );
57 static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc,
58 const TCollection_AsciiString& theNamePrefix,
59 const std::vector<Handle( Geom2d_Curve )>& theCurves );