1) Treat GMF import/export

2) Fix RemoveArgs() not to clear the whole command if it is like "(res1,res2) = meth(arg)"
This commit is contained in:
eap 2013-02-28 14:28:04 +00:00
parent 1dbda4f113
commit b5d9b2799b

View File

@ -773,6 +773,14 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue(ind+1)); Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue(ind+1));
myMeshes.insert( make_pair( mesh->GetID(), mesh )); myMeshes.insert( make_pair( mesh->GetID(), mesh ));
} }
if ( method == "CreateMeshesFromGMF" )
{
// CreateMeshesFromGMF( theFileName, theMakeRequiredGroups ) ->
// CreateMeshesFromGMF( theFileName )
_AString file = theCommand->GetArg(1);
theCommand->RemoveArgs();
theCommand->SetArg( 1, file );
}
} }
// CreateHypothesis() // CreateHypothesis()
@ -1571,7 +1579,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
method == "ExportToMEDX" ) { // ExportToMEDX() --> ExportMED() method == "ExportToMEDX" ) { // ExportToMEDX() --> ExportMED()
theCommand->SetMethod( "ExportMED" ); theCommand->SetMethod( "ExportMED" );
} }
else if ( method == "ExportCGNS" || method == "ExportGMF" ) else if ( method == "ExportCGNS" )
{ // ExportCGNS(part, ...) -> ExportCGNS(..., part) { // ExportCGNS(part, ...) -> ExportCGNS(..., part)
_pyID partID = theCommand->GetArg( 1 ); _pyID partID = theCommand->GetArg( 1 );
int nbArgs = theCommand->GetNbArgs(); int nbArgs = theCommand->GetNbArgs();
@ -1579,6 +1587,14 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
theCommand->SetArg( i-1, theCommand->GetArg( i )); theCommand->SetArg( i-1, theCommand->GetArg( i ));
theCommand->SetArg( nbArgs, partID ); theCommand->SetArg( nbArgs, partID );
} }
else if ( method == "ExportGMF" )
{ // ExportGMF(part,file,bool) -> ExportCGNS(file, part)
_pyID partID = theCommand->GetArg( 1 );
_AString file = theCommand->GetArg( 2 );
theCommand->RemoveArgs();
theCommand->SetArg( 1, file );
theCommand->SetArg( 2, partID );
}
else if ( theCommand->MethodStartsFrom( "ExportPartTo" )) else if ( theCommand->MethodStartsFrom( "ExportPartTo" ))
{ // ExportPartTo*(part, ...) -> Export*(..., part) { // ExportPartTo*(part, ...) -> Export*(..., part)
// //
@ -3593,7 +3609,7 @@ void _pyCommand::SetArg( int index, const TCollection_AsciiString& theArg)
void _pyCommand::RemoveArgs() void _pyCommand::RemoveArgs()
{ {
if ( int pos = myString.Location( '(', 1, Length() )) if ( int pos = myString.Location( '(', Max( 1, GetBegPos( METHOD_IND )), Length() ))
myString.Trunc( pos ); myString.Trunc( pos );
myString += ")"; myString += ")";
myArgs.Clear(); myArgs.Clear();