mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-20 11:48:35 -06:00
#5539 Populate the vector selection dialog from selection
This commit is contained in:
parent
3b0aacb666
commit
233f63e80b
@ -354,20 +354,8 @@ void RimAnalysisPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
// Do select variables
|
||||
RiuSummaryVectorSelectionDialog dlg( nullptr );
|
||||
// RimSummaryCase* candidateCase = m_yValuesSummaryCase();
|
||||
// RifEclipseSummaryAddress candicateAddress = m_yValuesSummaryAddress->address();
|
||||
|
||||
// if ( candidateCase == nullptr )
|
||||
//{
|
||||
// candidateCase = m_xValuesSummaryCase();
|
||||
//}
|
||||
//
|
||||
// if ( !candicateAddress.isValid() )
|
||||
//{
|
||||
// candicateAddress = m_xValuesSummaryAddress->address();
|
||||
//}
|
||||
|
||||
// dlg.hideEnsembles();
|
||||
dlg.setCurveSelection( this->curveDefinitions() );
|
||||
dlg.enableMultiSelect( true );
|
||||
dlg.setCaseAndAddress( nullptr, RifEclipseSummaryAddress() );
|
||||
|
||||
@ -550,3 +538,17 @@ void RimAnalysisPlot::updatePlotTitle()
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RiaSummaryCurveDefinition> RimAnalysisPlot::curveDefinitions()
|
||||
{
|
||||
std::vector<RiaSummaryCurveDefinition> curveDefs;
|
||||
for ( auto dataEntry : m_data )
|
||||
{
|
||||
curveDefs.push_back( dataEntry->curveDefinition() );
|
||||
}
|
||||
|
||||
return curveDefs;
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RimPlot.h"
|
||||
|
||||
#include <QDateTime>
|
||||
@ -109,6 +111,8 @@ private:
|
||||
void buildTestPlot( RiuGroupedBarChartBuilder& chartBuilder );
|
||||
void updatePlotTitle();
|
||||
|
||||
std::vector<RiaSummaryCurveDefinition> curveDefinitions();
|
||||
|
||||
private:
|
||||
QPointer<RiuQwtPlotWidget> m_plotWidget;
|
||||
|
||||
|
@ -69,9 +69,9 @@ void RimAnalysisPlotDataEntry::setFromCurveDefinition( const RiaSummaryCurveDefi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotDataEntry::setSummaryCase( RimSummaryCase* sumCase )
|
||||
RiaSummaryCurveDefinition RimAnalysisPlotDataEntry::curveDefinition() const
|
||||
{
|
||||
m_summaryCase = sumCase;
|
||||
return RiaSummaryCurveDefinition( m_summaryCase(), m_summaryAddress->address(), m_ensemble() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -90,14 +90,6 @@ RimSummaryCaseCollection* RimAnalysisPlotDataEntry::ensemble() const
|
||||
return m_ensemble;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnalysisPlotDataEntry::setSummaryAddress( const RifEclipseSummaryAddress& address )
|
||||
{
|
||||
m_summaryAddress->setAddress( address );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@ -26,7 +27,6 @@
|
||||
class RimSummaryCase;
|
||||
class RimSummaryAddress;
|
||||
class RimSummaryCaseCollection;
|
||||
class RiaSummaryCurveDefinition;
|
||||
|
||||
class RimAnalysisPlotDataEntry : public caf::PdmObject
|
||||
{
|
||||
@ -36,14 +36,12 @@ public:
|
||||
RimAnalysisPlotDataEntry();
|
||||
~RimAnalysisPlotDataEntry() override;
|
||||
|
||||
void setFromCurveDefinition( const RiaSummaryCurveDefinition& curveDef );
|
||||
void setFromCurveDefinition( const RiaSummaryCurveDefinition& curveDef );
|
||||
RiaSummaryCurveDefinition curveDefinition() const;
|
||||
|
||||
void setSummaryCase( RimSummaryCase* sumCase );
|
||||
RimSummaryCase* summaryCase() const;
|
||||
RimSummaryCaseCollection* ensemble() const;
|
||||
|
||||
void setSummaryAddress( const RifEclipseSummaryAddress& address );
|
||||
RifEclipseSummaryAddress summaryAddress() const;
|
||||
RifEclipseSummaryAddress summaryAddress() const;
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||
|
@ -107,6 +107,14 @@ void RiuSummaryVectorSelectionDialog::setEnsembleAndAddress( RimSummaryCaseColle
|
||||
updateLabel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionDialog::setCurveSelection( const std::vector<RiaSummaryCurveDefinition>& selection )
|
||||
{
|
||||
summaryAddressSelection()->setSelectedCurveDefinitions( selection );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -132,11 +140,11 @@ void RiuSummaryVectorSelectionDialog::hideSummaryCases()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionDialog::enableMultiSelect( bool enable )
|
||||
{
|
||||
summaryAddressSelection()->setMultiSelectionMode(enable);
|
||||
summaryAddressSelection()->setMultiSelectionMode( enable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,11 +41,12 @@ public:
|
||||
|
||||
void setCaseAndAddress( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& address );
|
||||
void setEnsembleAndAddress( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& address );
|
||||
void setCurveSelection( const std::vector<RiaSummaryCurveDefinition>& selection );
|
||||
std::vector<RiaSummaryCurveDefinition> curveSelection() const;
|
||||
|
||||
void hideEnsembles();
|
||||
void hideSummaryCases();
|
||||
void enableMultiSelect(bool enable);
|
||||
void enableMultiSelect( bool enable );
|
||||
|
||||
private:
|
||||
RiuSummaryVectorSelectionUi* summaryAddressSelection() const;
|
||||
|
Loading…
Reference in New Issue
Block a user