// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // %ExportedHeaderCode #include %End class HYDROData_PolylineOperator { %TypeHeaderCode //#define _DEVDEBUG_ #include "HYDRO_trace.hxx" #include %End public: HYDROData_PolylineOperator(); ~HYDROData_PolylineOperator(); bool SplitPoint( HYDROData_Document theDoc, HYDROData_PolylineXY thePolyline, double x, double y, double theTolerance ) const [bool (opencascade::handle&, opencascade::handle&, const gp_Pnt2d&, double)]; %MethodCode Handle(HYDROData_PolylineXY) aPoly = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a1 ) ); gp_Pnt2d aPnt( a2, a3 ); if ( !aPoly.IsNull() ) { Py_BEGIN_ALLOW_THREADS sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::SplitPoint( a0, aPoly, aPnt, a4 ): sipCpp->SplitPoint( a0, aPoly, aPnt, a4 ); Py_END_ALLOW_THREADS } %End bool SplitTool( HYDROData_Document theDoc, HYDROData_PolylineXY thePolyline, HYDROData_PolylineXY theTool, double theTolerance, bool& theIsIntersected) const [bool (opencascade::handle&, opencascade::handle&, opencascade::handle&, double, bool&)]; %MethodCode Handle(HYDROData_PolylineXY) aPoly = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a1 ) ); Handle(HYDROData_PolylineXY) aTool = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a2 ) ); if ( !aPoly.IsNull() && !aTool.IsNull()) { Py_BEGIN_ALLOW_THREADS sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::SplitTool( a0, aPoly, aTool, a3, a4 ): sipCpp->SplitTool( a0, aPoly, aTool, a3, a4 ); Py_END_ALLOW_THREADS } %End bool SplitAll( HYDROData_Document theDoc, std::vector thePolylines, double theTolerance ) [bool (opencascade::handle&, const HYDROData_SequenceOfObjects&, double)]; %MethodCode NCollection_Sequence objs; for (size_t i = 0; i != a1->size(); i++) { DEBTRACE("item " << i); Handle(HYDROData_Entity) anEnt = createHandle( (*a1)[i] ); objs.Append(anEnt); } Py_BEGIN_ALLOW_THREADS sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::SplitAll( a0, objs, a2): sipCpp->SplitAll( a0, objs, a2); Py_END_ALLOW_THREADS %End bool Merge( HYDROData_Document theDoc, const QString& theName, std::vector thePolylines, bool isConnectByNewSegment, double theTolerance ) [bool (opencascade::handle&, const QString&, const HYDROData_SequenceOfObjects&, bool, double)]; %MethodCode NCollection_Sequence objs; for (size_t i = 0; i != a2->size(); i++) { DEBTRACE("item " << i); Handle(HYDROData_Entity) anEnt = createHandle( (*a2)[i] ); objs.Append(anEnt); } Py_BEGIN_ALLOW_THREADS sipRes = sipSelfWasArg ? sipCpp->HYDROData_PolylineOperator::Merge( a0, *a1, objs, a3, a4): sipCpp->Merge( a0, *a1, objs, a3, a4); Py_END_ALLOW_THREADS %End };