From 1f872091b9e941e6e4a31f5420bfd16f974fb8a0 Mon Sep 17 00:00:00 2001 From: mkr Date: Wed, 1 Nov 2006 08:42:45 +0000 Subject: [PATCH] Fix for bug PAL11537 : Create an animation given several med files (add consecutive animation mode) : renaming "consecutive" -> "succcessive". --- idl/VISU_Gen.idl | 2 +- src/VISUGUI/VISU_msg_en.po | 4 +-- src/VISUGUI/VisuGUI.cxx | 12 ++++---- src/VISUGUI/VisuGUI.h | 2 +- src/VISUGUI/VisuGUI_ActionsDef.h | 2 +- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 8 +++--- src/VISU_I/VISU_TimeAnimation.cxx | 40 +++++++++++++-------------- src/VISU_I/VISU_TimeAnimation.h | 2 +- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index ab375635..c83a4dc7 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -1157,7 +1157,7 @@ module VISU { * This enumeration contains a set of available animation modes. */ enum AnimationMode{ PARALLEL, /*!< parallel mode of animation. */ - CONSECUTIVE /*!< consecutive mode of animation. */ + SUCCCESSIVE /*!< succcessive mode of animation. */ }; /*! Defines the field which will be used as a base for generation of the animation. diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 125a1224..a5811608 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -242,8 +242,8 @@ msgstr "Show..." msgid "VisuGUI::MEN_PARALLEL_ANIMATION" msgstr "Parallel Animation..." -msgid "VisuGUI::MEN_CONSECUTIVE_ANIMATION" -msgstr "Consecutive Animation..." +msgid "VisuGUI::MEN_SUCCCESSIVE_ANIMATION" +msgstr "Succcessive Animation..." msgid "VisuGUI::MEN_CELL_COLOR" msgstr "Cell color" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index f1080c4d..4645d881 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1679,7 +1679,7 @@ OnParallelTimeAnimation() void VisuGUI:: -OnConsecutiveTimeAnimation() +OnSucccessiveTimeAnimation() { OnTimeAnimation(1); } @@ -2279,9 +2279,9 @@ createActions() this, SLOT(OnParallelTimeAnimation())); aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION")); - createAction( VISU_CONSECUTIVEANIMATION, tr("MEN_CONSECUTIVE_ANIMATION"), QIconSet(aPixmap), - tr("MEN_CONSECUTIVE_ANIMATION"), "", 0, aParent, false, - this, SLOT(OnConsecutiveTimeAnimation())); + createAction( VISU_SUCCCESSIVEANIMATION, tr("MEN_SUCCCESSIVE_ANIMATION"), QIconSet(aPixmap), + tr("MEN_SUCCCESSIVE_ANIMATION"), "", 0, aParent, false, + this, SLOT(OnSucccessiveTimeAnimation())); aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL")); createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap), @@ -2467,7 +2467,7 @@ createPopupMenus() mgr->insert( action( VISU_SWEEP ), -1, -1, -1 ); mgr->insert( action( VISU_PARALLELANIMATION ), -1, -1, -1 ); - mgr->insert( action( VISU_CONSECUTIVEANIMATION ), -1, -1, -1 ); + mgr->insert( action( VISU_SUCCCESSIVEANIMATION ), -1, -1, -1 ); mgr->insert( separator(), -1, -1, -1 ); @@ -2646,7 +2646,7 @@ createPopupMenus() aRule += " and $type in {'VISU::TFIELD'}"; aRule += " and nbTimeStamps>0"; aRule += " and activeView in {'VTKViewer' 'VVTK'}"; - mgr->setRule( action( VISU_CONSECUTIVEANIMATION ), aRule, true ); + mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule, true ); aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}"; mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true ); diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index e4f7fd6b..ba4a09e3 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -147,7 +147,7 @@ protected slots: void OnClippingPlanes(); void OnSweep(); void OnParallelTimeAnimation(); - void OnConsecutiveTimeAnimation(); + void OnSucccessiveTimeAnimation(); void OnShowAnimation(); void OnCopyPresentation(); diff --git a/src/VISUGUI/VisuGUI_ActionsDef.h b/src/VISUGUI/VisuGUI_ActionsDef.h index b7819da5..4f78df4b 100644 --- a/src/VISUGUI/VisuGUI_ActionsDef.h +++ b/src/VISUGUI/VisuGUI_ActionsDef.h @@ -97,7 +97,7 @@ #define VISU_SWEEP 4064 #define VISU_SELECTION_INFO 4065 #define VISU_PARALLELANIMATION 4066 -#define VISU_CONSECUTIVEANIMATION 4067 +#define VISU_SUCCCESSIVEANIMATION 4067 #define VISU_ERASE_ALL 4070 #define VISU_GLOBAL_SELECTION 4071 diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 1022a0a5..7fb6f5a0 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -488,7 +488,7 @@ SetupDlg::SetupDlg (QWidget* theParent, double aStep; if ( myAnimator->getAnimationMode() == 0 ) aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1); - else { // consecutive animation mode + else { // succcessive animation mode std::pair aLastFieldFrame(myAnimator->getNbFields() - 1, myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1); aStep = (aMaxTime - aMinTime) / myAnimator->getAbsoluteFrameNumber(aLastFieldFrame); @@ -654,7 +654,7 @@ void SetupDlg::onFieldChange (int theIndex) aPrsType = aData.myPrsType; } - else if ( myAnimator->getAnimationMode() == 1 ) { // consecutive animation mode + else if ( myAnimator->getAnimationMode() == 1 ) { // succcessive animation mode for (int i = 0; i < myAnimator->getNbFields(); i++) { _PTR(SObject) aSO = myAnimator->getFieldData(i).myField; @@ -1069,7 +1069,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu if ( theMode == 0 ) setCaption("Parallel Animation"); else if ( theMode == 1 ) - setCaption("Consecutive Animation"); + setCaption("Succcessive Animation"); setSizeGripEnabled( TRUE ); isClosing = false; @@ -1603,7 +1603,7 @@ void VisuGUI_TimeAnimationDlg::restoreFromStudy(_PTR(SObject) theAnimation) myAnimator->restoreFromStudy(theAnimation); mySaveBtn->setEnabled(myAnimator->isSavedInStudy()); if ( myAnimator->getAnimationMode() == 1 ) - setCaption("Consecutive Animation"); + setCaption("Succcessive Animation"); } //------------------------------------------------------------------------ diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 2e1b6b80..d2c26193 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -169,7 +169,7 @@ bool VISU_TimeAnimation::addField (_PTR(SObject) theField) if ( myFieldsLst.isEmpty() ) myFieldsAbsFrames.push_back(aNewData.myNbTimes); } - else { // consecutive animation mode + else { // succcessive animation mode if ( aNewData.myNbTimes < 1 ) return false; @@ -349,7 +349,7 @@ namespace double getMinFieldsValue( QValueList& theFieldsLst ) { - // for consecutive animation mode only + // for succcessive animation mode only double aRes = theFieldsLst[0].myPrs[0]->GetMin(); for (int i = 1; i < theFieldsLst.count(); i++) { if ( aRes > theFieldsLst[i].myPrs[0]->GetMin() ) @@ -360,7 +360,7 @@ double getMinFieldsValue( QValueList& theFieldsLst ) double getMaxFieldsValue( QValueList& theFieldsLst ) { - // for consecutive animation mode only + // for succcessive animation mode only double aRes = theFieldsLst[0].myPrs[0]->GetMax(); for (int i = 1; i < theFieldsLst.count(); i++) { if ( aRes < theFieldsLst[i].myPrs[0]->GetMax() ) @@ -470,7 +470,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) { return; } - if ( myAnimationMode == 1 ) { // consecutive animation mode + if ( myAnimationMode == 1 ) { // succcessive animation mode if ( isRangeDefined() ) { if ( myFieldsAbsFrames.size() == getNbFields() ) myFieldsAbsFrames.clear(); @@ -652,7 +652,7 @@ void VISU_TimeAnimation::_nextFrame() { if (myFieldsLst[i].myActors[myFrame] != 0) visibilityOff(i, myFrame); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -670,7 +670,7 @@ void VISU_TimeAnimation::_nextFrame() { ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, myFrame, myFieldsLst[0].myTiming[myFrame])); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -709,7 +709,7 @@ void VISU_TimeAnimation::_prevFrame() { if (myFieldsLst[i].myActors[myFrame] != 0) visibilityOff(i, myFrame); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -727,7 +727,7 @@ void VISU_TimeAnimation::_prevFrame() { ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, myFrame, myFieldsLst[0].myTiming[myFrame])); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -762,7 +762,7 @@ void VISU_TimeAnimation::_firstFrame() { if (myFieldsLst[i].myActors[myFrame] != 0) visibilityOff(i, myFrame); } - else { //consecutive animation mode + else { //succcessive animation mode std::pair aPair = getRelativeFrameNumber(myFrame); int aFieldId = aPair.first; long aFrameId = aPair.second; @@ -775,7 +775,7 @@ void VISU_TimeAnimation::_firstFrame() { int imax; if ( myAnimationMode == 0 ) // parallel animation mode imax = getNbFields(); - else //consecutive animation mode + else //succcessive animation mode imax = 1; for (i = 0; i < imax; i++) @@ -814,7 +814,7 @@ void VISU_TimeAnimation::_lastFrame() { if (myFieldsLst[i].myActors[myFrame] != 0) visibilityOff(i, myFrame); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -832,7 +832,7 @@ void VISU_TimeAnimation::_lastFrame() { ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, myFrame, myFieldsLst[0].myTiming[myFrame])); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -874,7 +874,7 @@ void VISU_TimeAnimation::_gotoFrame(CORBA::Long theFrame) { if (myFieldsLst[i].myActors[myFrame] != 0) visibilityOff(i, myFrame); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -892,7 +892,7 @@ void VISU_TimeAnimation::_gotoFrame(CORBA::Long theFrame) { ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, myFrame, myFieldsLst[0].myTiming[myFrame])); } - else { //consecutive animation mode + else { //succcessive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; @@ -939,7 +939,7 @@ VISU::ColoredPrs3d_ptr VISU_TimeAnimation::getPresentation(CORBA::Long theField, CORBA::Long VISU_TimeAnimation::getNbFrames() { if ( myAnimationMode == 0 ) // parallel animation mode return (getNbFields() > 0)? myFieldsLst[0].myNbFrames : 0; - else //consecutive animation mode + else //succcessive animation mode return (getNbFields() > 0) ? myFieldsAbsFrames[myFieldsAbsFrames.size()-1] : 0; } @@ -954,7 +954,7 @@ long VISU_TimeAnimation::getAbsoluteFrameNumber(std::pair theFieldTime if ( aFrameNum <= myFieldsAbsFrames[0] ) aRes = aFrameNum; } - else { //consecutive animation mode + else { //succcessive animation mode if ( aFieldId == 0 && aFrameNum <= myFieldsAbsFrames[aFieldId] ) aRes = aFrameNum; else if ( aFieldId && aFrameNum <= myFieldsAbsFrames[aFieldId] - myFieldsAbsFrames[aFieldId-1] ) @@ -974,7 +974,7 @@ std::pair VISU_TimeAnimation::getRelativeFrameNumber(long theFrame) aRes.first = 0; aRes.second = theFrame - 1; } - else { //consecutive animation mode + else { //succcessive animation mode for (int i = 0, iEnd = myFieldsAbsFrames.size(); i < iEnd; i++) if ( myFieldsAbsFrames[i] >= theFrame ) { aRes.first = i; @@ -1077,7 +1077,7 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QValueList& } //------------------------------------------------------------------------ -void VISU_TimeAnimation::consecutiveAnimation( bool& theIsDumping, QValueList& theIndexList ) +void VISU_TimeAnimation::succcessiveAnimation( bool& theIsDumping, QValueList& theIndexList ) { if ( myFrame >= getNbFrames() - 1 ) return; @@ -1258,8 +1258,8 @@ void VISU_TimeAnimation::run() if ( myAnimationMode == 0 ) // parallel animation mode parallelAnimation( isDumping, anIndexList ); - else //consecutive animation mode - consecutiveAnimation( isDumping, anIndexList ); + else //succcessive animation mode + succcessiveAnimation( isDumping, anIndexList ); // make AVI file if need if (isDumping && myDumpFormat.compare("AVI") == 0) { diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index 4d79215e..07db1a65 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -75,7 +75,7 @@ class VISU_TimeAnimation: public QObject, public QThread void _emitStopped(); void parallelAnimation( bool& theIsDumping, QValueList& theIndexList ); - void consecutiveAnimation( bool& theIsDumping, QValueList& theIndexList ); + void succcessiveAnimation( bool& theIsDumping, QValueList& theIndexList ); void saveImages( int theFieldId, double& theOneVal, int& theNbFiles, QValueList& theIndexList ); public: -- 2.39.2