Salome HOME
Profile object creation.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Tool.cxx
index 5e026dd4b61866821e7c5633b616bdf4789092c4..0f2b7c2c8d93f3c07917c6cb8121ca3ee5cf4730 100644 (file)
 #include <LightApp_SelectionMgr.h>
 
 #include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewFrame.h>
 
 #include <QtxWorkstack.h>
+#include <QtxActionToolMgr.h>
 
 #include <STD_TabDesktop.h>
 
@@ -214,9 +216,10 @@ void HYDROGUI_Tool::GetPrsSubObjects( HYDROGUI_Module* theModule,
       Handle(HYDROData_Entity) anObject = anIterator.Current();
       if( !anObject.IsNull() && ( 
         ( anObject->GetKind() == KIND_IMAGE ) ||
-        ( anObject->GetKind() == KIND_POLYLINE ) ||
+        ( anObject->GetKind() == KIND_POLYLINEXY ) ||
         ( anObject->GetKind() == KIND_IMMERSIBLE_ZONE ) ||
         ( anObject->GetKind() == KIND_REGION ) ||
+        ( anObject->GetKind() == KIND_BATHYMETRY ) ||
         ( anObject->GetKind() == KIND_ZONE ) ||
         ( anObject->GetKind() == KIND_OBSTACLE ) ) )
       {
@@ -460,6 +463,41 @@ QList<size_t> HYDROGUI_Tool::GetOCCViewIdList( HYDROGUI_Module* theModule )
   return getViewIdList( theModule, OCCViewer_Viewer::Type() );
 }
 
+void HYDROGUI_Tool::setOCCActionShown( OCCViewer_ViewFrame* theViewFrame,
+                                       const int theActionId,
+                                       const bool isShown )
+{
+  if ( !theViewFrame )
+    return;
+
+  OCCViewer_ViewWindow* aView = theViewFrame->getView( OCCViewer_ViewFrame::MAIN_VIEW );
+  if ( aView ) {
+    aView->toolMgr()->setShown( theActionId, isShown );
+    if ( theActionId == OCCViewer_ViewWindow::MaximizedId )
+      theViewFrame->onMaximizedView( aView, true );
+  }
+}
+
+void HYDROGUI_Tool::setOCCActionShown( HYDROGUI_Module* theModule,
+                                       const int theActionId,
+                                       const bool isShown )
+{
+  QList<size_t> aList;
+  ViewManagerList aViewMgrs;
+  theModule->getApp()->viewManagers( OCCViewer_Viewer::Type(), aViewMgrs );
+  QListIterator<SUIT_ViewManager*> anIter( aViewMgrs );
+  while( anIter.hasNext() )
+  {
+    if( SUIT_ViewManager* aViewMgr = anIter.next() )
+    {
+      OCCViewer_ViewFrame* aViewFrame = dynamic_cast<OCCViewer_ViewFrame*>
+                                                           ( aViewMgr->getActiveView() );
+      if ( aViewFrame )
+        setOCCActionShown( aViewFrame, theActionId, isShown );
+    }
+  }
+}
+
 void HYDROGUI_Tool::GetObjectReferences( const Handle(HYDROData_Image)& theImage,
                                          HYDROData_SequenceOfObjects& theRefObjects,
                                          QStringList& theRefNames )