- }
- aStates->IncrementState();
- }
- else if(aMethod.IsEqual("ExtrusionAlongPath") ||
- aMethod.IsEqual("ExtrusionAlongPathObject") ||
- aMethod.IsEqual("ExtrusionAlongPathObject1D") ||
- aMethod.IsEqual("ExtrusionAlongPathObject2D") ||
- aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
- aMethod.IsEqual("ExtrusionAlongPathObjectMakeGroups") ||
- aMethod.IsEqual("ExtrusionAlongPathObject1DMakeGroups") ||
- aMethod.IsEqual("ExtrusionAlongPathObject2DMakeGroups") ||
- /* workaround for a bug in the command parsing algorithm */
- aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1 ||
- aCmd->GetString().Search("ExtrusionAlongPathObjectMakeGroups") != -1 ||
- aCmd->GetString().Search("ExtrusionAlongPathObject1DMakeGroups") != -1 ||
- aCmd->GetString().Search("ExtrusionAlongPathObject2DMakeGroups") != -1 ) {
- int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
- bool isSubstitute = false;
- int anArgIndex = 0;
- for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
- if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
- anArgIndex = i-1-aNbAngles;
- break;
- }
- }
- if(anArgIndex > 0) {
- int j = 0;
- for(; j < aNbAngles; j++) {
- if(!aCurrentState.at(j).IsEmpty()) {
- aCmd->SetArg(anArgIndex+j-1, aCurrentState.at(j));
- }
- }
- for(; j < aNbAngles+3; j++) {
- if(!aCurrentState.at(j).IsEmpty()) {
- isSubstitute = true;
- aCmd->SetArg(anArgIndex+j+2, aCurrentState.at(j));
- }
- }
- }
- if(isSubstitute)
- aCmd->SetArg(anArgIndex + aNbAngles + 1,
- TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
- aStates->IncrementState();
- }
- else if(aMethod.IsEqual("TriToQuad") ||
- aMethod.IsEqual("Concatenate") ||
- aMethod.IsEqual("ConcatenateWithGroups")) {
- if(aCurrentStateSize && !aCurrentState.at(0).IsEmpty())
- aCmd->SetArg(aCmd->GetNbArgs(), aCurrentState.at(0));
- aStates->IncrementState();
- }
- else if(aMethod.IsEqual("Smooth") ||
- aMethod.IsEqual("SmoothObject") ||
- aMethod.IsEqual("SmoothParametric") ||
- aMethod.IsEqual("SmoothParametricObject")) {
- int anArgIndex = aCmd->GetNbArgs() - 2;
- for(int j = 0; j < aCurrentStateSize; j++) {
- if(!aCurrentState.at(j).IsEmpty())
- aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
- }
- aStates->IncrementState();
- }
- else if(aMethod.IsEqual("ApplyToMeshFaces") ||
- aMethod.IsEqual("ApplyToHexahedrons")) {
- int anArgIndex = aCmd->GetNbArgs()-1;
- for(int j = 0; j < aCurrentStateSize; j++)
- if(!aCurrentState.at(j).IsEmpty())
- aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
- aStates->IncrementState();
- }
+ }
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("ExtrusionAlongPath") ||
+ aMethod.IsEqual("ExtrusionAlongPathObject") ||
+ aMethod.IsEqual("ExtrusionAlongPathObject1D") ||
+ aMethod.IsEqual("ExtrusionAlongPathObject2D") ||
+ aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
+ aMethod.IsEqual("ExtrusionAlongPathObjectMakeGroups") ||
+ aMethod.IsEqual("ExtrusionAlongPathObject1DMakeGroups") ||
+ aMethod.IsEqual("ExtrusionAlongPathObject2DMakeGroups") ||
+ /* workaround for a bug in the command parsing algorithm */
+ aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1 ||
+ aCmd->GetString().Search("ExtrusionAlongPathObjectMakeGroups") != -1 ||
+ aCmd->GetString().Search("ExtrusionAlongPathObject1DMakeGroups") != -1 ||
+ aCmd->GetString().Search("ExtrusionAlongPathObject2DMakeGroups") != -1 ) {
+ int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
+ bool isSubstitute = false;
+ int anArgIndex = 0;
+ for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+ if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+ anArgIndex = i-1-aNbAngles;
+ break;
+ }
+ }
+ if(anArgIndex > 0) {
+ int j = 0;
+ for(; j < aNbAngles; j++) {
+ if(!aCurrentState.at(j).IsEmpty()) {
+ aCmd->SetArg(anArgIndex+j-1, aCurrentState.at(j));
+ }
+ }
+ for(; j < aNbAngles+3; j++) {
+ if(!aCurrentState.at(j).IsEmpty()) {
+ isSubstitute = true;
+ aCmd->SetArg(anArgIndex+j+2, aCurrentState.at(j));
+ }
+ }
+ }
+ if(isSubstitute)
+ aCmd->SetArg(anArgIndex + aNbAngles + 1,
+ TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("TriToQuad") ||
+ aMethod.IsEqual("Concatenate") ||
+ aMethod.IsEqual("ConcatenateWithGroups")) {
+ if(aCurrentStateSize && !aCurrentState.at(0).IsEmpty())
+ aCmd->SetArg(aCmd->GetNbArgs(), aCurrentState.at(0));
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("Smooth") ||
+ aMethod.IsEqual("SmoothObject") ||
+ aMethod.IsEqual("SmoothParametric") ||
+ aMethod.IsEqual("SmoothParametricObject")) {
+ int anArgIndex = aCmd->GetNbArgs() - 2;
+ for(int j = 0; j < aCurrentStateSize; j++) {
+ if(!aCurrentState.at(j).IsEmpty())
+ aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+ }
+ aStates->IncrementState();
+ }
+ else if(aMethod.IsEqual("ApplyToMeshFaces") ||
+ aMethod.IsEqual("ApplyToHexahedrons")) {
+ int anArgIndex = aCmd->GetNbArgs()-1;
+ for(int j = 0; j < aCurrentStateSize; j++)
+ if(!aCurrentState.at(j).IsEmpty())
+ aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+ aStates->IncrementState();
+ }