@@ -327,6 +327,7 @@ struct SoftwareArguments
327
327
// --- Main loop parameters---
328
328
static const int SOFTWARE_CONTINUE = 42 ;
329
329
bool m_useDisplay; // !< If true, activate the plot and the renderer if VISP_HAVE_DISPLAY is defined.
330
+ bool m_useUserInteraction; // !< If true, program will require some user inputs.
330
331
unsigned int m_nbStepsWarmUp; // !< Number of steps for the warmup phase.
331
332
unsigned int m_nbSteps; // !< Number of steps for the main loop.
332
333
double m_dt; // Period, expressed in seconds
@@ -351,6 +352,7 @@ struct SoftwareArguments
351
352
352
353
SoftwareArguments ()
353
354
: m_useDisplay(true )
355
+ , m_useUserInteraction(true )
354
356
, m_nbStepsWarmUp(200 )
355
357
, m_nbSteps(300 )
356
358
, m_dt(3 .)
@@ -461,6 +463,9 @@ struct SoftwareArguments
461
463
else if (arg == " -d" ) {
462
464
m_useDisplay = false ;
463
465
}
466
+ else if (arg == " -c" ) {
467
+ m_useUserInteraction = false ;
468
+ }
464
469
else if ((arg == " -h" ) || (arg == " --help" )) {
465
470
printUsage (std::string (argv[0 ]));
466
471
SoftwareArguments defaultArgs;
@@ -505,6 +510,7 @@ struct SoftwareArguments
505
510
std::cout << " [--max-distance-likelihood <double>] [-N, --nb-particles <uint>] [--seed <int>] [--nb-threads <int>]" << std::endl;
506
511
std::cout << " [--ampli-max-X <double>] [--ampli-max-Y <double>] [--ampli-max-vX <double>] [--ampli-max-vY <double>]" << std::endl;
507
512
std::cout << " [-d, --no-display] [-h]" << std::endl;
513
+ std::cout << " [-c] [-h]" << std::endl;
508
514
}
509
515
510
516
void printDetails ()
@@ -608,6 +614,10 @@ struct SoftwareArguments
608
614
#else
609
615
std::cout << " OFF" << std::endl;
610
616
#endif
617
+ std::cout << std::endl;
618
+ std::cout << " -c" << std::endl;
619
+ std::cout << " Deactivate user interaction." << std::endl;
620
+ std::cout << " Default: user interaction enabled: " << m_useUserInteraction << std::endl;
611
621
std::cout << std::endl;
612
622
std::cout << " -h, --help" << std::endl;
613
623
std::cout << " Display this help." << std::endl;
@@ -791,7 +801,7 @@ int main(const int argc, const char *argv[])
791
801
std::cout << " Mean error noise = " << meanErrorNoise << " m" << std::endl;
792
802
std::cout << " Mean filtering time = " << averageFilteringTime << " us" << std::endl;
793
803
794
- if (args.m_useDisplay ) {
804
+ if (args.m_useUserInteraction ) {
795
805
std::cout << " Press Enter to quit..." << std::endl;
796
806
std::cin.get ();
797
807
}
0 commit comments