From b4837bcd14fba2d6ae3ff11b32face6b5738da1a Mon Sep 17 00:00:00 2001 From: amx Date: Thu, 5 Apr 2007 09:47:48 +0000 Subject: [PATCH] PAL13174: Now user can choose between (1.-cos( aT ))/2. and sin( aT - PI/2 ) functions in sweap feature. --- src/VISUGUI/VISU_msg_en.po | 7 +++++-- src/VISUGUI/VisuGUI.cxx | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index dc445692..30ad9273 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -159,8 +159,11 @@ msgstr "Sweeping preferences" msgid "VISU_LINEAR_SWEEP" msgstr "Linear" -msgid "VISU_U_SWEEP" -msgstr "Cosinusoidal" +msgid "VISU_COS_SWEEP" +msgstr "Cosinusoidal ( (1 - cos(t))/2 )" + +msgid "VISU_SIN_SWEEP" +msgstr "Sinusoidal ( sin( t - PI/2 ) )" msgid "VISU_SWEEPING_MODES" msgstr "Mode of the sweeping " diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index bec2bebf..73812924 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1657,11 +1657,17 @@ OnSweep() for (int i = 0; i <= aSteps; i++) { try { float aPercents; - if( aMode == 1 ){ //if selected Periodic mode of sweeping - float aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps ); - //This is necessary in order for animation to retrun to the initial picture + float aT; + if( aMode >= 1 ) + aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps ); + if( aMode == 1 ){ //if selected Periodic cosinusoidal mode of sweeping + //This is necessary in order for animation to return to the initial picture aPercents = (1.-cos( aT ))/2.; } + else if( aMode == 2 ){ //if selected Periodic sinusoidal mode of sweeping + //This is necessary in order for animation to return to the initial picture + aPercents = sin( aT - PI/2 ); + } else //if selected Linear mode of sweeping aPercents = float(i)/aSteps; aPrsObject->SetMapScale(aPercents); @@ -3127,10 +3133,12 @@ void VisuGUI::createPreferences() int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" ); QStringList sweep_modes; sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) ); - sweep_modes.append( tr( "VISU_U_SWEEP" ) ); + sweep_modes.append( tr( "VISU_COS_SWEEP" ) ); + sweep_modes.append( tr( "VISU_SIN_SWEEP" ) ); indices.clear(); indices.append( 0 ); indices.append( 1 ); + indices.append( 2 ); setPreferenceProperty( modeSw, "strings", sweep_modes ); setPreferenceProperty( modeSw, "indexes", indices ); -- 2.39.2