]> SALOME platform Git repositories - modules/gui.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:33:02 +0000 (15:33 +0000)
committermzn <mzn@opencascade.com>
Wed, 16 Aug 2006 15:33:02 +0000 (15:33 +0000)
src/Plot2d/Plot2d_ViewModel.cxx
src/Plot2d/Plot2d_ViewWindow.cxx
src/Plot2d/Plot2d_ViewWindow.h
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h

index 3d268e1c4303912f0bdd1f1ec097304fa26ddff2..e689f6ef5870081c84097aced17c3923972b5185 100755 (executable)
@@ -76,6 +76,7 @@ void Plot2d_Viewer::contextMenuPopup(QPopupMenu* thePopup)
       if (thePopup->count() > 0) thePopup->insertSeparator();
         thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
     }
+    aView->RefreshDumpImage();
   }
 }
 
index e562e30dc182786ffe2b86232434dfd965a91515..1fdf78431df0be57fd216580e09897533ce5debf 100755 (executable)
@@ -33,7 +33,6 @@
 #include <qlayout.h>
 #include <qapplication.h>
 #include <qpopupmenu.h>
-#include <qimage.h>
 
 /*!
   Constructor
@@ -43,6 +42,8 @@ Plot2d_ViewWindow::Plot2d_ViewWindow(SUIT_Desktop* theDesktop, Plot2d_Viewer* th
 {
   myModel = theModel;
 
+  myDumpImage = QImage();
+
   myViewFrame = new Plot2d_ViewFrame(this, "plotView");
   setCentralWidget(myViewFrame);
 
@@ -491,8 +492,13 @@ void Plot2d_ViewWindow::onDumpView()
 */
 QImage Plot2d_ViewWindow::dumpView()
 {
-  QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
-  return px.convertToImage();
+  if ( getToolBar()->hasMouse() || myDumpImage.isNull() )
+    {
+      QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+      return px.convertToImage();
+    }
+  
+  return myDumpImage;
 }
 
 /*!
@@ -532,3 +538,12 @@ void Plot2d_ViewWindow::setVisualParameters( const QString& parameters )
 {
   myViewFrame->setVisualParameters( parameters );
 }
+
+/*!
+  \refresh QImage, containing all scene rendering in window
+*/
+void Plot2d_ViewWindow::RefreshDumpImage()
+{
+  QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+  myDumpImage = px.convertToImage();
+}
index b8c3718d3d37ac8ad82b47a1d01cca4d080a7aaf..aa1d4dd6227c77d6de0f4fb51b634e36a0f5ee2b 100755 (executable)
@@ -22,6 +22,8 @@
 #include "Plot2d.h"
 #include <SUIT_ViewWindow.h>
 
+#include <qimage.h>
+
 #ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
@@ -48,6 +50,8 @@ public:
 
   virtual QString   getVisualParameters();
   virtual void      setVisualParameters( const QString& parameters );
+  
+  virtual void      RefreshDumpImage();
 
 protected:
   virtual QImage    dumpView();
@@ -94,6 +98,8 @@ private:
   QToolBar*         myToolBar;
 
   SUIT_ToolButton*  myCurveBtn;
+
+  QImage myDumpImage;
 };
 
 #ifdef WIN32
index 61cde9d5bfc80bad611320c7689f643201eeb71e..4a1722242d896668339a078bb4c0898bf29955bf 100644 (file)
@@ -197,6 +197,7 @@ SVTK_Viewer
     if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
       thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
     }
+    aView->RefreshDumpImage();
   }
 }
 
index 3fee43d8e104b13f9659982791524520c7e65834..529db8ce1cac38966c2c20f12bac55fd261a24e1 100755 (executable)
@@ -68,7 +68,8 @@ SVTK_ViewWindow
 ::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
   SUIT_ViewWindow(theDesktop),
   myMainWindow(NULL),
-  myView(NULL)
+  myView(NULL),
+  myDumpImage(QImage())
 {}
 
 /*!
@@ -684,8 +685,19 @@ SVTK_ViewWindow
 QImage
 SVTK_ViewWindow
 ::dumpView()
+{    
+  if ( myMainWindow->getToolBar()->hasMouse() || myDumpImage.isNull() )
+    return myMainWindow->dumpView();
+  
+  return myDumpImage;
+}
+
+/*!
+  \refresh QImage, containing all scene rendering in window
+*/
+void SVTK_ViewWindow::RefreshDumpImage()
 {
-  return myMainWindow->dumpView();
+  myDumpImage = myMainWindow->dumpView();
 }
 
 /*!
index 7a592578b531c2f06c2ef223213537d2a812fb3e..cc56484de15473c8e7ce8fd3d008b0422ffaa22d 100755 (executable)
@@ -28,6 +28,8 @@
 #include "SUIT_ViewWindow.h"
 #include "SALOME_InteractiveObject.hxx"
 
+#include <qimage.h>
+
 class SUIT_Desktop;
 
 class VTKViewer_Actor;
@@ -255,6 +257,9 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   virtual
   bool
   eventFilter( QObject*, QEvent* );
+
+  virtual
+  void RefreshDumpImage();
   
 public slots:
   virtual
@@ -344,12 +349,15 @@ protected:
 
   QImage dumpView();
   virtual bool action( const int );
-
+  
   SVTK_View* myView;
   SVTK_MainWindow* myMainWindow;
   SVTK_ViewModelBase* myModel;
 
   QString myVisualParams; // used for delayed setting of view parameters 
+
+private:
+  QImage myDumpImage;
 };
 
 #ifdef WIN32