//----------------------------------------------------------------------------
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" ),
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
SVTK_ViewWindow(theDesktop),
myMainWindow1(NULL),
myMainWindow2(NULL),
- myView2(NULL)
+ myView2(NULL),
+ myDumpImage(QImage())
{}
//----------------------------------------------------------------------------
::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();
}
myMainWindow2->SetBackgroundColor( theColor );
}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::RefreshDumpImage()
+{
+ if( myMainWindow1->GetInteractor()->hasFocus() )
+ myDumpImage = myMainWindow1->dumpView();
+ else if ( myMainWindow2->GetInteractor()->hasFocus() )
+ myDumpImage = myMainWindow2->dumpView();
+}
#include "VVTK.h"
#include "SVTK_ViewWindow.h"
+#include <qimage.h>
+
#include <string>
class VVTK_MainWindow1;
setBackgroundColor( const QColor& );
//----------------------------------------------------------------------------
+
+ //! Refresh dump images of the viewers
+ virtual
+ void RefreshDumpImage();
+
public slots:
//! Redefine SVTK_ViewWindow::onSelectionChanged method
virtual
VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
SVTK_View* myView2; //!< The manage segmented view
+
+private:
+ QImage myDumpImage;
};
#ifdef WIN32