From: vsr Date: Fri, 29 Sep 2017 10:36:08 +0000 (+0300) Subject: 0023485: EDF 15568 - Problem with dump view (format ps / eps) X-Git-Tag: V8_4_0b1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=17f1832c5e14a49f8e5ca4de697682b76e238b5f;p=modules%2Fgui.git 0023485: EDF 15568 - Problem with dump view (format ps / eps) --- diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 264cc3337..367c85151 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -2248,15 +2248,28 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, { bool res = false; QApplication::setOverrideCursor( Qt::WaitCursor ); - if ( format != "PS" && format != "EPS") - res = myViewPort->getView()->Dump( fileName.toStdString().c_str() ); Handle(Graphic3d_CView) a3dView = myViewPort->getView()->View(); - if (format == "PS") + if (format == "PS") { + Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver()); + OpenGl_Caps* aCaps = &aDriver->ChangeOptions(); + int prev = aCaps->ffpEnable; + aCaps->ffpEnable = 1; res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript); - else if (format == "EPS") + aCaps->ffpEnable = prev; + } + else if (format == "EPS") { + Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(myViewPort->getViewer()->Driver()); + OpenGl_Caps* aCaps = &aDriver->ChangeOptions(); + int prev = aCaps->ffpEnable; + aCaps->ffpEnable = 1; res = a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript); + aCaps->ffpEnable = prev; + } + else { + res = myViewPort->getView()->Dump( fileName.toStdString().c_str() ); + } QApplication::restoreOverrideCursor(); return res;