#16526 EDF 18698 - Problem when loading a dumped script

take into account an argument added to Concatenate()
This commit is contained in:
eap 2019-02-14 15:34:14 +03:00
parent 6d32f944a0
commit a30f2699f0

View File

@ -1098,9 +1098,21 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
// Concatenate( [mesh1, ...], ... ) // Concatenate( [mesh1, ...], ... )
else if ( method == "Concatenate" || method == "ConcatenateWithGroups") else if ( method == "Concatenate" || method == "ConcatenateWithGroups")
{ {
// OLD IDL: ( meshes, uniteGroups, toMerge, tol )
// IDL: ( meshes, uniteGroups, toMerge, tol, meshToAppendTo )
// PY: ( meshes, uniteGroups, toMerge, tol, allGroups=False, name="", meshToAppendTo=None )
_pyID appendMesh = theCommand->GetArg( 5 );
if ( method == "ConcatenateWithGroups" ) { if ( method == "ConcatenateWithGroups" ) {
theCommand->SetMethod( "Concatenate" ); theCommand->SetMethod( "Concatenate" );
theCommand->SetArg( theCommand->GetNbArgs() + 1, "True" ); theCommand->SetArg( 5, "True" );
}
else {
theCommand->SetArg( 5, "False" );
}
if ( !appendMesh.IsEmpty() && appendMesh != "None" )
{
appendMesh.Insert( 1, "meshToAppendTo=" );
theCommand->SetArg( theCommand->GetNbArgs() + 1, appendMesh );
} }
Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() ); Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() );
AddObject( mesh ); AddObject( mesh );
@ -2219,7 +2231,7 @@ void _pyMesh::Flush()
list < Handle(_pyCommand) >::iterator cmd; list < Handle(_pyCommand) >::iterator cmd;
// try to convert algo addition like this: // try to convert algo addition like this:
// mesh.AddHypothesis(geom, ALGO ) --> ALGO = mesh.Algo() // mesh.AddHypothesis( geom, ALGO ) --> ALGO = mesh.Algo()
for ( cmd = myAddHypCmds.begin(); cmd != myAddHypCmds.end(); ++cmd ) for ( cmd = myAddHypCmds.begin(); cmd != myAddHypCmds.end(); ++cmd )
{ {
Handle(_pyCommand) addCmd = *cmd; Handle(_pyCommand) addCmd = *cmd;