method == "DoubleNodeGroupNew" ||
method == "DoubleNodeGroupsNew" ||
method == "DoubleNodeElemGroupNew" ||
- method == "DoubleNodeElemGroupsNew" )
+ method == "DoubleNodeElemGroupsNew"||
+ method == "DoubleNodeElemGroup2New"||
+ method == "DoubleNodeElemGroups2New"
+ )
groups = aCommand->GetResultValue();
else if ( method == "MakeBoundaryMesh" )
groups = aCommand->GetResultValue(2);
{
for(int ind = 0;ind<theCommand->GetNbResultValues();ind++)
{
- const _pyID& meshID = theCommand->GetResultValue(ind+1);
+ _pyID meshID = theCommand->GetResultValue(ind+1);
if ( !theCommand->IsStudyEntry( meshID ) ) continue;
Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue(ind+1));
myMeshes.insert( make_pair( mesh->GetID(), mesh ));
isPyMeshMethod=true;
theCommand->SetMethod("FindCoincidentNodesOnPart");
}
- // DoubleNodeElemGroupNew() -> DoubleNodeElemGroup()
- // DoubleNodeGroupNew() -> DoubleNodeGroup()
- // DoubleNodeGroupsNew() -> DoubleNodeGroups()
- // DoubleNodeElemGroupsNew() -> DoubleNodeElemGroups()
+ // DoubleNode...New(...) -> DoubleNode...(...,True)
if ( !isPyMeshMethod && ( method == "DoubleNodeElemGroupNew" ||
method == "DoubleNodeElemGroupsNew" ||
method == "DoubleNodeGroupNew" ||
- method == "DoubleNodeGroupsNew"))
+ method == "DoubleNodeGroupsNew" ||
+ method == "DoubleNodeElemGroup2New" ||
+ method == "DoubleNodeElemGroups2New"))
{
isPyMeshMethod=true;
- theCommand->SetMethod( method.SubString( 1, method.Length()-3));
- theCommand->SetArg(theCommand->GetNbArgs()+1,"True");
+ const int excessLen = 3 + int( method.Value( method.Length()-3 ) == '2' );
+ theCommand->SetMethod( method.SubString( 1, method.Length()-excessLen));
+ if ( excessLen == 3 )
+ {
+ theCommand->SetArg(theCommand->GetNbArgs()+1,"True");
+ }
+ else if ( theCommand->GetArg(4) == "0" ||
+ theCommand->GetArg(5) == "0" )
+ {
+ // [ nothing, Group ] = DoubleNodeGroup2New(,,,False, True) ->
+ // Group = DoubleNodeGroup2New(,,,False, True)
+ _pyID groupID = theCommand->GetResultValue( 1 + int( theCommand->GetArg(4) == "0"));
+ theCommand->SetResultValue( groupID );
+ }
}
// ConvertToQuadraticObject(bool,obj) -> ConvertToQuadratic(bool,obj)
// ConvertFromQuadraticObject(obj) -> ConvertFromQuadratic(obj)
//================================================================================
/*!
* \brief Return substring of python command looking like
- * ResultValue1 , ResultValue1,... = Obj.Meth() with res index
+ * ResultValue1 , ResultValue2,... = Obj.Meth() with res index
* \retval const TCollection_AsciiString & - ResultValue with res index substring
*/
//================================================================================
-const TCollection_AsciiString & _pyCommand::GetResultValue(int res)
+TCollection_AsciiString _pyCommand::GetResultValue(int res)
{
int begPos = 1;
- int Nb=0;
+ if ( SkipSpaces( myString, begPos ) && myString.Value( begPos ) == '[' )
+ ++begPos; // skip [, else the whole list is returned
int endPos = myString.Location( "=", 1, Length() );
+ int Nb=0;
while ( begPos < endPos) {
- myRes = GetWord( myString, begPos, true );
- begPos = begPos + myRes.Length();
+ _AString result = GetWord( myString, begPos, true );
+ begPos = begPos + result.Length();
Nb++;
- if(res == Nb){
- myRes.RemoveAll('[');myRes.RemoveAll(']');
- return myRes;
+ if(res == Nb) {
+ result.RemoveAll('[');
+ result.RemoveAll(']');
+ return result;
}
if(Nb>res)
break;
* \param theString - The string
* \param thePos - The position to search from and which returns result
* \retval bool - false if there are only space after thePos in theString
- *
- *
*/
//================================================================================
theGen->AddMeshAccessorMethod( theCommand );
}
+//================================================================================
+/*!
+ * \brief Prevent clearing "DoubleNode...() command if a group created by it is removed
+ *
+ *
+ */
+//================================================================================
+
+void _pyGroup::Flush()
+{
+ if ( !theGen->IsToKeepAllCommands() &&
+ myCreationCmd && myCreationCmd->MethodStartsFrom("DoubleNode") )
+ {
+ myCreationCmd.Nullify();
+ }
+}
+
//================================================================================
/*!
* \brief Constructor of _pyFilter