diff --git a/Modules/Visualization/Monteverdi/include/mvdMainWindow.h b/Modules/Visualization/Monteverdi/include/mvdMainWindow.h index f8523b7f5dd5fa4b303b778ca7308d76c559e61a..dcd7d76b52c02c068ed7112aa9cb9bda1c70d9d4 100644 --- a/Modules/Visualization/Monteverdi/include/mvdMainWindow.h +++ b/Modules/Visualization/Monteverdi/include/mvdMainWindow.h @@ -150,7 +150,7 @@ public slots: /** */ - void ImportImages( const QStringList & filenames ); + void ImportImages( const QStringList & filenames, bool enableOverviews ); /*-[ SIGNALS SECTION ]-----------------------------------------------------*/ diff --git a/Modules/Visualization/Monteverdi/src/main.cxx b/Modules/Visualization/Monteverdi/src/main.cxx index e44dbb8459d0b239c8bc5c5283d5c41a6412d7ef..6fcd93e2970877107f92900c7b2487b7a0a3f212 100644 --- a/Modules/Visualization/Monteverdi/src/main.cxx +++ b/Modules/Visualization/Monteverdi/src/main.cxx @@ -65,12 +65,14 @@ struct Flags { Flags() : loadOTBApplications( false ), - forceNoGLSL( false ) + forceNoGLSL( false ), + forceNoOverviews( false ) { } bool loadOTBApplications: 1; bool forceNoGLSL: 1; + bool forceNoOverviews: 1; }; @@ -111,9 +113,13 @@ main( int argc, char* argv[] ) QCoreApplication::translate( PROJECT_NAME, "Usage: %1 [-h|--help] [-a|--applications] [<filename>...]\n" - " -n, --no-glsl force OpenGL 1.x compatible rendering." - " -a, --applications load OTB-applications from OTB_APPLICATIONS_PATH." - " -h, --help display this help message.\n" + " -a, --applications load OTB-applications from OTB_APPLICATIONS_PATH." + " -h, --help display this help message.\n" + " -g, --no-glsl force OpenGL 1.x compatible rendering." + " -o, --no-overviews ignore build GDAL overviews step." +#if 0 + " -O, --force-overviews force build GDAL overviews step." +#endif ) .arg( QFileInfo( argv[ 0 ] ).baseName() ) ) @@ -130,7 +136,15 @@ main( int argc, char* argv[] ) it = args.erase( it ); } - else if(it->compare( "-n" )==0 || + else if(it->compare( "-o" )==0 || + it->compare( "--no-overviews" )==0 ) + { + flags.forceNoOverviews = true; + + it = args.erase( it ); + } + + else if(it->compare( "-g" )==0 || it->compare( "--no-glsl" )==0 ) { flags.forceNoGLSL = true; @@ -212,7 +226,7 @@ main( int argc, char* argv[] ) // 6. Load command-line filenames. args.pop_front(); - mainWindow.ImportImages( args ); + mainWindow.ImportImages( args, !flags.forceNoOverviews ); // // 6. Let's go: run the application and return exit code. diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx index 80155f6fdbcf673786fe008cf34ee3bb9dc6e3a6..1371577ce9d66acf8a86bd2faaf27da38464f26f 100644 --- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx +++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx @@ -1362,7 +1362,7 @@ MainWindow /*****************************************************************************/ void MainWindow -::ImportImages( const QStringList & filenames ) +::ImportImages( const QStringList & filenames, bool enableOverviews ) { if( filenames.isEmpty() ) return; @@ -1376,7 +1376,8 @@ MainWindow ) ); - if( ( value.isValid() ? value.toBool() : OVERVIEWS_ENABLED_DEFAULT ) && + if( enableOverviews && + ( value.isValid() ? value.toBool() : OVERVIEWS_ENABLED_DEFAULT ) && !BuildGDALOverviews( filenames ) ) return; } @@ -1809,7 +1810,8 @@ MainWindow // Select filename. QString caption(tr("Open file...")); ImportImages( - otb::GetOpenFileNames( this, caption ) + otb::GetOpenFileNames( this, caption ), + true ); }