From: ptv Date: Wed, 17 Nov 2010 08:47:59 +0000 (+0000) Subject: 0020830: EDF 1357 GUI : Hide/Show Icon X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1ad6590ec1200cc06186047e1f17e57e91dc0dd5;p=modules%2Fsmesh.git 0020830: EDF 1357 GUI : Hide/Show Icon --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index aac1477f3..30321350d 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -42,6 +42,7 @@ #include "SMESHGUI_FilterDlg.h" #include "SMESHGUI_FilterLibraryDlg.h" #include "SMESHGUI_FindElemByPointDlg.h" +#include "SMESHGUI_GEOMGenUtils.h" #include "SMESHGUI_GroupDlg.h" #include "SMESHGUI_GroupOnShapeDlg.h" #include "SMESHGUI_GroupOpDlg.h" @@ -5453,3 +5454,32 @@ void SMESHGUI::onHypothesisEdit( int result ) SMESHGUI::Modified(); updateObjBrowser( true ); } + +/*! + * \brief Virtual public slot + * + * This method updates visibility state + * Redefined to make visible geometry objects + */ +void SMESHGUI::initVisibilityState( SUIT_DataObject* theObject ) +{ + // in fact, here we assume that all geometry objects presentable + LightApp_DataObject* anObj = dynamic_cast(theObject); + if (!anObj) + return; + + SalomeApp_Application* app = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + if( !app ) + return; + + SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); + if( !appStudy ) + return; + + _PTR(Study) aStudy = appStudy->studyDS(); + _PTR(SObject) aSObject( aStudy->FindObjectID( anObj->entry().toLatin1().data() ) ); + SMESH::SMESH_IDSource_var anID = SMESH::SMESH_IDSource::_narrow( SMESH::SObjectToObject( aSObject )); + if ( !anID->_is_nil() && anObj->visibilityState() == SUIT_DataObject::Unpresentable ) + anObj->setVisibilityState( SUIT_DataObject::Hidden ); +} diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 8f86faf6d..90e9c3b1c 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -50,6 +50,7 @@ class vtkObject; class QDialog; class SUIT_Desktop; +class SUIT_DataObject; class SUIT_Study; class SUIT_ViewWindow; class SUIT_ResourceMgr; @@ -191,6 +192,8 @@ protected: void* theClientData, void* theCallData ); + virtual void initVisibilityState( SUIT_DataObject* ); + private: void OnEditDelete(); int addVtkFontPref( const QString& label,