if ( !id.IsEmpty() )
setID( id );
+ myCanClearCreationCmd = true;
+
const _AString& method = theCreationCmd->GetMethod();
if ( method == "CreateGroup" ) // CreateGroup() --> CreateEmptyGroup()
{
}
myFilter = filter;
}
+ else
+ {
+ // theCreationCmd does something else apart from creation of this group
+ // and thus it can't be cleared if this group is removed
+ myCanClearCreationCmd = false;
+ }
}
//================================================================================
void _pyGroup::Flush()
{
if ( !theGen->IsToKeepAllCommands() &&
- myCreationCmd && myCreationCmd->MethodStartsFrom("DoubleNode") )
+ myCreationCmd && !myCanClearCreationCmd )
{
- myCreationCmd.Nullify();
+ myCreationCmd.Nullify(); // this way myCreationCmd won't be cleared
}
}
class _pyGroup: public _pySubMesh
{
Handle(_pyFilter) myFilter;
+ bool myCanClearCreationCmd;
public:
_pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id=_pyID());
virtual void Process( const Handle(_pyCommand)& theCommand);