From 4e44c1ba1a8ec0c54cbaf539b02394552853f762 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 23 May 2007 12:51:12 +0000 Subject: [PATCH] Use SameAs functionality instead of pure GUI - storeToObject --- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index f44018d0..1b0a471f 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -799,13 +799,13 @@ namespace { TDialog* aDlg = new TDialog(theModule); aDlg->initFromPrsObject(dynamic_cast(theData.myPrs[0])); - if (aDlg->exec()) { - for (int i = 0; i < theData.myNbFrames; i++) - aDlg->storeToPrsObject(dynamic_cast(theData.myPrs[i])); + if (aDlg->exec() && aDlg->storeToPrsObject(dynamic_cast(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(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(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(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; -- 2.39.2