mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Link selection in 3D view with plots (#9195)
* Allow well selections in 3D view to update well selection in summary plots and well log plots
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include "RiuSummaryMultiPlotBook.h"
|
||||
#include "RiuSummaryVectorSelectionUi.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
@@ -143,8 +144,13 @@ RimSummaryMultiPlot::RimSummaryMultiPlot()
|
||||
m_appendPrevCurve.uiCapability()->setUiIconFromResourceString( ":/AppendPrevCurve.png" );
|
||||
|
||||
CAF_PDM_InitField( &m_linkSubPlotAxes, "LinkSubPlotAxes", true, "Link Sub Plot Axes" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_linkSubPlotAxes );
|
||||
CAF_PDM_InitField( &m_linkTimeAxis, "LinkTimeAxis", true, "Link Time Axis" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_linkTimeAxis );
|
||||
CAF_PDM_InitField( &m_autoAdjustAppearance, "AutoAdjustAppearance", true, "Auto Adjust Appearance" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_autoAdjustAppearance );
|
||||
CAF_PDM_InitField( &m_allow3DSelectionLink, "Allow3DSelectionLink", true, "Allow Well Selection from 3D View" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_allow3DSelectionLink );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_axisRangeAggregation, "AxisRangeAggregation", "Axis Range Control" );
|
||||
|
||||
@@ -399,6 +405,9 @@ void RimSummaryMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
dataSourceGroup->setCollapsedByDefault( true );
|
||||
m_sourceStepping()->uiOrdering( uiConfigName, *dataSourceGroup );
|
||||
|
||||
if ( m_sourceStepping->stepDimension() == SourceSteppingDimension::WELL )
|
||||
dataSourceGroup->add( &m_allow3DSelectionLink );
|
||||
|
||||
auto titlesGroup = uiOrdering.addNewGroup( "Main Plot Settings" );
|
||||
titlesGroup->setCollapsedByDefault( true );
|
||||
titlesGroup->add( &m_autoPlotTitle );
|
||||
@@ -1489,3 +1498,13 @@ void RimSummaryMultiPlot::updateStepDimensionFromDefault()
|
||||
{
|
||||
m_sourceStepping->setStepDimension( m_defaultStepDimension() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::selectWell( QString wellName )
|
||||
{
|
||||
if ( !m_allow3DSelectionLink ) return;
|
||||
if ( m_sourceStepping->stepDimension() != SourceSteppingDimension::WELL ) return;
|
||||
m_sourceStepping->setStep( wellName );
|
||||
}
|
||||
|
||||
@@ -111,6 +111,8 @@ public:
|
||||
void storeStepDimensionFromToolbar();
|
||||
void updateStepDimensionFromDefault();
|
||||
|
||||
void selectWell( QString wellName );
|
||||
|
||||
protected:
|
||||
bool handleGlobalKeyEvent( QKeyEvent* keyEvent ) override;
|
||||
bool handleGlobalWheelEvent( QWheelEvent* wheelEvent ) override;
|
||||
@@ -154,6 +156,7 @@ private:
|
||||
caf::PdmField<bool> m_linkSubPlotAxes;
|
||||
caf::PdmField<bool> m_linkTimeAxis;
|
||||
caf::PdmField<bool> m_autoAdjustAppearance;
|
||||
caf::PdmField<bool> m_allow3DSelectionLink;
|
||||
|
||||
caf::PdmField<bool> m_hidePlotsWithValuesBelow;
|
||||
caf::PdmField<double> m_plotFilterYAxisThreshold;
|
||||
|
||||
@@ -239,11 +239,14 @@ QList<caf::PdmOptionItemInfo>
|
||||
{
|
||||
if ( fieldNeedingOptions == &m_vectorName )
|
||||
{
|
||||
m_cachedIdentifiers.clear();
|
||||
|
||||
auto displayAndValueStrings = optionsForQuantity( analyzer );
|
||||
|
||||
for ( const auto& displayAndValue : displayAndValueStrings )
|
||||
{
|
||||
options.append( caf::PdmOptionItemInfo( displayAndValue.first, displayAndValue.second ) );
|
||||
m_cachedIdentifiers.push_back( displayAndValue.first );
|
||||
}
|
||||
|
||||
if ( options.isEmpty() )
|
||||
@@ -294,11 +297,14 @@ QList<caf::PdmOptionItemInfo>
|
||||
identifierTexts = analyzer->identifierTexts( category, secondaryIdentifier );
|
||||
}
|
||||
|
||||
m_cachedIdentifiers.clear();
|
||||
|
||||
if ( !identifierTexts.empty() )
|
||||
{
|
||||
for ( const auto& text : identifierTexts )
|
||||
{
|
||||
options.append( caf::PdmOptionItemInfo( text, text ) );
|
||||
m_cachedIdentifiers.push_back( text );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1179,6 +1185,41 @@ void RimSummaryPlotSourceStepping::syncWithStepper( RimSummaryPlotSourceStepping
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::setStep( QString stepIdentifier )
|
||||
{
|
||||
if ( std::count( m_cachedIdentifiers.begin(), m_cachedIdentifiers.end(), stepIdentifier ) == 0 ) return;
|
||||
|
||||
switch ( m_stepDimension() )
|
||||
{
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL:
|
||||
m_wellName.setValueWithFieldChanged( stepIdentifier );
|
||||
break;
|
||||
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP:
|
||||
m_groupName.setValueWithFieldChanged( stepIdentifier );
|
||||
break;
|
||||
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR:
|
||||
m_vectorName.setValueWithFieldChanged( stepIdentifier );
|
||||
break;
|
||||
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK:
|
||||
m_cellBlock.setValueWithFieldChanged( stepIdentifier );
|
||||
break;
|
||||
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER:
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION:
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::ENSEMBLE:
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::SUMMARY_CASE:
|
||||
default:
|
||||
CAF_ASSERT( false ); // not supported for these dimensions, yet
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
RimSummaryCaseCollection* stepEnsemble( int direction );
|
||||
|
||||
void syncWithStepper( RimSummaryPlotSourceStepping* other );
|
||||
void setStep( QString stepIdentifier );
|
||||
|
||||
RimSummaryDataSourceStepping::SourceSteppingDimension stepDimension() const;
|
||||
void setStepDimension( RimSummaryDataSourceStepping::SourceSteppingDimension dimension );
|
||||
@@ -130,4 +131,5 @@ private:
|
||||
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||
|
||||
RimSummaryDataSourceStepping::Axis m_sourceSteppingType;
|
||||
std::vector<QString> m_cachedIdentifiers;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user