]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Use SameAs functionality instead of pure GUI - storeToObject
authorapo <apo@opencascade.com>
Wed, 23 May 2007 12:51:12 +0000 (12:51 +0000)
committerapo <apo@opencascade.com>
Wed, 23 May 2007 12:51:12 +0000 (12:51 +0000)
src/VISUGUI/VisuGUI_TimeAnimation.cxx

index f44018d022c76f46a20a070ec5994f3b74d1459f..1b0a471fd22d195d5143a6bab81c7b4f840c21ef 100644 (file)
@@ -799,13 +799,13 @@ namespace
   {
     TDialog* aDlg = new TDialog(theModule);
     aDlg->initFromPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[0]));
-    if (aDlg->exec()) {
-      for (int i = 0; i < theData.myNbFrames; i++)
-       aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[i]));
+    if (aDlg->exec() && aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[0]))) {
+      for (int i = 1; i < theData.myNbFrames; i++)
+       theData.myPrs[i]->SameAs(theData.myPrs[0]);
       if ( theAnimator->getAnimationMode() == 1 ) {
        for (int i = 1; i < theAnimator->getNbFields(); i++) {
          for (int j = 0; j < theAnimator->getFieldData(i).myNbFrames; j++)
-           aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(theAnimator->getFieldData(i).myPrs[j]));
+           theAnimator->getFieldData(i).myPrs[j]->SameAs(theData.myPrs[0]);
        }
       }
     }
@@ -880,18 +880,11 @@ void SetupDlg::onPreferencesDlg()
       typedef VISU::ScalarMapOnDeformedShape_i TYPE;
       DLG* aDlg = new DLG (myModule);
       aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs[0]));
-      if (aDlg->exec())
-        { 
-         int anbFrames=aDlg->getCurrentScalarNbIterations();
-         int aIter = 0;
-         for (int i = 0; i < aData.myNbFrames; i++){
-           TYPE* aCurrPrs_i = dynamic_cast<TYPE*>(aData.myPrs[i]);
-           aIter = i+1;
-           if(i+1 > anbFrames)
-             aIter=anbFrames;
-           aDlg->storeToPrsObject(aCurrPrs_i);
-         }
+      if (aDlg->exec() && aDlg->storeToPrsObject(aData.myPrs[0])) { 
+       for (int i = 1; i < aData.myNbFrames; i++){
+         aData.myPrs[i]->SameAs(aData.myPrs[0]);
        }
+      }
       delete aDlg;
     }
     break;