Salome HOME
size of image is limited by 7000 pixels
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ViewerDlg.cxx
index 3c51c10097e55f8b6aa3137cd94d3d4164f3a94a..f82ae06ef5f00b4471e6992379e494a218bdc9f5 100644 (file)
@@ -1,8 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 #include <QLineEdit>
 #include <QMouseEvent>
 
-HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool isSplitter )
+: HYDROGUI_InputPanel( theModule, theTitle, true, isSplitter )
 {
-  QWidget* viewMain = new QWidget( mainFrame() );
-  QVBoxLayout* viewBase = new QVBoxLayout( viewMain );
-  viewBase->setMargin( 0 );
-
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  myViewManager = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
+  SUIT_Study* aStudy = theModule ? theModule->getApp()->activeStudy() : 0;
+
+  myViewManager = new OCCViewer_ViewManager( aStudy, 0 );
   OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true );
 
   aViewer->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
@@ -76,7 +70,7 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin
 
   myViewManager->setViewModel( aViewer );// custom view model, which extends SALOME_View interface
 
-  aViewer->enableMultiselection( false );
+  //aViewer->enableMultiselection( false );
 
   SUIT_ViewWindow* aViewWin = myViewManager->createViewWindow();
   aViewer->setStaticTrihedronDisplayed( false );
@@ -90,7 +84,7 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin
     anAISContext->Deactivate( aTrihedron );
   }
   */
-  viewBase->addWidget( aViewWin );
+  addWidget( aViewWin, 1 );
 
   // Coordinates
   connect( myViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
@@ -103,8 +97,8 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin
       aViewFrame->getViewPort()->installEventFilter( this );
   }
 
-  myCoordLabel = new QLabel( viewMain );
-  viewBase->addWidget( myCoordLabel );
+  myCoordLabel = new QLabel( mainFrame() );
+  addWidget( myCoordLabel, 0 );
 }
 
 HYDROGUI_ViewerDlg::~HYDROGUI_ViewerDlg()
@@ -117,7 +111,7 @@ bool HYDROGUI_ViewerDlg::event( QEvent* e )
 {
     if ( e->type() == QEvent::Polish )
     {
-        addWidget( myCoordLabel->parentWidget(), 4 );
+        //addWidget( myCoordLabel->parentWidget(), 4 );
 
         Handle(AIS_Trihedron) aTrihedron = trihedron();
         Handle(AIS_InteractiveContext) anAISContext = getAISContext();