Salome HOME
Merge branch 'BR_LCM_COMP' into HEAD
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_SplitPolylinesOp.cxx
index c81b1c6b76375ecf06be8d8869a19bb0b30f84b0..ff9f45c210f6a55387b94329ff61ae4d820d046d 100644 (file)
@@ -26,6 +26,8 @@
 #include <LightApp_Application.h>
 #include <OCCViewer_ViewModel.h>
 #include <OCCViewer_ViewManager.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
 #include <gp_Pnt2d.hxx>
 #include <BRepLib_MakeVertex.hxx>
 #include <BRep_Builder.hxx>
@@ -93,8 +95,18 @@ bool HYDROGUI_SplitPolylinesOp::processApply( int& theUpdateFlags,
     anOp.Split( doc(), aMainPolyline, aPoint, aTolerance );
     break;
   case HYDROGUI_SplitPolylinesDlg::ByTool:
-    anOp.Split( doc(), aMainPolyline, aToolPolyline, aTolerance );
+  {
+    bool isIntersected = false;
+    anOp.Split( doc(), aMainPolyline, aToolPolyline, aTolerance, isIntersected);
+
+    if (!isIntersected)
+    {
+      const QString aTitle = tr("SPLIT_POLYLINE_BY_TOOL_WARNING_TITLE");
+      const QString aMsg = tr("SPLIT_POLYLINE_BY_TOOL_WARNING_MSG");
+      SUIT_MessageBox::warning(module()->getApp()->desktop(), aTitle, aMsg);
+    }
     break;
+  }
   case HYDROGUI_SplitPolylinesDlg::Split:
     anOp.Split( doc(), aPolylinesList, aTolerance );
     break;