]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
21939: Issue a warning dialog if the result of MakeShell is a compound of faces
authorskv <skv@opencascade.com>
Thu, 12 Dec 2013 11:24:04 +0000 (11:24 +0000)
committerskv <skv@opencascade.com>
Thu, 12 Dec 2013 11:24:04 +0000 (11:24 +0000)
src/BuildGUI/BuildGUI_ShellDlg.cxx
src/GEOMGUI/GEOM_msg_en.ts

index e4b12199c08c19600d98dcd035e8c00c20e7109b..37b8929304b5c4285aacf54bd940ce1fee3c3128 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <GEOMImpl_Types.hxx>
 
+#include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SalomeApp_Application.h>
@@ -260,8 +261,17 @@ bool BuildGUI_ShellDlg::execute( ObjectList& objects )
 
   GEOM::GEOM_Object_var anObj = anOper->MakeShell( objlist.in() );
 
-  if ( !anObj->_is_nil() )
+  if ( !anObj->_is_nil() ) {
+    TopoDS_Shape aShell;
+    GEOMBase::GetShape(anObj, aShell, TopAbs_SHELL);
+
+    if (aShell.IsNull()) {
+      SUIT_MessageBox::warning(this,
+                               QObject::tr("GEOM_WRN_WARNING"),
+                               QObject::tr("GEOM_WRN_FACES_NOT_SHELL"));
+    }
     objects.push_back( anObj._retn() );
+  }
 
   return true;
 }
index ec1445ed517b6e235ac94c215deda1b45877c652..add4553bd8818163314dc59338a79b41ac4efcfa 100644 (file)
@@ -2316,6 +2316,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_WRN_WARNING</source>
         <translation>Warning</translation>
     </message>
+    <message>
+        <source>GEOM_WRN_FACES_NOT_SHELL</source>
+        <translation>Unable to create a shell. Result is a compound of faces.</translation>
+    </message>
     <message>
         <source>WRN_SHAPE_UNCLOSED</source>
         <translation>Unable to create solid from unclosed shape %1</translation>