//================================================================================
TState ObjectStates::GetCurrectState() const
{
- return _states[_dumpstate];
+ if(_states.size() > _dumpstate)
+ return _states[_dumpstate];
+ TState empty;
+ return empty;
}
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));
}
// 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"){