mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2917 Vector Selection Dialog: Rename method for retreiving all expanded curve defintions. Add method to retreive only the selection (one definition pr ensemble curve set)
This commit is contained in:
parent
1b5c1b5e56
commit
a222c096f3
@ -324,7 +324,7 @@ void RicSummaryCurveCreator::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
|||||||
void RicSummaryCurveCreator::syncPreviewCurvesFromUiSelection()
|
void RicSummaryCurveCreator::syncPreviewCurvesFromUiSelection()
|
||||||
{
|
{
|
||||||
std::vector<RiaSummaryCurveDefinition> allCurveDefinitionsVector =
|
std::vector<RiaSummaryCurveDefinition> allCurveDefinitionsVector =
|
||||||
m_summaryCurveSelectionEditor->summaryAddressSelection()->selectedCurveDefinitions();
|
m_summaryCurveSelectionEditor->summaryAddressSelection()->allCurveDefinitionsFromSelection();
|
||||||
std::set<RiaSummaryCurveDefinition> allCurveDefinitions =
|
std::set<RiaSummaryCurveDefinition> allCurveDefinitions =
|
||||||
std::set<RiaSummaryCurveDefinition>(allCurveDefinitionsVector.begin(), allCurveDefinitionsVector.end());
|
std::set<RiaSummaryCurveDefinition>(allCurveDefinitionsVector.begin(), allCurveDefinitionsVector.end());
|
||||||
|
|
||||||
|
@ -249,12 +249,12 @@ RiuSummaryCurveDefSelection::~RiuSummaryCurveDefSelection()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::selectedCurveDefinitions() const
|
std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::allCurveDefinitionsFromSelection() const
|
||||||
{
|
{
|
||||||
std::vector<RiaSummaryCurveDefinition> curveDefVector;
|
std::vector<RiaSummaryCurveDefinition> curveDefVector;
|
||||||
|
|
||||||
{
|
{
|
||||||
std::set<RiaSummaryCurveDefinition> caseAndAddressPairs;
|
std::set<RiaSummaryCurveDefinition> curveDefinitions;
|
||||||
|
|
||||||
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
||||||
|
|
||||||
@ -289,19 +289,59 @@ std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::selectedCurv
|
|||||||
{
|
{
|
||||||
if (selectedAddressesFromUi.count(readerAddress) > 0)
|
if (selectedAddressesFromUi.count(readerAddress) > 0)
|
||||||
{
|
{
|
||||||
caseAndAddressPairs.insert(RiaSummaryCurveDefinition(currCase, readerAddress, ensemble));
|
curveDefinitions.insert(RiaSummaryCurveDefinition(currCase, readerAddress, ensemble));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::copy(caseAndAddressPairs.begin(), caseAndAddressPairs.end(), std::back_inserter(curveDefVector));
|
std::copy(curveDefinitions.begin(), curveDefinitions.end(), std::back_inserter(curveDefVector));
|
||||||
}
|
}
|
||||||
|
|
||||||
return curveDefVector;
|
return curveDefVector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
/// One CurveDefinition pr ensemble curve set
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelection::selection() const
|
||||||
|
{
|
||||||
|
std::vector<RiaSummaryCurveDefinition> curveDefSelection;
|
||||||
|
std::set<RifEclipseSummaryAddress> selectedAddressesFromUi = buildAddressListFromSelections();
|
||||||
|
for (SummarySource* currSource : selectedSummarySources())
|
||||||
|
{
|
||||||
|
RimSummaryCaseCollection* ensemble = dynamic_cast<RimSummaryCaseCollection*>(currSource);
|
||||||
|
RimSummaryCase* sourceCase = dynamic_cast<RimSummaryCase*>(currSource);
|
||||||
|
if (ensemble)
|
||||||
|
{
|
||||||
|
std::set<RifEclipseSummaryAddress> addressUnion = ensemble->calculateUnionOfSummaryAddresses();
|
||||||
|
for ( const auto& addr : selectedAddressesFromUi)
|
||||||
|
{
|
||||||
|
if (addressUnion.count(addr))
|
||||||
|
{
|
||||||
|
curveDefSelection.push_back(RiaSummaryCurveDefinition(nullptr, addr, ensemble));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!(sourceCase && sourceCase->summaryReader())) continue;
|
||||||
|
|
||||||
|
const std::vector<RifEclipseSummaryAddress>& readerAddresses = sourceCase->summaryReader()->allResultAddresses();
|
||||||
|
for ( const auto& addr : readerAddresses)
|
||||||
|
{
|
||||||
|
if (selectedAddressesFromUi.count(addr))
|
||||||
|
{
|
||||||
|
curveDefSelection.push_back(RiaSummaryCurveDefinition(sourceCase, addr, nullptr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return curveDefSelection;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -56,7 +56,9 @@ public:
|
|||||||
virtual ~RiuSummaryCurveDefSelection();
|
virtual ~RiuSummaryCurveDefSelection();
|
||||||
|
|
||||||
void setSelectedCurveDefinitions(const std::vector<RiaSummaryCurveDefinition>& curveDefinitions);
|
void setSelectedCurveDefinitions(const std::vector<RiaSummaryCurveDefinition>& curveDefinitions);
|
||||||
std::vector<RiaSummaryCurveDefinition> selectedCurveDefinitions() const;
|
std::vector<RiaSummaryCurveDefinition> allCurveDefinitionsFromSelection() const;
|
||||||
|
std::vector<RiaSummaryCurveDefinition> selection() const;
|
||||||
|
|
||||||
void setMultiSelectionMode(bool multiSelectionMode);
|
void setMultiSelectionMode(bool multiSelectionMode);
|
||||||
void hideEnsembles(bool hide);
|
void hideEnsembles(bool hide);
|
||||||
void hideSummaryCases(bool hide);
|
void hideSummaryCases(bool hide);
|
||||||
|
@ -109,7 +109,7 @@ void RiuSummaryCurveDefSelectionDialog::setEnsembleAndAddress(RimSummaryCaseColl
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelectionDialog::curveSelection() const
|
std::vector<RiaSummaryCurveDefinition> RiuSummaryCurveDefSelectionDialog::curveSelection() const
|
||||||
{
|
{
|
||||||
return summaryAddressSelection()->selectedCurveDefinitions();
|
return summaryAddressSelection()->allCurveDefinitionsFromSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -142,7 +142,7 @@ RiuSummaryCurveDefSelection* RiuSummaryCurveDefSelectionDialog::summaryAddressSe
|
|||||||
void RiuSummaryCurveDefSelectionDialog::updateLabel()
|
void RiuSummaryCurveDefSelectionDialog::updateLabel()
|
||||||
{
|
{
|
||||||
QString curveAddressText;
|
QString curveAddressText;
|
||||||
std::vector<RiaSummaryCurveDefinition> sumCasePairs = this->summaryAddressSelection()->selectedCurveDefinitions();
|
std::vector<RiaSummaryCurveDefinition> sumCasePairs = this->summaryAddressSelection()->allCurveDefinitionsFromSelection();
|
||||||
if (sumCasePairs.size() == 1)
|
if (sumCasePairs.size() == 1)
|
||||||
{
|
{
|
||||||
curveAddressText = sumCasePairs.front().curveDefinitionText();
|
curveAddressText = sumCasePairs.front().curveDefinitionText();
|
||||||
|
Loading…
Reference in New Issue
Block a user