Salome HOME
lot 10 - warnings for DTM - untested
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ViewerDlg.cxx
index 4465443d7e021a3eccc50add81e3ec92ac94b575..a2b58bc1f4bdbb6428f2bd5d02902fc837ea8e61 100644 (file)
 #include <QLineEdit>
 #include <QMouseEvent>
 
-HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool isSplitter )
+HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool isSplitter, bool dispTrihedron )
 : HYDROGUI_InputPanel( theModule, theTitle, true, isSplitter )
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  myViewManager = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
-  OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true );
+#ifndef TEST_MODE
+  SUIT_Study* aStudy = theModule ? theModule->application()->activeStudy() : 0;
+#else
+  SUIT_Study* aStudy = 0;
+#endif
+  myViewManager = new OCCViewer_ViewManager( aStudy, 0 );
+  bool IsChainedPan = aResMgr->booleanValue( "HYDRO", "chained_panning" );
+  myViewManager->setChainedOperations(IsChainedPan);
+  OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( dispTrihedron );
 
   aViewer->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
                           aResMgr->backgroundValue( "OCCViewer", "xz_background", aViewer->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
@@ -116,7 +123,7 @@ bool HYDROGUI_ViewerDlg::event( QEvent* e )
         if ( !anAISContext.IsNull() && !aTrihedron.IsNull() )
         {
             viewer()->setTrihedronShown( false );
-            anAISContext->Display( aTrihedron );
+            anAISContext->Display( aTrihedron, true );
             anAISContext->Deactivate( aTrihedron );
         }
     }
@@ -142,6 +149,10 @@ OCCViewer_ViewManager* HYDROGUI_ViewerDlg::viewManager() const
 
 SUIT_SelectionMgr* HYDROGUI_ViewerDlg::selectionMgr() const
 {
+#ifdef TEST_MODE
+  static SUIT_SelectionMgr* mgr = new SUIT_SelectionMgr();
+  return mgr;
+#else
     SUIT_SelectionMgr* aSelMgr = 0;
     if ( module() )
     {
@@ -150,6 +161,7 @@ SUIT_SelectionMgr* HYDROGUI_ViewerDlg::selectionMgr() const
             aSelMgr = app->selectionMgr();
     }
     return aSelMgr;
+#endif
 }
 
 void HYDROGUI_ViewerDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEvent* theEvent )