]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug PAL12468(When dumping a VTK view, the dialog box appears in the saved... For_OCT_611
authormzn <mzn@opencascade.com>
Wed, 16 Aug 2006 15:43:17 +0000 (15:43 +0000)
committermzn <mzn@opencascade.com>
Wed, 16 Aug 2006 15:43:17 +0000 (15:43 +0000)
src/VVTK/VVTK_MainWindow.cxx
src/VVTK/VVTK_ViewWindow.cxx
src/VVTK/VVTK_ViewWindow.h

index 01a0b2b4ec91614d0ae484109df4386cd03c8257..4aa149fd33f653793cfd0bd3f3b1079cf6d9190c 100644 (file)
@@ -154,6 +154,10 @@ VVTK_MainWindow::~VVTK_MainWindow()
 //----------------------------------------------------------------------------
 void VVTK_MainWindow::onDumpView()
 {
+  QImage img = dumpView();
+  if( img.isNull() )
+    return; 
+
   SUIT_Application* app = SUIT_Session::session()->activeApplication();
   QString fileName = app->getFileName( false, QString::null,
                                       tr( "TLT_IMAGE_FILES" ),
@@ -161,10 +165,6 @@ void VVTK_MainWindow::onDumpView()
   if( fileName.isEmpty() )
     return;
 
-  QImage img = dumpView();
-  if( img.isNull() )
-    return; 
-
   QString fmt = SUIT_Tools::extension( fileName ).upper();
   if( fmt.isEmpty() )
     fmt = QString( "BMP" ); // default format
index cbd0d46a85a1c705e02917bfbd72d91da74b344c..b0d70802dba05899c2066d7fb39b3024644007f4 100755 (executable)
@@ -49,7 +49,8 @@ VVTK_ViewWindow
   SVTK_ViewWindow(theDesktop),
   myMainWindow1(NULL),
   myMainWindow2(NULL),
-  myView2(NULL)
+  myView2(NULL),
+  myDumpImage(QImage())
 {}
 
 //----------------------------------------------------------------------------
@@ -277,10 +278,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 +305,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();
+}
index ca0ab04c8630650bd967e74cb56c9b06e210f791..7e2dbf05960d6ad0964f6bb5d1ccbbaa9224c22d 100755 (executable)
@@ -27,6 +27,8 @@
 #include "VVTK.h"
 #include "SVTK_ViewWindow.h"
 
+#include <qimage.h>
+
 #include <string>
 
 class VVTK_MainWindow1;
@@ -105,6 +107,11 @@ public:
   setBackgroundColor( const QColor& );
 
   //----------------------------------------------------------------------------
+
+  //! Refresh dump images of the viewers
+  virtual
+  void RefreshDumpImage();
+  
 public slots:
   //! Redefine SVTK_ViewWindow::onSelectionChanged method
   virtual
@@ -134,6 +141,9 @@ protected:
 
   VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
   SVTK_View* myView2; //!< The manage segmented view
+
+private:
+  QImage myDumpImage;
 };
 
 #ifdef WIN32