+ } // if ( aStates->GetObjectType().IsEqual("Mesh"))
+
+ // 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();
+ // }
+ // }
+
+ else
+ {
+ // treat Netgen hypotheses;
+ // this (and above) code can work wrong since nb of states can differ from nb of
+ // dumped calls due to the fix of
+ // issue 0021364:: Dump of netgen parameters has duplicate lines
+ SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
+ SALOMEDS::Study_ptr aStudy = aGen->GetCurrentStudy();
+ SALOMEDS::SObject_var sobj = aStudy->FindObjectID( (*it).first.ToCString() );
+ CORBA::Object_var obj = aGen->SObjectToObject( sobj );
+ if ( SMESH_Hypothesis_i* h = SMESH::DownCast< SMESH_Hypothesis_i*>( obj ))
+ {
+ TState aCurrentState = aStates->GetCurrectState();
+ int argIndex = h->getParamIndex( aMethod, aCurrentState.size() );
+ if ( 0 <= argIndex && argIndex < aCurrentState.size() &&
+ !aCurrentState[argIndex].IsEmpty() )
+ aCmd->SetArg( 1, aCurrentState[argIndex] );
+
+ if ( argIndex >= 0 )
+ aStates->IncrementState();
+ }