]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL18240: EDF628: include the number of the instant into the name of saved pictures...
authorjfa <jfa@opencascade.com>
Tue, 20 May 2008 07:20:13 +0000 (07:20 +0000)
committerjfa <jfa@opencascade.com>
Tue, 20 May 2008 07:20:13 +0000 (07:20 +0000)
src/VISU_I/VISU_TimeAnimation.cxx

index 6d82f2673c4217b68ee895c4d684602446183029..b73b168394ac4c7fda0949a7a70213d2daa24b65 100644 (file)
@@ -1353,11 +1353,17 @@ void VISU_TimeAnimation::saveImages( int theFieldId,
   if (myDumpFormat.compare("AVI") != 0) {
     QString aFile(myDumpPath);
 
+    int aFrameNb = myFrame; // parallel animation mode
+    if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) // successive animation mode
+      aFrameNb = getRelativeFrameNumber(myFrame).second;
+
+    int aMaxNb = myFieldsLst[theFieldId].myTiming.size();
+    int nbDigits = QString("%1").arg(aMaxNb).length();
+    QString aFormat = QString("%.%1d_").arg(nbDigits);
+
     QString aName;
-    if ( myAnimationMode == VISU::Animation::PARALLEL ) // parallel animation mode
-      aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[myFrame]);
-    else // successive animation mode
-      aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[getRelativeFrameNumber(myFrame).second]);
+    aName.sprintf(aFormat.latin1(), aFrameNb);
+    aName += QString("%1").arg(myFieldsLst[theFieldId].myTiming[aFrameNb]);
 
     int aPos = -1;
     while ((aPos = aName.find(".")) > -1 )