From 660f03eed450a2010cc27e730004e9b06ab19cc4 Mon Sep 17 00:00:00 2001 From: dmv Date: Wed, 16 Apr 2008 10:17:40 +0000 Subject: [PATCH] NPAL 19561 Name of objects does not appear in the context menu of VTK viewer --- src/SMESHGUI/SMESHGUI.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 01e535f2d..3e3194dc4 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3131,11 +3131,23 @@ QString SMESHGUI::engineIOR() const return QString( anIOR.in() ); } -void SMESHGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ ) +void SMESHGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& title ) { SMESHGUI_Selection sel; sel.init( client, selectionMgr() ); popupMgr()->updatePopup( menu, &sel ); + + SalomeApp_Module::contextMenuPopup( client, menu, title ); + SALOME_ListIO lst; + getApp()->selectionMgr()->selectedObjects( lst ); + if ( ( client == "OCCViewer" || client == "VTKViewer" ) && lst.Extent() == 1 ) { + Handle(SALOME_InteractiveObject) io = lst.First(); + SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); + _PTR(Study) study = appStudy->studyDS(); + _PTR(SObject) obj = study->FindObjectID( io->getEntry() ); + if ( obj ) + title = QString( obj->GetName().c_str() ); + } } void SMESHGUI::windows( QMap& aMap ) const -- 2.39.2