Salome HOME
Fix some bugs.
[modules/smesh.git] / src / SMESH_I / SMESH_NoteBook.cxx
index 3d2ea4099c578d0d927e054441b56a85e3778b9c..ac3ae0c152a29c3cc10b9c56e718277b0f5ea948 100644 (file)
@@ -316,6 +316,56 @@ void SMESH_NoteBook::ReplaceVariables()
         }
       }
 
+      // Case for NETGEN_Parameters_2D or NETGEN_Parameters_2D hypothesis
+      else if(aStates->GetObjectType().IsEqual("NETGEN_Parameters_2D") ||
+              aStates->GetObjectType().IsEqual("NETGEN_Parameters")){
+        if(aMethod == "SetMaxSize" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetGrowthRate" && aStates->GetCurrectState().size() >= 2) {
+          if(!aStates->GetCurrectState().at(1).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetNbSegPerEdge" && aStates->GetCurrectState().size() >= 3) {
+          if(!aStates->GetCurrectState().at(2).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(2));
+          aStates->IncrementState();
+        } 
+        else if(aMethod == "SetNbSegPerRadius" && aStates->GetCurrectState().size() >= 4) {
+          if(!aStates->GetCurrectState().at(3).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(3));
+          aStates->IncrementState();
+        } 
+      }
+
+      // Case for NETGEN_SimpleParameters_3D or NETGEN_SimpleParameters_2D hypothesis
+      else if(aStates->GetObjectType().IsEqual("NETGEN_SimpleParameters_3D") ||
+              aStates->GetObjectType().IsEqual("NETGEN_SimpleParameters_2D")){
+
+        if((aMethod == "SetNumberOfSegments" || aMethod == "SetLocalLength") && 
+           aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetMaxElementArea" && aStates->GetCurrectState().size() >= 2) {
+          if(!aStates->GetCurrectState().at(1).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetMaxElementVolume" && aStates->GetCurrectState().size() >= 3) {
+          if(!aStates->GetCurrectState().at(2).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(2));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "LengthFromEdges" || aMethod == "LengthFromFaces"){
+          aStates->IncrementState();
+        }
+      }
+      
       // Case for NumberOfLayers hypothesis
       else if(aStates->GetObjectType().IsEqual("NumberOfLayers")){
         if(aMethod == "SetNumberOfLayers" && aStates->GetCurrectState().size() >= 1) {
@@ -364,6 +414,8 @@ void SMESH_NoteBook::ReplaceVariables()
              }
            }
            else if(aCurrentStateSize == 6) { // translation by x1, x2, y1, y2, z1, z2
+             // TODO: limitation until operations on the variables will be introduced
+             /*
              isVariableFound = true;
              for(int j = 0; j < 3; j++) {
                TCollection_AsciiString anArg = aCmd->GetArg(anArgIndex+j);
@@ -387,6 +439,7 @@ void SMESH_NoteBook::ReplaceVariables()
                }
                aCmd->SetArg(anArgIndex+j, aValue1 + ", " + aValue2 );
              }
+             */
            }
           }
           if(isVariableFound) {