From: asl Date: Thu, 26 Dec 2013 11:00:12 +0000 (+0000) Subject: bug #294: closed wires are forbidden X-Git-Tag: BR_hydro_v_0_7~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a6e028016c1b5ed7009aa6e820d02bdaeb87ee3;p=modules%2Fhydro.git bug #294: closed wires are forbidden --- diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index 2ffdc543..38d16ae4 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -39,6 +39,7 @@ #include #include +#include HYDROGUI_ChannelOp::HYDROGUI_ChannelOp( HYDROGUI_Module* theModule, const bool theIsEdit ) @@ -87,7 +88,24 @@ void HYDROGUI_ChannelOp::startOperation() } // collect information about existing 3d polylines - QStringList aGuideLines = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_POLYLINE ); + QStringList aGuideLines; + QStringList anAllGuideLines = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_POLYLINE ); + foreach( QString aGuideLine, anAllGuideLines ) + { + Handle( HYDROData_Polyline3D ) aPolyline3d = + Handle( HYDROData_Polyline3D )::DownCast( + HYDROGUI_Tool::FindObjectByName( module(), aGuideLine, KIND_POLYLINE ) ); + if( !aPolyline3d.IsNull() ) + { + TopoDS_Shape aShape = aPolyline3d->GetShape3D(); + if( aShape.ShapeType()==TopAbs_WIRE ) + { + TopoDS_Wire aWire = TopoDS::Wire( aShape ); + if( !aWire.Closed() ) + aGuideLines.append( aGuideLine ); + } + } + } // collect information about existing profiles QStringList aProfiles = HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_PROFILE );