]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
fix for bug: VVTK view's scene is not shown before_mergefrom_BR_Dev_For_4_0_17Jan08
authorasl <asl@opencascade.com>
Fri, 18 Jan 2008 07:58:34 +0000 (07:58 +0000)
committerasl <asl@opencascade.com>
Fri, 18 Jan 2008 07:58:34 +0000 (07:58 +0000)
src/VVTK/VVTK_ViewWindow.cxx

index a1fe968d9b39e1f157fb46c418a8c996531c1d38..52d48d4ed968b4044f2833467c7d1ca7cc640508 100755 (executable)
@@ -39,6 +39,8 @@
 #include "SVTK_RenderWindowInteractor.h"
 #include "SVTK_GenericRenderWindowInteractor.h"
 
+#include <vtkRenderWindow.h>
+
 #include <QLayout>
 #include <QList>
 #include <QSplitter>
@@ -58,14 +60,9 @@ VVTK_ViewWindow
 void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
 {
   if(SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr()){
-    QWidget* aWidget = new QWidget(this);
-    setCentralWidget(aWidget);
-    
-    QBoxLayout* aLayout = new QVBoxLayout(aWidget);
-    //aLayout->setAutoAdd(true);
-    QSplitter* aSplitter = new QSplitter(Qt::Vertical,aWidget);
-    //aSplitter->setChildrenCollapsible(true);
-    aLayout->addWidget( aSplitter );
+
+    QSplitter* s = new QSplitter( Qt::Vertical, this );
+    setCentralWidget( s );
 
     VISU_WidgetCtrl* aWidgetCtrl = NULL;
     VISU_InsideCursorSettings* anInsideCursorSettings = NULL;
@@ -73,7 +70,7 @@ void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
     VISU_PickingSettings* aPickingSettings = NULL;
     SVTK_Selector* aSelector = SVTK_Selector::New();
     {
-      myMainWindow1 = new VVTK_MainWindow1(aSplitter,
+      myMainWindow1 = new VVTK_MainWindow1(s,
                                           "VVTK_MainWindow",
                                           aResourceMgr,
                                           this);
@@ -112,9 +109,12 @@ void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
 
       myView1 = new SVTK_View(myMainWindow1);
       SVTK_ViewWindow::Initialize(myView1,theModel);
+
+      anIteractor->getRenderWindow()->Render();
+      myMainWindow1->onResetView();
     }
     {
-      myMainWindow2 = myMainWindow1->CreateMainWindow2(aSplitter,
+      myMainWindow2 = myMainWindow1->CreateMainWindow2(s,
                                                       "VVTK_SegmantationWindow",
                                                       aResourceMgr,
                                                       this);
@@ -147,6 +147,9 @@ void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
       
       myView2 = new SVTK_View(myMainWindow2);
       SVTK_ViewWindow::Initialize(myView2,theModel);
+
+      anIteractor->getRenderWindow()->Render();
+      myMainWindow2->onResetView();
     }
     aSelector->Delete();
 
@@ -154,7 +157,7 @@ void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
     QList<int> aSizes;
     aSizes.append( h );
     aSizes.append( h );
-    aSplitter->setSizes( aSizes );
+    s->setSizes( aSizes );
     myMainWindow2->hide();
 
     myMainWindow = myMainWindow1;