Salome HOME
Merge branch 'BR_v14_rc' of ssh://git.salome-platform.org/modules/hydro into BR_v14_rc
[modules/hydro.git] / src / HYDROData / HYDROData_PolylineOperator.h
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.
6 //
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.
11 //
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
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROData_PolylineOperator_HeaderFile
20 #define HYDROData_PolylineOperator_HeaderFile
21
22 #include <HYDROData_PolylineXY.h>
23 #include <Geom2d_Curve.hxx>
24 #include <gp_Pnt2d.hxx>
25 #include <vector>
26
27 class Handle( HYDROData_Document );
28
29 class HYDRODATA_EXPORT HYDROData_PolylineOperator
30 {
31 public:
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
47 protected:
48   static std::vector<Handle( Geom2d_Curve )> GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline );
49
50   static std::vector<gp_Pnt2d> Intersection( const Handle( Geom2d_Curve )& theCurve,
51                                              const Handle( Geom2d_Curve )& theTool );
52
53   static std::vector<Handle( Geom2d_Curve )> Split( const Handle( Geom2d_Curve )& theCurve,
54                                                     const std::vector<gp_Pnt2d>& thePoints );
55
56   static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc,
57                                const TCollection_AsciiString& theNamePrefix,
58                                const std::vector<Handle( Geom2d_Curve )>& theCurves );
59 };
60
61 #endif