Summary Multiplot: sync plot selection in tree with view (#8788)

* Make sure the subplot selected in the tree is shown in the multiplot viewer. 
* Clean up multiplot toolbar handling a bit
* Remove old summary plot toolbar.
This commit is contained in:
jonjenssen
2022-04-07 16:24:27 +02:00
committed by GitHub
parent 3590c52cdc
commit d156160daf
27 changed files with 78 additions and 228 deletions

View File

@@ -41,7 +41,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewPlotAxisPropertiesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicShowSummaryPlotManagerFeature.h
@@ -90,7 +89,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewPlotAxisPropertiesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicShowSummaryPlotManagerFeature.cpp

View File

@@ -1,59 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- 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 "RicActivateCurveFilterInToolbarFeature.h"
#include "RiaGuiApplication.h"
#include "RiuPlotMainWindow.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicActivateCurveFilterInToolbarFeature, "RicActivateCurveFilterInToolbarFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicActivateCurveFilterInToolbarFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicActivateCurveFilterInToolbarFeature::onActionTriggered( bool isChecked )
{
if ( RiaGuiApplication::isRunning() )
{
auto plotWindow = RiaGuiApplication::instance()->mainPlotWindow();
if ( plotWindow )
{
plotWindow->setFocusToLineEditInSummaryToolBar();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicActivateCurveFilterInToolbarFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Activate Summary Curve Filter Editor" );
applyShortcutWithHintToAction( actionToSetup, QKeySequence( tr( "Ctrl+F" ) ) );
}

View File

@@ -1,34 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- 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.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
//==================================================================================================
///
//==================================================================================================
class RicActivateCurveFilterInToolbarFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -77,7 +77,7 @@ void RicNewSummaryCrossPlotCurveFeature::onActionTriggered( bool isChecked )
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem( newCurve );
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateSummaryPlotToolBar();
mainPlotWindow->updateMultiPlotToolBar();
}
}

View File

@@ -107,7 +107,7 @@ void RicNewSummaryCurveFeature::onActionTriggered( bool isChecked )
app->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem( newCurve );
RiuPlotMainWindow* mainPlotWindow = app->mainPlotWindow();
mainPlotWindow->updateSummaryPlotToolBar();
mainPlotWindow->updateMultiPlotToolBar();
}
}

View File

@@ -130,7 +130,7 @@ RimSummaryPlot*
if ( mainPlotWindow )
{
mainPlotWindow->selectAsCurrentItem( firstCurveSetCreated );
mainPlotWindow->updateSummaryPlotToolBar();
mainPlotWindow->updateMultiPlotToolBar();
}
return plot;
}
@@ -183,7 +183,7 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered( bool isChecked )
if ( mainPlotWindow && firstCurveSet )
{
mainPlotWindow->selectAsCurrentItem( firstCurveSet );
mainPlotWindow->updateSummaryPlotToolBar();
mainPlotWindow->updateMultiPlotToolBar();
}
}
}

View File

@@ -236,7 +236,7 @@ void RicSummaryPlotEditorUi::fieldChangedByUi( const caf::PdmFieldHandle* change
field->setValueWithFieldChanged( true );
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateSummaryPlotToolBar();
mainPlotWindow->updateMultiPlotToolBar();
}
else if ( changedField == &m_useAutoAppearanceAssignment && m_useAutoAppearanceAssignment )
{
@@ -861,7 +861,7 @@ void RicSummaryPlotEditorUi::createNewPlot()
m_targetPlot = newSummaryPlot;
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
mainPlotWindow->updateSummaryPlotToolBar();
mainPlotWindow->updateMultiPlotToolBar();
}
}