if (thePopup->count() > 0) thePopup->insertSeparator();
thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
}
+ aView->RefreshDumpImage();
}
}
#include <qlayout.h>
#include <qapplication.h>
#include <qpopupmenu.h>
-#include <qimage.h>
/*!
Constructor
{
myModel = theModel;
+ myDumpImage = QImage();
+
myViewFrame = new Plot2d_ViewFrame(this, "plotView");
setCentralWidget(myViewFrame);
*/
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;
}
/*!
{
myViewFrame->setVisualParameters( parameters );
}
+
+/*!
+ \refresh QImage, containing all scene rendering in window
+*/
+void Plot2d_ViewWindow::RefreshDumpImage()
+{
+ QPixmap px = QPixmap::grabWindow( myViewFrame->winId() );
+ myDumpImage = px.convertToImage();
+}
#include "Plot2d.h"
#include <SUIT_ViewWindow.h>
+#include <qimage.h>
+
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
virtual QString getVisualParameters();
virtual void setVisualParameters( const QString& parameters );
+
+ virtual void RefreshDumpImage();
protected:
virtual QImage dumpView();
QToolBar* myToolBar;
SUIT_ToolButton* myCurveBtn;
+
+ QImage myDumpImage;
};
#ifdef WIN32
if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
}
+ aView->RefreshDumpImage();
}
}
::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
SUIT_ViewWindow(theDesktop),
myMainWindow(NULL),
- myView(NULL)
+ myView(NULL),
+ myDumpImage(QImage())
{}
/*!
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();
}
/*!
#include "SUIT_ViewWindow.h"
#include "SALOME_InteractiveObject.hxx"
+#include <qimage.h>
+
class SUIT_Desktop;
class VTKViewer_Actor;
virtual
bool
eventFilter( QObject*, QEvent* );
+
+ virtual
+ void RefreshDumpImage();
public slots:
virtual
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