#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"
#include "VTKViewer_Utilities.h"
#include "VTKViewer_Trihedron.h"
+#include "VTKViewer_Actor.h"
#include "SVTK_View.h"
#include "SVTK_Selector.h"
#include <OpenGLUtils_FrameBuffer.h>
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#else
#include <GL/gl.h>
+#endif
namespace SVTK
{
aReader = vtkMetaImageReader::New();
if ( aReader ) {
// create texture
- aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+ aReader->SetFileName( fi.absoluteFilePath().toUtf8().constData() );
aReader->Update();
VTKViewer_Texture* aTexture = VTKViewer_Texture::New();
vtkImageMapToColors* aMap = 0;
dynamic_cast<QtxActionGroup*>( 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<VTKViewer_Actor*>(actors->GetItemAsObject(i)))
+ {
+ cout << "actor " << actor << endl;
+ actor->EnableSelection( theEnable );
+ }
}
/*!
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.toUtf8().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;
}
/*!
//printf("#### Color: %f, %f, %f\n", color[0], color[1], color[2]);
actor->SetTitleVisibility( isVisible );
- actor->SetTitle( title.toLatin1() );
+ actor->SetTitle( title.toUtf8() );
vtkTextProperty* txtProp = actor->GetTitleTextProperty();
if ( txtProp ) {
txtProp->SetColor( color );
int shadow = paramsLst[10].toInt();
actor->SetTitleVisibility( isVisible );
- actor->SetTitle( title.toLatin1() );
+ actor->SetTitle( title.toUtf8() );
vtkTextProperty* txtProp = actor->GetTitleTextProperty();
if ( txtProp ) {
txtProp->SetColor( color );