X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_NoteBook.cxx;h=191a78142baaa3f01548f1f3c6785589d1601110;hb=8eb6a5158a3fef2d63986b7ffcde29ba3182ac92;hp=b143f63b48ca4f00838320fb193dd5f2b0ea3092;hpb=882884f6791da81b5ef562741458bc542c45edaf;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx index b143f63b4..191a78142 100644 --- a/src/SMESH_I/SMESH_NoteBook.cxx +++ b/src/SMESH_I/SMESH_NoteBook.cxx @@ -81,7 +81,10 @@ void ObjectStates::AddState(const TState &theState) //================================================================================ TState ObjectStates::GetCurrectState() const { - return _states[_dumpstate]; + if(_states.size() > _dumpstate) + return _states[_dumpstate]; + TState empty; + return empty; } @@ -243,7 +246,7 @@ void SMESH_NoteBook::ReplaceVariables() if(it != _objectMap.end() && !aMethod.IsEmpty()) { ObjectStates *aStates = (*it).second; // Case for LocalLength hypothesis - if(aStates->GetObjectType().IsEqual("LocalLength")) { + if(aStates->GetObjectType().IsEqual("LocalLength") && aStates->GetCurrectState().size() >= 2) { if(aMethod.IsEqual("SetLength")) { if(!aStates->GetCurrectState().at(0).IsEmpty() ) aCmd->SetArg(1,aStates->GetCurrectState().at(0)); @@ -257,13 +260,33 @@ void SMESH_NoteBook::ReplaceVariables() } // Case for SegmentLengthAroundVertex hypothesis - else if(aStates->GetObjectType().IsEqual("SegmentLengthAroundVertex")) { + else if(aStates->GetObjectType().IsEqual("SegmentLengthAroundVertex") + && aStates->GetCurrectState().size() >= 1) { if(aMethod == "SetLength") { if(!aStates->GetCurrectState().at(0).IsEmpty() ) aCmd->SetArg(1,aStates->GetCurrectState().at(0)); aStates->IncrementState(); } } + // Case for Arithmetic1D or StartEndLength hypothesis + else if(aStates->GetObjectType().IsEqual("Arithmetic1D") || + aStates->GetObjectType().IsEqual("StartEndLength")) { + if(aMethod == "SetLength" && + aStates->GetCurrectState().size() >= 2) { + if(aCmd->GetArg(2) == "1" && !aStates->GetCurrectState().at(0).IsEmpty()) + aCmd->SetArg(1,aStates->GetCurrectState().at(0)); + else if(!aStates->GetCurrectState().at(1).IsEmpty()) + aCmd->SetArg(1,aStates->GetCurrectState().at(1)); + aStates->IncrementState(); + } + } + else if(aStates->GetObjectType().IsEqual("Deflection1D")){ + if(aMethod == "SetDeflection" && aStates->GetCurrectState().size() >= 1) { + if(!aStates->GetCurrectState().at(0).IsEmpty() ) + aCmd->SetArg(1,aStates->GetCurrectState().at(0)); + aStates->IncrementState(); + } + } // Case for LayerDistribution hypothesis (not finished yet) else if(aStates->GetObjectType() == "LayerDistribution") { if(aMethod == "SetLayerDistribution"){