From: jfa Date: Wed, 29 Jun 2011 11:04:49 +0000 (+0000) Subject: IPAL22456: TC6.3.0: main shape dissapears after Explode with Select Sub Shapes option. X-Git-Tag: V6_3_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=56c5e93e6b20cd1ea2fbc9f1aa35e139461e30f5;p=modules%2Fgeom.git IPAL22456: TC6.3.0: main shape dissapears after Explode with Select Sub Shapes option. --- diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx index d46c36353..19d30cbf4 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // GEOM GEOMGUI : GUI for Geometry component // File : EntityGUI_SubShapeDlg.cxx @@ -64,7 +63,9 @@ //================================================================================= EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl) - : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl), + myWithShape(true), + myIsHiddenMain(false) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SUBSHAPE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); @@ -111,6 +112,11 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge //================================================================================= EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg() { + if (myIsHiddenMain) { + GEOM_Displayer* aDisplayer = getDisplayer(); + aDisplayer->Display(myObject); + myIsHiddenMain = false; + } } //================================================================================= @@ -289,6 +295,12 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument() return; } + if (myIsHiddenMain) { + GEOM_Displayer* aDisplayer = getDisplayer(); + aDisplayer->Display(myObject); + myIsHiddenMain = false; + } + TopoDS_Shape S = GEOMBase::GetTopoFromSelection(aSelList); if (S.IsNull() || S.ShapeType() == TopAbs_VERTEX) { myObject = GEOM::GEOM_Object::_nil(); @@ -393,6 +405,11 @@ void EntityGUI_SubShapeDlg::LineEditReturnPressed() //================================================================================= void EntityGUI_SubShapeDlg::ResetStateOfDialog() { + if (myIsHiddenMain) { + GEOM_Displayer* aDisplayer = getDisplayer(); + aDisplayer->Display(myObject); + myIsHiddenMain = false; + } myObject = GEOM::GEOM_Object::_nil(); myShape.Nullify(); myEditCurrentArgument->setText(""); @@ -496,7 +513,7 @@ unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S, void EntityGUI_SubShapeDlg::updateButtonState() { if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() != OCCViewer_Viewer::Type() || - myObject->_is_nil() || shapeType() == TopAbs_SHAPE || shapeType() == TopAbs_COMPOUND) { + myObject->_is_nil() || shapeType() == TopAbs_SHAPE || shapeType() == TopAbs_COMPOUND) { GroupPoints->CheckButton1->setChecked(false); GroupPoints->CheckButton1->setEnabled(false); } @@ -641,7 +658,15 @@ void EntityGUI_SubShapeDlg::activateSelection() if (!myObject->_is_nil() && !isAllSubShapes()) { GEOM_Displayer* aDisplayer = getDisplayer(); - aDisplayer->Erase(myObject, false, false); + SALOME_View* view = GEOM_Displayer::GetActiveView(); + if (view) { + CORBA::String_var aMainEntry = myObject->GetStudyEntry(); + Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO"); + if (view->isVisible(io)) { + aDisplayer->Erase(myObject, false, false); + myIsHiddenMain = true; + } + } int prevDisplayMode = aDisplayer->SetDisplayMode(0); diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.h b/src/EntityGUI/EntityGUI_SubShapeDlg.h index 2bcf9011e..7ac5e8b75 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.h +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.h @@ -88,6 +88,8 @@ private: bool myWithShape; + bool myIsHiddenMain; + DlgRef_1Sel1List1Check3Btn* GroupPoints; }; diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index b5c9ff925..8ada99289 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // GEOM GEOMGUI : GUI for Geometry component // File : GroupGUI_GroupDlg.cxx @@ -72,7 +71,8 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW : GEOMBase_Skeleton(theGeometryGUI, parent, false), myMode(mode), myBusy(false), - myIsShapeType(false) + myIsShapeType(false), + myIsHiddenMain(false) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); @@ -184,6 +184,11 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW GroupGUI_GroupDlg::~GroupGUI_GroupDlg() { + if (myIsHiddenMain) { + GEOM_Displayer* aDisplayer = getDisplayer(); + aDisplayer->Display(myMainObj); + myIsHiddenMain = false; + } } //================================================================================= @@ -461,6 +466,11 @@ void GroupGUI_GroupDlg::SelectionIntoArgument() GEOMBase::ConvertIOinGEOMObject(aSelList.First()); if (GEOMBase::IsShape(anObj)) { + if (myIsHiddenMain) { + GEOM_Displayer* aDisplayer = getDisplayer(); + aDisplayer->Display(myMainObj); + myIsHiddenMain = false; + } myMainObj = anObj; myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); // activate subshapes selection by default @@ -470,6 +480,11 @@ void GroupGUI_GroupDlg::SelectionIntoArgument() } } else { + if (myIsHiddenMain) { + GEOM_Displayer* aDisplayer = getDisplayer(); + aDisplayer->Display(myMainObj); + myIsHiddenMain = false; + } myMainObj = GEOM::GEOM_Object::_nil(); } } @@ -788,7 +803,15 @@ void GroupGUI_GroupDlg::activateSelection() myIsShapeType) // check if shape type is already choosen by user { GEOM_Displayer* aDisplayer = getDisplayer(); - aDisplayer->Erase(myMainObj, false, false); + SALOME_View* view = GEOM_Displayer::GetActiveView(); + if (view) { + CORBA::String_var aMainEntry = myMainObj->GetStudyEntry(); + Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO"); + if (view->isVisible(io)) { + aDisplayer->Erase(myMainObj, false, false); + myIsHiddenMain = true; + } + } int prevDisplayMode = aDisplayer->SetDisplayMode(0); diff --git a/src/GroupGUI/GroupGUI_GroupDlg.h b/src/GroupGUI/GroupGUI_GroupDlg.h index 7bcec71b2..49faaa0e0 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.h +++ b/src/GroupGUI/GroupGUI_GroupDlg.h @@ -96,6 +96,7 @@ private: Mode myMode; bool myBusy; bool myIsShapeType; + bool myIsHiddenMain; GEOM::GEOM_Object_var myMainObj; GEOM::GEOM_Object_var myGroup; GEOM::GEOM_Object_var myInPlaceObj;