]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug IPAL18147 : 4.x: wrong frames are generated and played for the "Successive Animat...
authorouv <ouv@opencascade.com>
Tue, 4 Dec 2007 11:58:29 +0000 (11:58 +0000)
committerouv <ouv@opencascade.com>
Tue, 4 Dec 2007 11:58:29 +0000 (11:58 +0000)
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.cxx

index f3d9b5e5609128791fd4c4b2fc15d4ba6192cd82..fd12611f93043c67d090497cf895813290dc74c1 100644 (file)
@@ -1035,6 +1035,9 @@ void SetupDlg::onSequenceCheck( bool theCheck )
     myUseRangeBox->blockSignals( false );
   }
 
+  QString anIndices = myIndices->text();
+  myAnimator->setAnimationSequence( anIndices.latin1() );
+
   setIsRegenerate( true );
 }
 
@@ -1514,6 +1517,8 @@ void VisuGUI_TimeAnimationDlg::createFrames()
   stopAnimation();
   SUIT_OverrideCursor c;
 
+  bool isRegenerate = mySetupDlg->isRegenerate();
+
   for (int i = 0; i < myAnimator->getNbFields(); i++) {
     FieldData& aFieldData = myAnimator->getFieldData(i);
     if( aFieldData.myPrs.empty() )
@@ -1525,7 +1530,7 @@ void VisuGUI_TimeAnimationDlg::createFrames()
     // ouv : IPAL18064
     // even if aFieldData is not empty, we must regenerate presentations,
     // when a range or a sequence of the animation has been changed
-    if( mySetupDlg->isRegenerate() )
+    if( isRegenerate )
     {
       VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aFieldData.myPrs[0]);
       if( !aPrs3d )
@@ -1536,15 +1541,16 @@ void VisuGUI_TimeAnimationDlg::createFrames()
       aFieldData = myAnimator->getFieldData(i);
       for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
        VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
+       std::string aTitle = aColoredPrs3d->GetCTitle();
        aColoredPrs3d->SameAs(aPrs3d);
        if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
-         std::string aTitle = aColoredPrs3d->GetCTitle();
          aColoredPrs3d->SetTitle(aTitle.c_str());
        }
       }
-      mySetupDlg->setIsRegenerate( false );
     }
   }
+  if( isRegenerate )
+    mySetupDlg->setIsRegenerate( false );
 
   if (myAnimator->getNbFrames() == 0) {
     myPlayFrame->setEnabled(false);
index ca28ac6e924a9bf8eb5f53a87714f12eb8f1195f..6152e6fb969146b71715b469de1c976dc6e813a4 100644 (file)
@@ -594,14 +594,12 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
   }
   
   if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) { // successive animation mode
-    if ( isRangeDefined() || isSequenceDefined() ) {
-      if ( myFieldsAbsFrames.size() == getNbFields() ) 
-       myFieldsAbsFrames.clear();
-      if ( theFieldNum > 0 )
-       myFieldsAbsFrames.push_back(myFieldsAbsFrames.back() + aData.myNbFrames);      
-      else
-       myFieldsAbsFrames.push_back(aData.myNbFrames);
-    }
+    if ( myFieldsAbsFrames.size() == getNbFields() ) 
+      myFieldsAbsFrames.clear();
+    if ( theFieldNum > 0 )
+      myFieldsAbsFrames.push_back(myFieldsAbsFrames.back() + aData.myNbFrames);      
+    else
+      myFieldsAbsFrames.push_back(aData.myNbFrames);
 
     if (theFieldNum == getNbFields() - 1) {
       if ( aData.myPrsType != VISU::TGAUSSPOINTS) {