From 6fdfaaef48e1e0ba466c28c7bee20be36f6c7c42 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 17 Aug 2005 09:59:01 +0000 Subject: [PATCH] dumpView() moved from SVTK_View --- src/SVTK/SVTK_RenderWindow.cxx | 9 +++++++++ src/SVTK/SVTK_RenderWindow.h | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/src/SVTK/SVTK_RenderWindow.cxx b/src/SVTK/SVTK_RenderWindow.cxx index 9b0666dce..eccc4c75c 100644 --- a/src/SVTK/SVTK_RenderWindow.cxx +++ b/src/SVTK/SVTK_RenderWindow.cxx @@ -650,3 +650,12 @@ SVTK_RenderWindow { AdjustTrihedrons(false); } + +//---------------------------------------------------------------------------- +QImage +SVTK_RenderWindow +::dumpView() +{ + QPixmap px = QPixmap::grabWindow( winId() ); + return px.convertToImage(); +} diff --git a/src/SVTK/SVTK_RenderWindow.h b/src/SVTK/SVTK_RenderWindow.h index fcfea3edf..b974ccc22 100644 --- a/src/SVTK/SVTK_RenderWindow.h +++ b/src/SVTK/SVTK_RenderWindow.h @@ -30,6 +30,7 @@ #define SVTK_RenderWindow_h #include +#include #include "SVTK.h" @@ -100,6 +101,11 @@ class SVTK_EXPORT SVTK_RenderWindow : public QMainWindow void onAdjustTrihedron(); void onAdjustCubeAxes(); + void onDumpView(); + + public: + QImage dumpView(); + protected: enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, ViewTrihedronId }; @@ -108,6 +114,7 @@ class SVTK_EXPORT SVTK_RenderWindow : public QMainWindow void createActions(); void createToolBar(); + protected: vtkRenderer* myRenderer; vtkRenderWindow* myRenderWindow; -- 2.39.2