{
double k = 1;
double aOneVal = 1;
- if (myFieldsLst[0].myNbFrames > 2)
+ FieldData& aFirstFieldData = myFieldsLst[0];
+ if (aFirstFieldData.myNbFrames > 2)
aOneVal = ( myTimeMax - myTimeMin ) / getNbFrames();
int aNbFiles = 0;
- bool hasHextFrame = true;
- while (hasHextFrame && myExecutionState->IsActive()) {
+ bool aHasNextFrame = aFirstFieldData.myField && aFirstFieldData.myNbFrames > 0;
+ while (aHasNextFrame && myExecutionState->IsActive()) {
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, aFirstFieldData.myTiming[myFrame]));
if (myExecutionState->IsActive()) {
- if (!(myFieldsLst[0].myField))
- break;
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
+ if (aData.myNbFrames == 0)
+ continue;
if (myFrame > 0) {
if (aData.myActors[myFrame-1] != 0)
visibilityOff(i, myFrame-1);
} else {
- if (aData.myActors[aData.myNbFrames-1] != 0)
- visibilityOff(i, aData.myNbFrames-1);
+ if (aData.myActors[aData.myNbFrames-1] != 0)
+ visibilityOff(i, aData.myNbFrames-1);
}
if (aData.myActors[myFrame] != 0) {
ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[myFrame],
case 0:
break;
case 1:
- if (myFieldsLst[0].myNbFrames > 2)
- k = (myFieldsLst[0].myTiming[myFrame+1] -
- myFieldsLst[0].myTiming[myFrame]) / aOneVal;
+ if (aFirstFieldData.myNbFrames > 2)
+ k = (aFirstFieldData.myTiming[myFrame+1] -
+ aFirstFieldData.myTiming[myFrame]) / aOneVal;
break;
default:
- if (myFrame < (myFieldsLst[0].myNbFrames - 1))
- k = (myFieldsLst[0].myTiming[myFrame+1] -
- myFieldsLst[0].myTiming[myFrame]) / aOneVal;
+ if (myFrame < (aFirstFieldData.myNbFrames - 1))
+ k = (aFirstFieldData.myTiming[myFrame+1] -
+ aFirstFieldData.myTiming[myFrame]) / aOneVal;
}
}
int delay = (int)(1000. * k / mySpeed);
delay = 1;
}
msleep(delay);
- if (!myExecutionState->IsActive()) return;
+ if (!myExecutionState->IsActive())
+ return;
if (theIsDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
msleep(delay);
- if (!myExecutionState->IsActive()) return;
+ if (!myExecutionState->IsActive())
+ return;
- if (!(myFieldsLst[0].myField)) // break, if field was deleted.
+ if (!(aFirstFieldData.myField)) // break, if field was deleted.
break;
saveImages( 0, aOneVal, aNbFiles, theIndexList );
}
- if (!myExecutionState->IsActive()) break;
+ if (!myExecutionState->IsActive())
+ break;
myFrame++;
- if (myFrame == myFieldsLst[0].myNbFrames) {
+ if (myFrame == aFirstFieldData.myNbFrames) {
if (!myCycling) {
- hasHextFrame = false;
+ aHasNextFrame = false;
myFrame--;
}
else
myFrame = 0;
}
- } // while (hasHextFrame && myExecutionState->IsActive())
+ } // while (aHasNextFrame && myExecutionState->IsActive())
}
//------------------------------------------------------------------------
double k = 1;
double aOneVal = 1;
- if (myFieldsLst[0].myNbFrames > 2)
+ FieldData& aFirstFieldData = myFieldsLst[0];
+ if (aFirstFieldData.myNbFrames > 2)
aOneVal = ( myTimeMax - myTimeMin ) / getNbFrames();
int aNbFiles = 0;
long aFrame = myFrame;
- bool hasHextFrame = true;
- while (hasHextFrame && myExecutionState->IsActive())
+ bool aHasNextFrame = true;
+ while (aHasNextFrame && myExecutionState->IsActive())
{
for (int aFieldId = 0;
(aFieldId < getNbFields()) && (myFieldsLst[aFieldId].myField);
case 0:
break;
case 1:
- if (myFieldsLst[0].myNbFrames > 2)
- k = (myFieldsLst[0].myTiming[aFrame+1] -
- myFieldsLst[0].myTiming[aFrame]) / aOneVal;
+ if (aFirstFieldData.myNbFrames > 2)
+ k = (aFirstFieldData.myTiming[aFrame+1] -
+ aFirstFieldData.myTiming[aFrame]) / aOneVal;
break;
default:
- if (aFrame < (myFieldsLst[0].myNbFrames - 1))
- k = (myFieldsLst[0].myTiming[aFrame+1] -
- myFieldsLst[0].myTiming[aFrame]) / aOneVal;
+ if (aFrame < (aFirstFieldData.myNbFrames - 1))
+ k = (aFirstFieldData.myTiming[aFrame+1] -
+ aFirstFieldData.myTiming[aFrame]) / aOneVal;
}
}
int delay = (int)(1000. * k / mySpeed);
} // for (int aFieldId = 0;
if (!myCycling) {
- hasHextFrame = false;
+ aHasNextFrame = false;
myFrame--;
}
else {
myFrame = 0;
aFrame = myFrame;
}
- } // while (hasHextFrame && myExecutionState->IsActive())
+ } // while (aHasNextFrame && myExecutionState->IsActive())
}
//------------------------------------------------------------------------
break;
default:
if (myProportional) {
- double p = (myFieldsLst[0].myTiming[myFrame] -
- myFieldsLst[0].myTiming[myFrame-1]) / theOneVal;
+ FieldData& aFirstFieldData = myFieldsLst[0];
+ double p = (aFirstFieldData.myTiming[myFrame] -
+ aFirstFieldData.myTiming[myFrame-1]) / theOneVal;
myFileIndex += (long) (5*p);
} else {
myFileIndex += 5;