Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / VVTK / VVTK_ViewWindow.cxx
index cbd0d46a85a1c705e02917bfbd72d91da74b344c..a7512e886c9ca1872e79e69f084524fc9ef05364 100755 (executable)
@@ -49,7 +49,8 @@ VVTK_ViewWindow
   SVTK_ViewWindow(theDesktop),
   myMainWindow1(NULL),
   myMainWindow2(NULL),
-  myView2(NULL)
+  myView2(NULL),
+  myDumpImage(QImage())
 {}
 
 //----------------------------------------------------------------------------
@@ -226,6 +227,8 @@ VVTK_ViewWindow
            bool theIsHighlight, 
            bool theIsUpdate ) 
 {
+  if(GetSelector()->AddIObject(theIO))
+    GetSelector()->EndPickCallback();
   myView1->highlight( theIO, theIsHighlight, theIsUpdate );
   myView2->highlight( theIO, theIsHighlight, theIsUpdate );
 }
@@ -277,10 +280,20 @@ VVTK_ViewWindow
 ::dumpView()
 {
   if( myMainWindow1->GetInteractor()->hasFocus() )
-    return myMainWindow1->dumpView();
+    {
+      if ( myMainWindow1->getToolBar()->hasMouse() || myDumpImage.isNull() )
+       return myMainWindow1->dumpView();
+      else
+       return myDumpImage;
+    }
   
   if( myMainWindow2->GetInteractor()->hasFocus() )
-    return myMainWindow2->dumpView();
+    {
+      if ( myMainWindow1->getToolBar()->hasMouse() || myDumpImage.isNull() )
+       return myMainWindow2->dumpView();
+      else
+       return myDumpImage;
+    }
 
   return QImage();
 }
@@ -294,3 +307,14 @@ VVTK_ViewWindow
   myMainWindow2->SetBackgroundColor( theColor );
 }
 
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::RefreshDumpImage()
+{ 
+  if( myMainWindow1->GetInteractor()->hasFocus() )
+    myDumpImage = myMainWindow1->dumpView();
+  else if ( myMainWindow2->GetInteractor()->hasFocus() )
+    myDumpImage = myMainWindow2->dumpView();
+}