2017-11-07 13:40:45 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-11-07 13:40:45 -06: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
|
|
|
//
|
2017-11-07 13:40:45 -06: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>
|
2017-11-07 13:40:45 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimSummaryCrossPlotCollection.h"
|
|
|
|
|
2019-10-09 02:21:28 -05:00
|
|
|
#include "RimProject.h"
|
2017-11-14 05:50:21 -06:00
|
|
|
#include "RimSummaryCrossPlot.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimSummaryPlot.h"
|
2017-11-07 13:40:45 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimSummaryCrossPlotCollection, "SummaryCrossPlotCollection" );
|
2017-11-07 13:40:45 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 13:40:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryCrossPlotCollection::RimSummaryCrossPlotCollection()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "Summary Cross Plots", ":/SummaryXPlotsLight16x16.png", "", "" );
|
2017-11-07 13:40:45 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_summaryCrossPlots, "SummaryCrossPlots", "Summary Cross Plots", "", "", "" );
|
|
|
|
m_summaryCrossPlots.uiCapability()->setUiHidden( true );
|
2017-11-07 13:40:45 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 13:40:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RimSummaryCrossPlotCollection::~RimSummaryCrossPlotCollection()
|
|
|
|
{
|
|
|
|
}
|
2017-11-07 13:40:45 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 13:40:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCrossPlotCollection::deleteAllChildObjects()
|
|
|
|
{
|
2017-11-07 14:26:44 -06:00
|
|
|
m_summaryCrossPlots.deleteAllChildObjects();
|
2017-11-07 13:40:45 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 13:40:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimSummaryPlot*> RimSummaryCrossPlotCollection::summaryPlots() const
|
|
|
|
{
|
2017-11-07 14:26:44 -06:00
|
|
|
return m_summaryCrossPlots.childObjects();
|
2017-11-07 13:40:45 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 13:40:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSummaryCrossPlotCollection::updateSummaryNameHasChanged()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSummaryPlot* plot : m_summaryCrossPlots )
|
2017-11-07 13:40:45 -06:00
|
|
|
{
|
|
|
|
plot->updateCaseNameHasChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 13:40:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSummaryCrossPlotCollection::summaryPlotItemInfos( QList<caf::PdmOptionItemInfo>* optionInfos ) const
|
2017-11-07 13:40:45 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSummaryPlot* plot : m_summaryCrossPlots() )
|
2017-11-07 13:40:45 -06:00
|
|
|
{
|
2020-05-09 04:25:11 -05:00
|
|
|
caf::IconProvider icon = plot->uiCapability()->uiIconProvider();
|
|
|
|
QString displayName = plot->description();
|
2017-11-07 13:40:45 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
optionInfos->push_back( caf::PdmOptionItemInfo( displayName, plot, false, icon ) );
|
2017-11-07 13:40:45 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-07 14:26:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-07 14:26:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-12-12 06:22:16 -06:00
|
|
|
RimSummaryPlot* RimSummaryCrossPlotCollection::createSummaryPlot()
|
2017-11-07 14:26:44 -06:00
|
|
|
{
|
2017-11-14 05:50:21 -06:00
|
|
|
RimSummaryPlot* plot = new RimSummaryCrossPlot();
|
2018-05-15 03:17:03 -05:00
|
|
|
plot->setAsPlotMdiWindow();
|
2017-11-07 14:26:44 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
plot->setDescription( QString( "Summary Cross Plot %1" ).arg( m_summaryCrossPlots.size() ) );
|
2017-11-07 14:26:44 -06:00
|
|
|
|
|
|
|
return plot;
|
|
|
|
}
|
|
|
|
|
2017-12-12 06:22:16 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-12-12 06:22:16 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimSummaryCrossPlotCollection::addSummaryPlot( RimSummaryPlot* plot )
|
2017-12-12 06:22:16 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_summaryCrossPlots().push_back( plot );
|
2017-12-12 06:22:16 -06:00
|
|
|
}
|