From: ouv Date: Tue, 4 Dec 2007 11:58:29 +0000 (+0000) Subject: Bug IPAL18147 : 4.x: wrong frames are generated and played for the "Successive Animat... X-Git-Tag: mergefrom_MERGE_MULTIPR_EVOLUTION_07-Dec-07~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cd6fcadc8d608b076837826e632dee1a71072f7d;p=modules%2Fvisu.git Bug IPAL18147 : 4.x: wrong frames are generated and played for the "Successive Animation" after edition. --- diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index f3d9b5e5..fd12611f 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -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(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); diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index ca28ac6e..6152e6fb 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -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) {