]> OCCT Git - occt-copy.git/commitdiff
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)
committerabv <abv@opencascade.com>
Fri, 25 Sep 2015 13:47:56 +0000 (16:47 +0300)
Added conversion of the names of the imported files in the  Utf8 coding

samples/qt/Interface/src/Translate.cxx

index 287c1118f5892216a50d96a043825ebf99bcfec3..587eef08baa5ee989f53329da4affc11b0252fae 100755 (executable)
@@ -418,8 +418,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();
@@ -431,8 +431,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 )
     {
@@ -447,9 +449,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();