]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0020830: EDF 1357 GUI : Hide/Show Icon
authorptv <ptv@opencascade.com>
Wed, 17 Nov 2010 08:47:59 +0000 (08:47 +0000)
committerptv <ptv@opencascade.com>
Wed, 17 Nov 2010 08:47:59 +0000 (08:47 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h

index aac1477f345dada66f20148e7a4dd6a7efb2127f..30321350db371005372362d44e2a13bbf9309b8b 100644 (file)
@@ -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<LightApp_DataObject*>(theObject);
+  if (!anObj)
+    return;
+
+  SalomeApp_Application* app =
+    dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+  if( !app )
+    return;
+
+  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( 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 );
+}
index 8f86faf6d20d65c48d7f4e4729e36b51bfc6df8b..90e9c3b1c22b0e62d0a547f60b569296345d13e2 100644 (file)
@@ -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,