2016-05-09 05:13:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-05-09 05:13:54 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-05-09 05:13:54 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-05-09 05:13:54 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimSummaryPlotCollection.h"
|
|
|
|
|
2019-10-09 02:21:28 -05:00
|
|
|
#include "RimProject.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RimSummaryPlot.h"
|
|
|
|
|
2020-03-10 08:11:22 -05:00
|
|
|
#include "cafPdmFieldScriptability.h"
|
|
|
|
#include "cafPdmObjectScriptability.h"
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimSummaryPlotCollection, "SummaryPlotCollection" );
|
2016-05-09 05:13:54 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-05-09 05:13:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryPlotCollection::RimSummaryPlotCollection()
|
|
|
|
{
|
2020-03-10 08:11:22 -05:00
|
|
|
CAF_PDM_InitScriptableObject( "Summary Plots", ":/SummaryPlotsLight16x16.png", "", "" );
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &summaryPlots, "SummaryPlots", "Summary Plots", "", "", "" );
|
|
|
|
summaryPlots.uiCapability()->setUiHidden( true );
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-05-09 05:13:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryPlotCollection::~RimSummaryPlotCollection()
|
|
|
|
{
|
2017-01-13 02:51:37 -06:00
|
|
|
summaryPlots.deleteAllChildObjects();
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
|
|
|
|
2017-11-23 07:12:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-23 07:12:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-12-14 02:59:11 -06:00
|
|
|
RimSummaryPlot* RimSummaryPlotCollection::createSummaryPlotWithAutoTitle()
|
2017-11-23 07:12:05 -06:00
|
|
|
{
|
|
|
|
RimSummaryPlot* plot = new RimSummaryPlot();
|
2018-05-14 13:48:44 -05:00
|
|
|
plot->setAsPlotMdiWindow();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
plot->enableAutoPlotTitle( true );
|
|
|
|
summaryPlots.push_back( plot );
|
2017-11-23 07:12:05 -06:00
|
|
|
|
|
|
|
return plot;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-23 07:12:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimSummaryPlot* RimSummaryPlotCollection::createNamedSummaryPlot( const QString& name )
|
2017-11-23 07:12:05 -06:00
|
|
|
{
|
|
|
|
RimSummaryPlot* plot = new RimSummaryPlot();
|
2018-05-14 13:48:44 -05:00
|
|
|
plot->setAsPlotMdiWindow();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
summaryPlots.push_back( plot );
|
|
|
|
plot->setDescription( name );
|
2017-11-23 07:12:05 -06:00
|
|
|
|
|
|
|
return plot;
|
|
|
|
}
|
|
|
|
|
2016-07-06 06:35:24 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-07-06 06:35:24 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryPlotCollection::updateSummaryNameHasChanged()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSummaryPlot* plot : summaryPlots )
|
2016-07-06 06:35:24 -05:00
|
|
|
{
|
|
|
|
plot->updateCaseNameHasChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-15 05:39:26 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-09-15 05:39:26 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSummaryPlotCollection::summaryPlotItemInfos( QList<caf::PdmOptionItemInfo>* optionInfos ) const
|
2017-09-15 05:39:26 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSummaryPlot* plot : summaryPlots() )
|
2017-09-15 05:39:26 -05:00
|
|
|
{
|
|
|
|
QString displayName = plot->description();
|
2020-02-12 04:43:15 -06:00
|
|
|
optionInfos->push_back( caf::PdmOptionItemInfo( displayName, plot, false, plot->uiCapability()->uiIconProvider() ) );
|
2017-09-15 05:39:26 -05:00
|
|
|
}
|
|
|
|
}
|
2019-10-31 07:48:40 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryPlotCollection::removeSummaryPlot( RimSummaryPlot* summaryPlot )
|
|
|
|
{
|
|
|
|
summaryPlots.removeChildObject( summaryPlot );
|
|
|
|
}
|