0026723: Qt IE sample can not import STEP and IGES files with names containing not...
authorgka <gka@opencascade.com>
Fri, 25 Sep 2015 13:30:29 +0000 (16:30 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 1 Oct 2015 10:15:29 +0000 (13:15 +0300)
Added conversion of the names of the imported files in the  Utf8 coding

samples/qt/Interface/src/Translate.cxx

index a272c03..38302df 100755 (executable)
@@ -393,8 +393,8 @@ Handle(TopTools_HSequenceOfShape) Translate::importBREP( const QString& file )
        Handle(TopTools_HSequenceOfShape) aSequence;
     TopoDS_Shape aShape;
        BRep_Builder aBuilder;
-
-       Standard_Boolean result = BRepTools::Read( aShape, (Standard_CString)file.toLatin1().constData(), aBuilder );
+  TCollection_AsciiString  aFilePath = file.toUtf8().data();
+       Standard_Boolean result = BRepTools::Read( aShape, aFilePath.ToCString(), aBuilder );
        if ( result )
     {
            aSequence = new TopTools_HSequenceOfShape();
@@ -406,8 +406,10 @@ Handle(TopTools_HSequenceOfShape) Translate::importBREP( const QString& file )
 Handle(TopTools_HSequenceOfShape) Translate::importIGES( const QString& file )
 {
     Handle(TopTools_HSequenceOfShape) aSequence;
+    TCollection_AsciiString  aFilePath = file.toUtf8().data();
+      
     IGESControl_Reader Reader;
-    int status = Reader.ReadFile( (Standard_CString)file.toLatin1().constData() );
+    int status = Reader.ReadFile(aFilePath.ToCString() );
 
     if ( status == IFSelect_RetDone )
     {
@@ -422,9 +424,9 @@ Handle(TopTools_HSequenceOfShape) Translate::importIGES( const QString& file )
 Handle(TopTools_HSequenceOfShape) Translate::importSTEP( const QString& file )
 {
        Handle(TopTools_HSequenceOfShape) aSequence;
-
+  TCollection_AsciiString  aFilePath = file.toUtf8().data();
        STEPControl_Reader aReader;
-       IFSelect_ReturnStatus status = aReader.ReadFile( (Standard_CString)file.toLatin1().constData() );
+       IFSelect_ReturnStatus status = aReader.ReadFile( aFilePath.ToCString() );
        if ( status == IFSelect_RetDone )
     {
            //Interface_TraceFile::SetDefault();