0019580: EDF 702 GEOM : Partition dialog should warn the user when he create an empty object

This commit is contained in:
dmv 2009-05-21 13:52:57 +00:00
parent cbde7a165c
commit 7ad37b74a2
2 changed files with 31 additions and 2 deletions

View File

@ -579,6 +579,14 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_FACE</source> <source>GEOM_FACE</source>
<translation>Face</translation> <translation>Face</translation>
</message> </message>
<message>
<source>GEOM_CS</source>
<translation>Coordinate system</translation>
</message>
<message>
<source>GEOM_GCS</source>
<translation>Global coordinate system</translation>
</message>
<message> <message>
<source>GEOM_LCS</source> <source>GEOM_LCS</source>
<translation>Local coordinate system</translation> <translation>Local coordinate system</translation>
@ -1063,6 +1071,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_PARTITION</source> <source>GEOM_PARTITION</source>
<translation>Partition</translation> <translation>Partition</translation>
</message> </message>
<message>
<source>GEOM_WRN_PARTITION_RESULT_EMPTY</source>
<translation>The partition result is empty, please verify the reconstruction limit parameter.</translation>
</message>
<message> <message>
<source>GEOM_PARTITION_HALFSPACE</source> <source>GEOM_PARTITION_HALFSPACE</source>
<translation>Half-space partition</translation> <translation>Half-space partition</translation>

View File

@ -34,9 +34,13 @@
#include <SUIT_Desktop.h> #include <SUIT_Desktop.h>
#include <SUIT_Session.h> #include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h> #include <SUIT_ResourceMgr.h>
#include <SUIT_MessageBox.h>
#include <SalomeApp_Application.h> #include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h> #include <LightApp_SelectionMgr.h>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
//================================================================================= //=================================================================================
// class : OperationGUI_PartitionDlg() // class : OperationGUI_PartitionDlg()
// purpose : Constructs a OperationGUI_PartitionDlg which is a child of 'parent', with the // purpose : Constructs a OperationGUI_PartitionDlg which is a child of 'parent', with the
@ -404,8 +408,21 @@ bool OperationGUI_PartitionDlg::execute( ObjectList& objects )
res = true; res = true;
} }
if ( !anObj->_is_nil() ) if ( !anObj->_is_nil() ) {
objects.push_back( anObj._retn() ); TopoDS_Shape aShape;
GEOMBase::GetShape(anObj, aShape, TopAbs_SHAPE);
TopoDS_Iterator It (aShape, Standard_True, Standard_True);
int nbSubshapes=0;
for (; It.More(); It.Next())
nbSubshapes++;
if (nbSubshapes)
objects.push_back( anObj._retn() );
else
SUIT_MessageBox::warning(this,
QObject::tr("GEOM_ERROR"),
QObject::tr("GEOM_WRN_PARTITION_RESULT_EMPTY"));
}
return res; return res;
} }