Add summary multi plot

Improve robustness related to update of Summary Plot Manager

Add RimSummaryMultiPlot
Move shared code into RiaSummaryStringTools
Added "Create Summary Multi Plot" to menu of MultiPlot in project tree
This commit is contained in:
Magne Sjaastad
2021-12-23 09:30:36 +01:00
committed by GitHub
parent 21f0988493
commit 4d21f90bf9
21 changed files with 993 additions and 231 deletions

View File

@@ -0,0 +1,82 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021 Equinor ASA
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewSummaryMultiPlotFeature.h"
#include "RimMultiPlotCollection.h"
#include "RimPlot.h"
#include "RimSummaryMultiPlot.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include <QAction>
RICF_SOURCE_INIT( RicNewSummaryMultiPlotFeature, "RicNewSummaryMultiPlotFeature", "createSummaryMultiPlot" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicNewSummaryMultiPlotFeature::RicNewSummaryMultiPlotFeature()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmScriptResponse RicNewSummaryMultiPlotFeature::execute()
{
std::vector<RimPlot*> plots;
RimSummaryMultiPlot::createAndAppendMultiPlot( plots );
return caf::PdmScriptResponse();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewSummaryMultiPlotFeature::isCommandEnabled()
{
RimMultiPlotCollection* objToFind = nullptr;
auto pdmUiItem = caf::SelectionManager::instance()->selectedItem();
auto objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType( objToFind );
}
return ( objToFind != nullptr );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSummaryMultiPlotFeature::onActionTriggered( bool isChecked )
{
execute();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSummaryMultiPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Create Summary Multi Plot" );
actionToSetup->setIcon( QIcon( ":/MultiPlot16x16.png" ) );
}