+
+ // Case for NumberOfLayers hypothesis
+ else if(aStates->GetObjectType().IsEqual("NumberOfLayers")){
+ if(aMethod == "SetNumberOfLayers" && aStates->GetCurrectState().size() >= 1) {
+ if(!aStates->GetCurrectState().at(0).IsEmpty() )
+ aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+ aStates->IncrementState();
+ }
+ }
+
+ // Case for NumberOfSegments hypothesis
+ else if(aStates->GetObjectType().IsEqual("NumberOfSegments")){
+ if(aMethod == "SetNumberOfSegments" && aStates->GetCurrectState().size() >= 1) {
+ if(!aStates->GetCurrectState().at(0).IsEmpty() )
+ aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+ if(aStates->GetCurrectState().size()==1)
+ aStates->IncrementState();
+ }
+ else if (aMethod == "SetScaleFactor" && aStates->GetCurrectState().size() >= 2) {
+ if(!aStates->GetCurrectState().at(1).IsEmpty() )
+ aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+ aStates->IncrementState();
+ }
+ }
+
+ else if(aStates->GetObjectType().IsEqual("Mesh")) {
+ TState aCurrentState = aStates->GetCurrectState();
+ int aCurrentStateSize = aCurrentState.size();
+ if(aMethod.IsEqual("Translate") ||
+ aMethod.IsEqual("TranslateMakeGroups") ||
+ aMethod.IsEqual("TranslateMakeMesh")) {
+ bool isVariableFound = false;
+ int anArgIndex = 0;
+ for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+ if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+ anArgIndex = i+1;
+ break;
+ }
+ }
+ if(anArgIndex > 0) {
+ if(aCurrentStateSize == 3) { // translation by dx, dy, dz
+ for(int j = 0; j < aCurrentStateSize; j++) {
+ if(!aCurrentState.at(j).IsEmpty()) {
+ isVariableFound = true;
+ aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+ }
+ }
+ }
+ else if(aCurrentStateSize == 6) { // translation by x1, x2, y1, y2, z1, z2
+ // TODO
+ }
+ }
+ if(isVariableFound) {
+ aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
+ aCmd->SetArg(anArgIndex - 2, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".DirStructStr");
+ }
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("Rotate") ||
+ aMethod.IsEqual("RotateMakeGroups") ||
+ aMethod.IsEqual("RotateMakeMesh") ||
+ aMethod.IsEqual("Mirror") ||
+ aMethod.IsEqual("MirrorMakeGroups") ||
+ aMethod.IsEqual("MirrorMakeMesh")) {
+ bool isSubstitute = false;
+ int anArgIndex = 0;
+ for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+ if(aCmd->GetArg(i).IsEqual("SMESH.AxisStruct")) {
+ anArgIndex = i+1;
+ break;
+ }
+ }
+ if(anArgIndex > 0) {
+ for(int j = 0; j < aCurrentStateSize; j++) {
+ if(!aCurrentState.at(j).IsEmpty()) {
+ if(j < 6) // from 0 to 5 - axis struct, 6 - angle
+ isSubstitute = true;
+ aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+ }
+ }
+ }
+ if(isSubstitute)
+ aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".AxisStructStr");
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("AddNode") ||
+ aMethod.IsEqual("MoveClosestNodeToPoint")) {
+ for(int j = 0; j < aCurrentStateSize; j++) {
+ if(!aCurrentState.at(j).IsEmpty())
+ aCmd->SetArg(j+1, aCurrentState.at(j));
+ }
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("MoveNode")) {
+ for(int j = 0; j < aCurrentStateSize; j++) {
+ if(!aCurrentState.at(j).IsEmpty())
+ aCmd->SetArg(j+2, aCurrentState.at(j));