Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0021920: [CEA 689] Get some measure functions on groups available in GUI and TUI
[modules/smesh.git]
/
src
/
SMESH_I
/
SMESH_2smeshpy.cxx
diff --git
a/src/SMESH_I/SMESH_2smeshpy.cxx
b/src/SMESH_I/SMESH_2smeshpy.cxx
index 7cfe7dd47165df303d8514221db441971316265b..60c0b2491a8bff050377059d5e62baf3a723e1e7 100644
(file)
--- a/
src/SMESH_I/SMESH_2smeshpy.cxx
+++ b/
src/SMESH_I/SMESH_2smeshpy.cxx
@@
-3547,7
+3547,7
@@
const TCollection_AsciiString & _pyCommand::GetObject()
if ( GetBegPos( OBJECT_IND ) == UNKNOWN )
{
// beginning
if ( GetBegPos( OBJECT_IND ) == UNKNOWN )
{
// beginning
- int begPos = GetBegPos( RESULT_IND )
+ myRes.Length()
;
+ int begPos = GetBegPos( RESULT_IND );
if ( begPos < 1 ) {
begPos = myString.Location( "=", 1, Length() ) + 1;
// is '=' in the string argument (for example, name) or not
if ( begPos < 1 ) {
begPos = myString.Location( "=", 1, Length() ) + 1;
// is '=' in the string argument (for example, name) or not
@@
-3564,6
+3564,9
@@
const TCollection_AsciiString & _pyCommand::GetObject()
if ( nb1 % 2 != 0 || nb2 % 2 != 0 )
begPos = 1;
}
if ( nb1 % 2 != 0 || nb2 % 2 != 0 )
begPos = 1;
}
+ else {
+ begPos += myRes.Length();
+ }
myObj = GetWord( myString, begPos, true );
if ( begPos != EMPTY )
{
myObj = GetWord( myString, begPos, true );
if ( begPos != EMPTY )
{
@@
-4327,7
+4330,9
@@
bool _pyGroup::CanClear()
if ( IsInStudy() )
return false;
if ( IsInStudy() )
return false;
- if ( !myCanClearCreationCmd && myCreationCmd->GetMethod() == "GetGroups" )
+ if ( !myCanClearCreationCmd &&
+ !myCreationCmd.IsNull() &&
+ myCreationCmd->GetMethod() == "GetGroups" )
{
TCollection_AsciiString grIDs = myCreationCmd->GetResultValue();
list< _pyID > idList = myCreationCmd->GetStudyEntries( grIDs );
{
TCollection_AsciiString grIDs = myCreationCmd->GetResultValue();
list< _pyID > idList = myCreationCmd->GetStudyEntries( grIDs );
@@
-4413,6
+4418,7
@@
void _pyGroup::Process( const Handle(_pyCommand)& theCommand)
makeGroupCmd->SetMethod( "MakeGroupByFilter" );
makeGroupCmd->SetArg( 1, name );
makeGroupCmd->SetArg( 2, idSource );
makeGroupCmd->SetMethod( "MakeGroupByFilter" );
makeGroupCmd->SetArg( 1, name );
makeGroupCmd->SetArg( 2, idSource );
+ filter->AddArgCmd( makeGroupCmd );
}
}
else if ( theCommand->GetMethod() == "SetFilter" )
}
}
else if ( theCommand->GetMethod() == "SetFilter" )
@@
-4452,7
+4458,7
@@
void _pyGroup::Process( const Handle(_pyCommand)& theCommand)
void _pyGroup::Flush()
{
if ( !theGen->IsToKeepAllCommands() &&
void _pyGroup::Flush()
{
if ( !theGen->IsToKeepAllCommands() &&
-
myCreationCmd
&& !myCanClearCreationCmd )
+
!myCreationCmd.IsNull()
&& !myCanClearCreationCmd )
{
myCreationCmd.Nullify(); // this way myCreationCmd won't be cleared
}
{
myCreationCmd.Nullify(); // this way myCreationCmd won't be cleared
}
@@
-4467,6
+4473,7
@@
void _pyGroup::Flush()
_pyFilter::_pyFilter(const Handle(_pyCommand)& theCreationCmd, const _pyID& newID/*=""*/)
:_pyObject(theCreationCmd), myNewID( newID )
{
_pyFilter::_pyFilter(const Handle(_pyCommand)& theCreationCmd, const _pyID& newID/*=""*/)
:_pyObject(theCreationCmd), myNewID( newID )
{
+ //myIsPublished = true; // prevent clearing as a not published
theGen->KeepAgrCmds( GetID() ); // ask to fill myArgCmds
}
theGen->KeepAgrCmds( GetID() ); // ask to fill myArgCmds
}
@@
-4500,8
+4507,11
@@
void _pyFilter::Process( const Handle(_pyCommand)& theCommand)
theCommand->SetObject( SMESH_2smeshpy::GenName() );
theCommand->SetMethod( "GetFilterFromCriteria" );
theCommand->SetObject( SMESH_2smeshpy::GenName() );
theCommand->SetMethod( "GetFilterFromCriteria" );
- //
Clear aFilterManager.CreateFilter()
+ //
Swap "aFilterManager.CreateFilter()" and "smesh.GetFilterFromCriteria(criteria)"
GetCreationCmd()->Clear();
GetCreationCmd()->Clear();
+ GetCreationCmd()->GetString() = theCommand->GetString();
+ theCommand->Clear();
+ theCommand->AddDependantCmd( GetCreationCmd() );
}
else if ( theCommand->GetMethod() == "SetMesh" )
{
}
else if ( theCommand->GetMethod() == "SetMesh" )
{
@@
-4551,9
+4561,6
@@
void _pyFilter::Flush()
bool _pyObject::CanClear()
{
bool _pyObject::CanClear()
{
- if ( !myIsPublished )
- return true;
-
list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin();
for ( ; cmd != myArgCmds.end(); ++cmd )
if ( !(*cmd)->IsEmpty() )
list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin();
for ( ; cmd != myArgCmds.end(); ++cmd )
if ( !(*cmd)->IsEmpty() )
@@
-4562,8
+4569,7
@@
bool _pyObject::CanClear()
if ( !obj.IsNull() && !obj->CanClear() )
return false;
}
if ( !obj.IsNull() && !obj->CanClear() )
return false;
}
-
- return true;
+ return ( !myIsPublished );
}
//================================================================================
}
//================================================================================