From: mzn Date: Mon, 6 Sep 2010 10:54:26 +0000 (+0000) Subject: Fix for bug 0020953 (EDF 1485 VISU: Problem with a scale factor in successive animation). X-Git-Tag: V5_1_main_20100908 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a72d56422cce3b868d3126c53f881c3b8a251216;p=modules%2Fvisu.git Fix for bug 0020953 (EDF 1485 VISU: Problem with a scale factor in successive animation). --- diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 149f3ea7..30c672db 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -107,12 +107,19 @@ namespace { if(theAnimator->getNbFields() == 0) return; + int aRefFieldId = ( theAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ? theFieldId : 0; + + VISU::ColoredPrs3d_i* aInitialPrs3d = 0; + if (theAnimator->getFieldData(aRefFieldId).myPrs.size() > 0) + aInitialPrs3d = dynamic_cast(theAnimator->getFieldData(aRefFieldId).myPrs[0]); + theAnimator->generatePresentations(theFieldId); - FieldData& aFieldData = theAnimator->getFieldData(theFieldId); + if (!aInitialPrs3d) + aInitialPrs3d = dynamic_cast(theAnimator->getFieldData(aRefFieldId).myPrs[0]); - int aRefFieldId = ( theAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ? theFieldId : 0; - if(VISU::ColoredPrs3d_i* aInitialPrs3d = dynamic_cast(theAnimator->getFieldData(aRefFieldId).myPrs[0])){ + if (aInitialPrs3d) { + FieldData& aFieldData = theAnimator->getFieldData(theFieldId); for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];