From ee2c38087265d128e7d3febc042834b08539b504 Mon Sep 17 00:00:00 2001 From: mzn Date: Wed, 17 Aug 2005 10:44:08 +0000 Subject: [PATCH] Fix for problem: empty root object in the Object Browser after trying to delete "Mesh" object. --- src/SMESHGUI/SMESHGUI.cxx | 14 +++++++++++--- src/SMESHGUI/SMESHGUI.h | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 1a469b7a8..f38896472 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -655,7 +655,8 @@ namespace{ return RefType; } - void OnEditDelete() + + void SMESHGUI::OnEditDelete() { // VSR 17/11/04: check if all objects selected belong to SMESH component --> start SalomeApp_SelectionMgr* aSel = SMESHGUI::selectionMgr(); @@ -703,6 +704,13 @@ namespace{ if(IObject->hasEntry()){ _PTR(SObject) SO = aStudy->FindObjectID(IObject->getEntry()); + // disable removal of "SMESH" component object + if(SO->FindAttribute(anAttr, "AttributeIOR")){ + anIOR = anAttr; + if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) ) + continue; + } + /* Erase child graphical objects */ _PTR(ChildIterator) it = aStudy->NewChildIterator(SO); for(it->InitEx(true); it->More(); it->Next()){ @@ -1053,7 +1061,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) switch (theCommandID) { case 33: // DELETE if(checkLock(aStudy)) break; - ::OnEditDelete(); + OnEditDelete(); break; case 113: // IMPORT @@ -2601,7 +2609,7 @@ void SMESHGUI::initialize( CAM_Application* app ) anId = popupMgr()->insert( tr( "MEN_NUM" ), -1, -1 ); popupMgr()->insert( action( 9010 ), anId, -1 ); - popupMgr()->setRule( action( 9010 ), aMeshInVTK + "&& isVisible &&" + hasNodes, true );//@ + popupMgr()->setRule( action( 9010 ), aMeshInVTK + "&& isVisible &&" + hasNodes, true ); popupMgr()->setRule( action( 9010 ), "{'Point'} in labeledTypes", false ); popupMgr()->insert( action( 9011 ), anId, -1 ); diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index a3b75e9c8..c07220183 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -119,6 +119,9 @@ protected: void createPopupItem( const int, const QString&, const QString&, const QString& = QString::null, const int = -1 ); +private: + void OnEditDelete(); + private : static SMESH::SMESH_Gen_var myComponentSMESH; QDialog* myActiveDialogBox; -- 2.30.2