#include <vtkPointPicker.h>
#include <vtkCellPicker.h>
#include <vtkAxisActor2D.h>
+#include <vtkGL2PSExporter.h>
#include "QtxAction.h"
return myDumpImage;
}
+QString SVTK_ViewWindow::filter() const
+{
+ return tr( "SVTK_IMAGE_FILES" );
+}
+
+bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format )
+{
+ if ( format != "PS" && format != "EPS" && format != "PDF" )
+ return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format );
+
+ QApplication::setOverrideCursor( Qt::waitCursor );
+
+ vtkGL2PSExporter *anExporter = vtkGL2PSExporter::New();
+ anExporter->SetRenderWindow(getRenderWindow());
+
+ if ( format == "PS" ) {
+ anExporter->SetFileFormatToPS();
+ anExporter->CompressOff();
+ }
+
+ if ( format == "EPS" ) {
+ anExporter->SetFileFormatToEPS();
+ anExporter->CompressOff();
+ }
+
+ if ( format == "PDF" ) {
+ anExporter->SetFileFormatToPDF();
+ }
+
+ QString aFilePrefix(fileName);
+ QString anExtension(SUIT_Tools::extension(fileName));
+ aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length());
+ anExporter->SetFilePrefix(aFilePrefix.latin1());
+ anExporter->Write();
+ anExporter->Delete();
+
+ QApplication::restoreOverrideCursor();
+ return true;
+}
+
/*!
\refresh QImage, containing all scene rendering in window
*/
virtual
~SVTK_ViewWindow();
+ virtual QImage dumpView();
+
//! To initialize #SVTK_ViewWindow instance
virtual
void
void
doSetVisualParameters( const QString& );
- QImage dumpView();
+ virtual QString filter() const;
+ virtual bool dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format );
+
virtual bool action( const int );
SVTK_View* myView;