mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0026723: Qt IE sample can not import STEP and IGES files with names containing not ascii symbols
Added conversion of the names of the imported files in the Utf8 coding
This commit is contained in:
parent
fbd689a48e
commit
90c8c7f32b
@ -393,8 +393,8 @@ Handle(TopTools_HSequenceOfShape) Translate::importBREP( const QString& file )
|
|||||||
Handle(TopTools_HSequenceOfShape) aSequence;
|
Handle(TopTools_HSequenceOfShape) aSequence;
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
BRep_Builder aBuilder;
|
BRep_Builder aBuilder;
|
||||||
|
TCollection_AsciiString aFilePath = file.toUtf8().data();
|
||||||
Standard_Boolean result = BRepTools::Read( aShape, (Standard_CString)file.toLatin1().constData(), aBuilder );
|
Standard_Boolean result = BRepTools::Read( aShape, aFilePath.ToCString(), aBuilder );
|
||||||
if ( result )
|
if ( result )
|
||||||
{
|
{
|
||||||
aSequence = new TopTools_HSequenceOfShape();
|
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) Translate::importIGES( const QString& file )
|
||||||
{
|
{
|
||||||
Handle(TopTools_HSequenceOfShape) aSequence;
|
Handle(TopTools_HSequenceOfShape) aSequence;
|
||||||
|
TCollection_AsciiString aFilePath = file.toUtf8().data();
|
||||||
|
|
||||||
IGESControl_Reader Reader;
|
IGESControl_Reader Reader;
|
||||||
int status = Reader.ReadFile( (Standard_CString)file.toLatin1().constData() );
|
int status = Reader.ReadFile(aFilePath.ToCString() );
|
||||||
|
|
||||||
if ( status == IFSelect_RetDone )
|
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) Translate::importSTEP( const QString& file )
|
||||||
{
|
{
|
||||||
Handle(TopTools_HSequenceOfShape) aSequence;
|
Handle(TopTools_HSequenceOfShape) aSequence;
|
||||||
|
TCollection_AsciiString aFilePath = file.toUtf8().data();
|
||||||
STEPControl_Reader aReader;
|
STEPControl_Reader aReader;
|
||||||
IFSelect_ReturnStatus status = aReader.ReadFile( (Standard_CString)file.toLatin1().constData() );
|
IFSelect_ReturnStatus status = aReader.ReadFile( aFilePath.ToCString() );
|
||||||
if ( status == IFSelect_RetDone )
|
if ( status == IFSelect_RetDone )
|
||||||
{
|
{
|
||||||
//Interface_TraceFile::SetDefault();
|
//Interface_TraceFile::SetDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user