Salome HOME
Exlude the user input during process events by application (Bug #325).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ChannelOp.cxx
index 2ffdc5430d9462acec9f976708c2513cad10a1b4..38d16ae440520b49ededb060e2939842a09b3827 100644 (file)
@@ -39,6 +39,7 @@
 #include <LightApp_Application.h>
 #include <LightApp_UpdateFlags.h>
 
+#include <TopoDS.hxx>
 
 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 );