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
20 #include <HYDROData_PolylineOperator.h>
23 class HYDROData_PolylineOperator
28 #include "HYDRO_trace.hxx"
29 #include <HYDROData_PolylineOperator.h>
34 HYDROData_PolylineOperator();
36 ~HYDROData_PolylineOperator();
38 bool SplitPoint( HYDROData_Document theDoc,
39 HYDROData_PolylineXY thePolyline,
41 double theTolerance ) const
42 [bool (opencascade::handle<HYDROData_Document>&, opencascade::handle<HYDROData_PolylineXY>&, const gp_Pnt2d&, double)];
44 Handle(HYDROData_PolylineXY) aPoly = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a1 ) );
45 gp_Pnt2d aPnt( a2, a3 );
46 if ( !aPoly.IsNull() )
48 Py_BEGIN_ALLOW_THREADS
49 sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::SplitPoint( a0, aPoly, aPnt, a4 ):
50 sipCpp->SplitPoint( a0, aPoly, aPnt, a4 );
55 bool SplitTool( HYDROData_Document theDoc,
56 HYDROData_PolylineXY thePolyline,
57 HYDROData_PolylineXY theTool,
59 bool& theIsIntersected) const
60 [bool (opencascade::handle<HYDROData_Document>&, opencascade::handle<HYDROData_PolylineXY>&, opencascade::handle<HYDROData_PolylineXY>&, double, bool&)];
62 Handle(HYDROData_PolylineXY) aPoly = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a1 ) );
63 Handle(HYDROData_PolylineXY) aTool = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a2 ) );
64 if ( !aPoly.IsNull() && !aTool.IsNull())
66 Py_BEGIN_ALLOW_THREADS
67 sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::SplitTool( a0, aPoly, aTool, a3, a4 ):
68 sipCpp->SplitTool( a0, aPoly, aTool, a3, a4 );
73 bool SplitAll( HYDROData_Document theDoc,
74 std::vector<HYDROData_Entity*> thePolylines,
76 [bool (opencascade::handle<HYDROData_Document>&, const HYDROData_SequenceOfObjects&, double)];
78 NCollection_Sequence<Handle(HYDROData_Entity)> objs;
79 for (size_t i = 0; i != a1->size(); i++)
81 DEBTRACE("item " << i);
82 Handle(HYDROData_Entity) anEnt = createHandle( (*a1)[i] );
85 Py_BEGIN_ALLOW_THREADS
86 sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::SplitAll( a0, objs, a2):
87 sipCpp->SplitAll( a0, objs, a2);
91 bool Merge( HYDROData_Document theDoc,
92 const QString& theName,
93 std::vector<HYDROData_Entity*> thePolylines,
94 bool isConnectByNewSegment,
96 [bool (opencascade::handle<HYDROData_Document>&, const QString&, const HYDROData_SequenceOfObjects&, bool, double)];
98 NCollection_Sequence<Handle(HYDROData_Entity)> objs;
99 for (size_t i = 0; i != a2->size(); i++)
101 DEBTRACE("item " << i);
102 Handle(HYDROData_Entity) anEnt = createHandle( (*a2)[i] );
105 Py_BEGIN_ALLOW_THREADS
106 sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::Merge( a0, *a1, objs, a3, a4):
107 sipCpp->Merge( a0, *a1, objs, a3, a4);