#4852 Command Line : Add snapshotsize

This commit is contained in:
Magne Sjaastad 2019-10-11 10:57:20 +02:00
parent 4bfcf86962
commit 225893dcda
2 changed files with 18 additions and 6 deletions

View File

@ -648,9 +648,6 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( cvf::Progr
setStartDir( cvfqt::Utils::toQString( o.value( 0 ) ) );
}
int snapshotWidth = -1;
int snapshotHeight = -1;
if ( cvf::Option o = progOpt->option( "size" ) )
{
int width = o.safeValue( 0 ).toInt( -1 );
@ -658,9 +655,6 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( cvf::Progr
if ( width > 0 && height > 0 )
{
snapshotWidth = width;
snapshotHeight = height;
auto mainWindow = RiuMainWindow::instance();
if ( mainWindow )
{
@ -675,6 +669,20 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( cvf::Progr
}
}
int snapshotWidth = -1;
int snapshotHeight = -1;
if ( cvf::Option o = progOpt->option( "snapshotsize" ) )
{
int width = o.safeValue( 0 ).toInt( -1 );
int height = o.safeValue( 1 ).toInt( -1 );
if ( width > 0 && height > 0 )
{
snapshotWidth = width;
snapshotHeight = height;
}
}
if ( cvf::Option o = progOpt->option( "summaryplot" ) )
{
RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( cvfqt::Utils::toQStringList( o.values() ) );

View File

@ -100,6 +100,10 @@ bool RiaArgumentParser::parseArguments( cvf::ProgramOptions* progOpt )
"'commandFileReplaceCases'.\n",
cvf::ProgramOptions::SINGLE_VALUE );
progOpt->registerOption( "snapshotsize",
"<width> <height>",
"Set size of exported snapshot images.",
cvf::ProgramOptions::MULTI_VALUE );
progOpt->registerOption( "savesnapshots",
"all|views|plots",
"Save snapshot of all views or plots to project file location sub folder 'snapshots'. "