From 7ad37b74a210e500b6a307c896c73b765d4fef2b Mon Sep 17 00:00:00 2001 From: dmv Date: Thu, 21 May 2009 13:52:57 +0000 Subject: [PATCH] 0019580: EDF 702 GEOM : Partition dialog should warn the user when he create an empty object --- src/GEOMGUI/GEOM_msg_en.ts | 12 +++++++++++ .../OperationGUI_PartitionDlg.cxx | 21 +++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index eb6cd5a1c..9f9111384 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -579,6 +579,14 @@ Please, select face, shell or solid and try again GEOM_FACE Face + + GEOM_CS + Coordinate system + + + GEOM_GCS + Global coordinate system + GEOM_LCS Local coordinate system @@ -1063,6 +1071,10 @@ Please, select face, shell or solid and try again GEOM_PARTITION Partition + + GEOM_WRN_PARTITION_RESULT_EMPTY + The partition result is empty, please verify the reconstruction limit parameter. + GEOM_PARTITION_HALFSPACE Half-space partition diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index e52df271c..0b10ca391 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -34,9 +34,13 @@ #include #include #include +#include #include #include +#include +#include + //================================================================================= // class : OperationGUI_PartitionDlg() // 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; } - if ( !anObj->_is_nil() ) - objects.push_back( anObj._retn() ); + if ( !anObj->_is_nil() ) { + 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; } -- 2.39.2