mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
0033032: Samples - Warning on Ubuntu 20.04
Fix warnings: * catching polymorphic type 'class Standard_Failure' by value [-Wcatch-value=] * this 'if' clause does not guard... [-Wmisleading-indentation]
This commit is contained in:
parent
3e06b70623
commit
aaacd83510
@ -221,7 +221,7 @@ Handle(TopTools_HSequenceOfShape) Translate::importModel( const int format, cons
|
|||||||
shapes = importSTEP( file );
|
shapes = importSTEP( file );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch ( Standard_Failure ) {
|
} catch ( const Standard_Failure& ) {
|
||||||
shapes.Nullify();
|
shapes.Nullify();
|
||||||
}
|
}
|
||||||
return shapes;
|
return shapes;
|
||||||
@ -256,7 +256,7 @@ bool Translate::exportModel( const int format, const QString& file, const Handle
|
|||||||
case FormatSTL: return exportSTL ( file, shapes );
|
case FormatSTL: return exportSTL ( file, shapes );
|
||||||
case FormatVRML: return exportVRML( file, shapes );
|
case FormatVRML: return exportVRML( file, shapes );
|
||||||
}
|
}
|
||||||
} catch ( Standard_Failure ) {
|
} catch ( const Standard_Failure& ) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -528,26 +528,26 @@ bool Translate::exportSTL( const QString& file, const Handle(TopTools_HSequenceO
|
|||||||
if ( shapes.IsNull() || shapes->IsEmpty() )
|
if ( shapes.IsNull() || shapes->IsEmpty() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TopoDS_Compound res;
|
TopoDS_Compound res;
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
builder.MakeCompound( res );
|
builder.MakeCompound( res );
|
||||||
|
|
||||||
for ( int i = 1; i <= shapes->Length(); i++ )
|
for ( int i = 1; i <= shapes->Length(); i++ )
|
||||||
{
|
{
|
||||||
TopoDS_Shape shape = shapes->Value( i );
|
TopoDS_Shape shape = shapes->Value( i );
|
||||||
if ( shape.IsNull() )
|
if ( shape.IsNull() )
|
||||||
{
|
{
|
||||||
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
|
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
builder.Add( res, shape );
|
builder.Add( res, shape );
|
||||||
}
|
}
|
||||||
|
|
||||||
StlAPI_Writer writer;
|
StlAPI_Writer writer;
|
||||||
|
|
||||||
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
|
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
|
||||||
|
|
||||||
writer.Write( res, anUtf8Path.ToCString() );
|
writer.Write( res, anUtf8Path.ToCString() );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -557,26 +557,26 @@ bool Translate::exportVRML( const QString& file, const Handle(TopTools_HSequence
|
|||||||
if ( shapes.IsNull() || shapes->IsEmpty() )
|
if ( shapes.IsNull() || shapes->IsEmpty() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TopoDS_Compound res;
|
TopoDS_Compound res;
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
builder.MakeCompound( res );
|
builder.MakeCompound( res );
|
||||||
|
|
||||||
for ( int i = 1; i <= shapes->Length(); i++ )
|
for ( int i = 1; i <= shapes->Length(); i++ )
|
||||||
{
|
{
|
||||||
TopoDS_Shape shape = shapes->Value( i );
|
TopoDS_Shape shape = shapes->Value( i );
|
||||||
if ( shape.IsNull() )
|
if ( shape.IsNull() )
|
||||||
{
|
{
|
||||||
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
|
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
builder.Add( res, shape );
|
builder.Add( res, shape );
|
||||||
}
|
}
|
||||||
|
|
||||||
VrmlAPI_Writer writer;
|
VrmlAPI_Writer writer;
|
||||||
|
|
||||||
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
|
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
|
||||||
|
|
||||||
writer.Write( res, anUtf8Path.ToCString() );
|
writer.Write( res, anUtf8Path.ToCString() );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user