int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
int aSteps = aResourceMgr->integerValue("VISU", "sweeping_number_steps", 40);
+ int aMode = aResourceMgr->integerValue("VISU", "sweeping_modes", 0);
+
+ int is2Pi = aResourceMgr->integerValue("VISU", "sweeping_is2PI", 0);
+
// Sweep
QApplication::setOverrideCursor(Qt::waitCursor);
+
for (int j = 0; j < aCycles; j++) {
for (int i = 0; i <= aSteps; i++) {
try {
- float aPercents = float(i)/aSteps;
+ 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
+ aPercents = (1.+sin( aT - PI/2. ))/2.;
+ }
+ else //if selected Linear mode of sweeping
+ aPercents = float(i)/aSteps;
aPrsObject->SetMapScale(aPercents);
aPrsObject->UpdateActor(aActor);
vw->getRenderWindow()->Render();
// group: "Sweeping preferences"
int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
setPreferenceProperty( sweepGr, "columns", 1 );
+
+ 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" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( modeSw, "strings", sweep_modes );
+ setPreferenceProperty( modeSw, "indexes", indices );
int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr,
LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+ int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
+ QStringList ranges;
+ ranges.append( tr( "PERIOD_PI" ) );
+ ranges.append( tr( "PERIOD_2PI" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( rangeSw, "strings", ranges );
+ setPreferenceProperty( rangeSw, "indexes", indices );
+
setPreferenceProperty( timestep, "min", 0.1 );
setPreferenceProperty( timestep, "step", 0.1 );
setPreferenceProperty( timestep, "max", 1000 );
setPreferenceProperty( nbcycles, "max", 100 );
- setPreferenceProperty( nbsteps, "max", 200 );
+ setPreferenceProperty( nbsteps, "max", 200 );
// group: "MED files import"
int importGr = addPreference( tr( "MED files import" ), srangeTab );