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

index fd8d1557d9d4cbb5764bfd9d6c239c0eb3f3f0b8..6fe7725ded63991d6a0c5670d36398675720c0a3 100644 (file)
@@ -99,6 +99,7 @@
 #include "VISU_View_i.hh"
 #include "VISU_ViewManager_i.hh"
 #include "VISU_Plot3D_i.hh"
+#include "VISU_PrsObject_i.hh"
 
 #include "VISU_Actor.h"
 
@@ -4803,3 +4804,32 @@ void VisuGUI::OnArcQuadMode(){
 void VisuGUI::OnLineQuadMode(){
   ChangeQuadratic2DRepresentation(this,VISU::LINES);
 }
+
+/*!
+ * \brief Virtual public slot
+ *
+ * This method updates visibility state
+ * Redefined to make visible geometry objects
+ */
+void VisuGUI::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() ) );
+  VISU::PrsObject_var aPrs = VISU::PrsObject::_narrow( ClientSObjectToObject(aSObject) );
+  if ( !aPrs->_is_nil() && anObj->visibilityState() == SUIT_DataObject::Unpresentable )
+    anObj->setVisibilityState( SUIT_DataObject::Hidden );
+}
index 0dd29a45e9991604981853178ee9c37dd43eb0b8..2831b01122850b180eca7c60cc3cfbebfc8ecf17 100644 (file)
@@ -215,6 +215,8 @@ protected:
 
   void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
 
+  virtual void                initVisibilityState( SUIT_DataObject* );
+
 private:
   void createActions();
   void createMenus();