Salome HOME
Unicode support: correct handling of unicode on GUI level
[modules/gui.git] / src / SVTK / SVTK_ViewWindow.cxx
index b9df65cdf8a08c76e18182ac713ad206078123be..3a63b154fb6b911ba5061346828a6bb8f95dab44 100755 (executable)
@@ -77,6 +77,7 @@
 
 #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
 {
@@ -673,7 +678,7 @@ void SVTK_ViewWindow::setBackground( const Qtx::BackgroundData& bgData )
          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;
@@ -1084,6 +1089,15 @@ void SVTK_ViewWindow::SetSelectionEnabled( bool theEnable )
     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 );
+    }
 }
 
 /*!
@@ -1407,7 +1421,7 @@ bool SVTK_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileNa
     QString aFilePrefix(fileName);
     QString anExtension(SUIT_Tools::extension(fileName));
     aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length());
-    anExporter->SetFilePrefix(aFilePrefix.toLatin1().data());
+    anExporter->SetFilePrefix(aFilePrefix.toUtf8().data());
     anExporter->Write();
     anExporter->Delete();
   }
@@ -1634,7 +1648,7 @@ void setGradAxisVisualParams(QXmlStreamReader& reader, vtkAxisActor2D* actor)
   //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 );
@@ -1719,7 +1733,7 @@ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params )
     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 );