From: abk Date: Wed, 5 Aug 2015 14:21:08 +0000 (+0300) Subject: refs #626: No warning appears during attempt splitting not intersected polylines X-Git-Tag: BR_quadtree_20150925~2^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d4c96dba2a8044a02dd03c841812033e9c2f6ed7;p=modules%2Fhydro.git refs #626: No warning appears during attempt splitting not intersected polylines Functionality to output the warning using the flag was created. --- diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx index 5adf7730..ff9f45c2 100644 --- a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx +++ b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -87,15 +89,24 @@ bool HYDROGUI_SplitPolylinesOp::processApply( int& theUpdateFlags, double aTolerance = 1E-2; //TODO HYDROData_PolylineOperator anOp; - bool isIntersected = false; switch( aPanel->GetMode() ) { case HYDROGUI_SplitPolylinesDlg::ByPoint: anOp.Split( doc(), aMainPolyline, aPoint, aTolerance ); break; case HYDROGUI_SplitPolylinesDlg::ByTool: + { + 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; diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index a2b27fd5..27f896be 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -3024,6 +3024,14 @@ Polyline should consist from one not closed curve. SPLIT_POLYLINES Split polylines + + SPLIT_POLYLINE_BY_TOOL_WARNING_TITLE + Split polyline by tool + + + SPLIT_POLYLINE_BY_TOOL_WARNING_MSG + The splitted polyline is not intersected by the tool. +