//************************************************************************
CORBA::Boolean VISU_TimeAnimation::generateFrames() {
if (!myView) {
- MESSAGE("Viewer is nod defined for animation");
+ MESSAGE("Viewer is not defined for animation");
return false;
}
//************************************************************************
void VISU_TimeAnimation::clearView() {
if (!myView) {
- MESSAGE("Viewer is nod defined for animation");
+ MESSAGE("Viewer is not defined for animation");
return;
}
vtkRenderer* aRen = myView->getRenderer();
//************************************************************************
-void VISU_TimeAnimation::run() {
+void VISU_TimeAnimation::run()
+{
if (!myView) {
- MESSAGE("Viewer is nod defined for animation");
+ MESSAGE("Viewer is not defined for animation");
return;
}
- double k=1;
- double aOneVal;
- bool isDumping = !myDumpPath.isEmpty();
- aOneVal = (myFieldsLst[0].myNbFrames > 2) ?
- myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0] : 1;
+ double k = 1;
+ bool isDumping = !myDumpPath.isEmpty();
+ double aOneVal = 1;
+ if (myFieldsLst[0].myNbFrames > 2)
+ aOneVal = myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0];
qApp->lock();
while (myIsActive) {
emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
}
}
myView->Repaint(false);
+
+ int delay = 100;
if (isDumping) {
QPixmap px = QPixmap::grabWindow(myView->winId());
QString aFile(myDumpPath);
aFile += aName;
aFile += ".jpeg";
px.save(aFile, "JPEG");
- }
- if (!isDumping) {
+ } else {
+ k = 1;
if (myProportional) {
switch (myFrame) {
case 0:
- k=1;
break;
case 1:
if (myFieldsLst[0].myNbFrames > 2)
- k = (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal;
- else
- k = 1;
+ k = (myFieldsLst[0].myTiming[myFrame+1] -
+ myFieldsLst[0].myTiming[myFrame]) / aOneVal;
break;
default:
- k = (myFrame < (myFieldsLst[0].myNbFrames-1))?
- (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal : 1;
+ if (myFrame < (myFieldsLst[0].myNbFrames - 1))
+ k = (myFieldsLst[0].myTiming[myFrame+1] -
+ myFieldsLst[0].myTiming[myFrame]) / aOneVal;
}
- } else
- k = 1;
- qApp->unlock();
- msleep((int)(1000.*k/mySpeed));
- qApp->lock();
- } else {
- qApp->unlock();
- msleep(100);
- qApp->lock();
+ }
+ delay = (int)(1000. * k / mySpeed);
}
+ qApp->unlock();
+ msleep(delay);
+ qApp->lock();
+
if (!myIsActive) break;
myFrame++;
if (theTimeStamp->FindAttribute(anAttr, "AttributeName")) {
_PTR(AttributeName) aName (anAttr);
QString aNameString (aName->Value().c_str());
- return aNameString.toDouble();
+ int time_len = aNameString.find(',');
+ if (time_len > -1)
+ return aNameString.left(time_len).toDouble();
+ else
+ return aNameString.toDouble();
}
return -1.0;
}