]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug 0020953 (EDF 1485 VISU: Problem with a scale factor in successive animation). BR_WIN_INDUS V5_1_main_20100908 start_BR_WIN_INDUS
authormzn <mzn@opencascade.com>
Mon, 6 Sep 2010 10:54:26 +0000 (10:54 +0000)
committermzn <mzn@opencascade.com>
Mon, 6 Sep 2010 10:54:26 +0000 (10:54 +0000)
src/VISUGUI/VisuGUI_TimeAnimation.cxx

index 149f3ea7d33a008cfbcbc85a4c277bd4d55c2a43..30c672db292c9107a1ec2a7f4c535eae76522a74 100644 (file)
@@ -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<VISU::ColoredPrs3d_i*>(theAnimator->getFieldData(aRefFieldId).myPrs[0]);
+
     theAnimator->generatePresentations(theFieldId);
-    FieldData& aFieldData = theAnimator->getFieldData(theFieldId);
 
+    if (!aInitialPrs3d)
+      aInitialPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(theAnimator->getFieldData(aRefFieldId).myPrs[0]);
 
-    int aRefFieldId = ( theAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ? theFieldId : 0;
-    if(VISU::ColoredPrs3d_i* aInitialPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(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];