X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSVTK%2FSVTK_ViewWindow.cxx;h=d13911d460eea075006e46f335365169f52bdb1a;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=03f144750a36e0e5a43e3c7473dbab8fe1239e89;hpb=8d6a98a5c2f66655d1f4738afc7fffd914e59ad4;p=modules%2Fgui.git diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 03f144750..d13911d46 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -23,6 +23,7 @@ #include "SVTK_NonIsometricDlg.h" #include "SVTK_UpdateRateDlg.h" #include "SVTK_CubeAxesDlg.h" +#include "SVTK_PsOptionsDlg.h" #include "SVTK_SetRotationPointDlg.h" #include "SVTK_ViewParameterDlg.h" #include "SVTK_ViewModel.h" @@ -76,6 +77,7 @@ #include "VTKViewer_Utilities.h" #include "VTKViewer_Trihedron.h" +#include "VTKViewer_Actor.h" #include "SVTK_View.h" #include "SVTK_Selector.h" @@ -103,7 +105,11 @@ #include +#ifdef __APPLE__ +#include +#else #include +#endif namespace SVTK { @@ -1083,6 +1089,15 @@ void SVTK_ViewWindow::SetSelectionEnabled( bool theEnable ) dynamic_cast( getAction( PreselectionId ) ); if ( aPreselectionGroup ) aPreselectionGroup->setEnabled( theEnable ); + + // notify actors + vtkActorCollection *actors = getRenderer()->GetActors(); + for (int i = 0; i < actors->GetNumberOfItems(); ++i ) + if (VTKViewer_Actor *actor = dynamic_cast(actors->GetItemAsObject(i))) + { + cout << "actor " << actor << endl; + actor->EnableSelection( theEnable ); + } } /*! @@ -1375,33 +1390,43 @@ bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa if ( format != "PS" && format != "EPS" && format != "PDF" ) return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format ); - SUIT_OverrideCursor wc; + SVTK_PsOptionsDlg* optionsDlg = new SVTK_PsOptionsDlg(this); + if ( optionsDlg->exec() == QDialog::Accepted ) { + SUIT_OverrideCursor wc; - vtkGL2PSExporter *anExporter = vtkGL2PSExporter::New(); - anExporter->SetRenderWindow(getRenderWindow()); + vtkGL2PSExporter *anExporter = vtkGL2PSExporter::New(); + anExporter->SetRenderWindow(getRenderWindow()); - if ( format == "PS" ) { - anExporter->SetFileFormatToPS(); - anExporter->CompressOff(); - } - - if ( format == "EPS" ) { - anExporter->SetFileFormatToEPS(); - anExporter->CompressOff(); - } + // Set options + anExporter->SetLineWidthFactor(optionsDlg->getLineFactor()); + anExporter->SetPointSizeFactor(optionsDlg->getPointFactor()); + anExporter->SetSort((vtkGL2PSExporter::SortScheme)optionsDlg->getSortType()); + anExporter->SetWrite3DPropsAsRasterImage((int)optionsDlg->isRasterize3D()); + anExporter->SetPS3Shading((int)optionsDlg->isPs3Shading()); + + if ( format == "PS" ) { + anExporter->SetFileFormatToPS(); + anExporter->CompressOff(); + } + + if ( format == "EPS" ) { + anExporter->SetFileFormatToEPS(); + anExporter->CompressOff(); + } - if ( format == "PDF" ) { - anExporter->SetFileFormatToPDF(); + if ( format == "PDF" ) { + anExporter->SetFileFormatToPDF(); + } + + QString aFilePrefix(fileName); + QString anExtension(SUIT_Tools::extension(fileName)); + aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length()); + anExporter->SetFilePrefix(aFilePrefix.toLatin1().data()); + anExporter->Write(); + anExporter->Delete(); } - - QString aFilePrefix(fileName); - QString anExtension(SUIT_Tools::extension(fileName)); - aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length()); - anExporter->SetFilePrefix(aFilePrefix.toLatin1().data()); - anExporter->Write(); - anExporter->Delete(); - - return true; + delete optionsDlg; + return true; } /*!