0021509: EDF 2157: Error in the dump

1) fix _pyCommand::GetArg()
  2) AddMeshAccessorMethod() to "group.AddFrom( mesh )" command
This commit is contained in:
eap 2012-03-11 10:12:30 +00:00
parent 428b77cf72
commit 28bb38ba81

View File

@ -3097,7 +3097,7 @@ const TCollection_AsciiString & _pyCommand::GetArg( int index )
if ( separatorStack.back().Location( chr, 1, separatorStack.back().Length())) if ( separatorStack.back().Location( chr, 1, separatorStack.back().Length()))
{ {
if ( separatorStack.size() == 1 ) // ',' dividing args or a terminal ')' found if ( separatorStack.size() == 1 ) // a comma dividing args or a terminal ')' found
{ {
while ( pos-1 >= prevPos && isspace( myString.Value( prevPos ))) while ( pos-1 >= prevPos && isspace( myString.Value( prevPos )))
++prevPos; ++prevPos;
@ -3107,8 +3107,11 @@ const TCollection_AsciiString & _pyCommand::GetArg( int index )
arg.RightAdjust(); // remove spaces arg.RightAdjust(); // remove spaces
arg.LeftAdjust(); arg.LeftAdjust();
} }
if ( !arg.IsEmpty() || chr == ',' )
{
SetBegPos( ARG1_IND + myArgs.Length(), prevPos ); SetBegPos( ARG1_IND + myArgs.Length(), prevPos );
myArgs.Append( arg ); myArgs.Append( arg );
}
if ( chr == ')' ) if ( chr == ')' )
break; break;
prevPos = pos+1; prevPos = pos+1;
@ -3612,8 +3615,8 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand)
_pyID idSource = theCommand->GetArg(1); _pyID idSource = theCommand->GetArg(1);
// check if idSource is a filter // check if idSource is a filter
filter = Handle(_pyFilter)::DownCast( theGen->FindObject( idSource )); filter = Handle(_pyFilter)::DownCast( theGen->FindObject( idSource ));
if ( filter.IsNull() ) if ( !filter.IsNull() )
return; {
// find aFilter.SetMesh(mesh) to clear it, it should be just before theCommand // find aFilter.SetMesh(mesh) to clear it, it should be just before theCommand
list< Handle(_pyCommand) >::reverse_iterator cmdIt = theGen->GetCommands().rbegin(); list< Handle(_pyCommand) >::reverse_iterator cmdIt = theGen->GetCommands().rbegin();
while ( *cmdIt != theCommand ) ++cmdIt; while ( *cmdIt != theCommand ) ++cmdIt;
@ -3639,6 +3642,7 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand)
// set new name of a filter // set new name of a filter
filter->Process( makeGroupCmd ); filter->Process( makeGroupCmd );
} }
}
else if ( theCommand->GetMethod() == "SetFilter" ) else if ( theCommand->GetMethod() == "SetFilter" )
{ {
// set new name of a filter // set new name of a filter
@ -3650,6 +3654,8 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand)
if ( !filter.IsNull() ) if ( !filter.IsNull() )
filter->AddUser( this ); filter->AddUser( this );
theGen->AddMeshAccessorMethod( theCommand );
} }
//================================================================================ //================================================================================