21939: Issue a warning dialog if the result of MakeShell is a compound of faces

This commit is contained in:
skv 2013-12-12 11:24:04 +00:00
parent d7caf30133
commit 6fa43b8d27
2 changed files with 15 additions and 1 deletions

View 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;
}

View 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>